Google
Tech-Bits

Tech-Bits

Sunday, April 19, 2009

WebSphere to ActiveMQ

Define generic jms provider
1. Login to WebSphere Admin Console. Go to Resources->GenericJMSProviders
2. Select the scope = specify node and the server
3. Click New
1. Name = payment server
2. description = gateway to payment server
3. Classpath
1. path-to-websphere-lib-ext-directory/activeio-core-3.0.0-incubator.jar
2. path-to-websphere-lib-ext-directory/activemq-core-4.1.1.jar
3. path-to-websphere-lib-ext-directory/activemq-jaas-4.1.1.jar
4. path-to-websphere-lib-ext-directory/activemq-web-4.1.1.jar
5. path-to-websphere-lib-ext-directory/backport-util-concurrent-2.1.jar
6. path-to-websphere-lib-ext-directory/commons-logging-1.1.1.jar
7. path-to-websphere-lib-ext-directory/geronimo-jms_1.1_spec-1.1.1.jar
4. External Initial Context Factory = org.apache.activemq.jndi.ActiveMQWASInitialContextFactory
5. External Provider URL = tcp://brokerHost:62002
4. Apply->ok->Save

Configure JMS Connection Factory for the defined provider
1. Go to Resources > Generic JMS Providers > payment server > JMS Connection Factories >
2. Click New
1. Name = order connection factory
2. Type = QUEUE
3. JNDI Name = jms/orderConnectionFactory
4. External JNDI Name = paymentServer/orderConnectionFactory
5. Container-managed Authentication Alias = as appropriate
3. Apply->ok->Save

Configure JMS Destinations for the defined provider
1. order creation
2. Go to Resources > Generic JMS Providers > payment server > JMS Destinations >
3. Click New
1. Name = order connection
2. Type = QUEUE
3. JNDI Name = jms/orderConnection
4. Description = The external active mq queue where messages will be sent to.
5. External JNDI Name = dynamicQueues/order.in
4. Apply->ok->Save


Configure Custom properties for the defined provider
1. Connection Factories
2. Go to Resources > Generic JMS Providers > payment server > Custom Properties >
3. Click New
1. Name = java.naming.connectionFactoryNames
2. Value = paymentServer/orderConnectionFactory
3. Type = java.lang.String
4. Apply->ok->Save

1. Destinations java.naming.queue.order.in
2. Go to Resources > Generic JMS Providers > payment server > Custom Properties >
3. Click New
1. Name = java.naming.queue.order.in
2. Value = order.in
3. Type = java.lang.String
4. Apply->ok->Save

Wednesday, March 01, 2006

Null Pointer Exception when using Generate deploy/rmic in WSAD

Exception::

at java.lang.NullPointerException.(NullPointerException.java)
at com.ibm.etools.java.plugin.ProjectUtilities.collectClasspathURLs(ProjectUtilities.java)
at com.ibm.etools.ejbdeploy.plugin.EJBDeployOperation.run(EJBDeployOperation.java:1255)
at com.ibm.etools.ejbdeploy.ui.plugin.DeployRMICBeansOperation.
generateDeployCode(DeployRMICBeansOperation.java:304)

Cause::
This problem occurs when we build/generate/deploy rmic code for
EJB projects without building the projects that need to be pre-built.

Solution::
Build projects based on their dependence hierarchy we wont get this error.

Saturday, March 26, 2005

Configuring and setting ProxyHTMLURLMap for Reverse Proxy with Apache2.2 on WindowsXP

ProxyHTMLURLMap - it rewrites links in the served webpages from the server which is being proxied.
But For enabling ProxyHTMLURLMap we need mod_proxy_html.so in your modules directory.

Steps:
download the package http://www.apachelounge.com/download/mods/mod_proxy_html-3.1.2-w32.zip
The install-help is in the readme.txt available in the zip, and I have detailed it here.

1. Create folder .../apache2/modules/mod_proxy_html
and copy mod_proxy_html.so

2. Install the Visual C++ 2008 Redistributable Package
Download, it from:
www.microsoft.com/downloads/details.aspx?FamilyID=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en

3. A couple of pre-requisite dll's are needed on Windows.

4. Get the following from ftp://ftp.zlatkovic.com/libxml/
- libxml*.zip
- zlib*.zip
- iconv*.zip

5. Unpack the zip to extract the following files to the mod_proxy_html folder created above.
- iconv.dll
- zlib.dll
- libxml2.dll

6. Add to your httpd.conf
LoadModule headers_module modules/mod_headers.so
LoadFile modules/mod_proxy_html/iconv.dll
LoadFile modules/mod_proxy_html/iconv.dll
LoadFile modules/mod_proxy_html/iconv.dll
LoadModule proxy_html_module modules/mod_proxy_html.so

Now you're ready to work with Html re-writes.

An example configuration along with proxy pass is:


ServerName externaldns.com
ProxyRequests Off
ProxyPreserveHost Off

Order deny,allow
Allow from all

ProxyPass /uk http://internal-server:8080/UK/
ProxyPass /us http://internal-server:8080/NA/
ProxyHTMLURLMap http://internal-server:8080/UK
ProxyHTMLURLMap http://internal-server:8080/NA

ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap / /uk
ProxyHTMLURLMap /uk /uk
RequestHeader unset Accept-Encoding



ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap / /na
ProxyHTMLURLMap /na /na
RequestHeader unset Accept-Encoding



Friday, March 11, 2005

ORB error: Script executes from shell while throws error executing from Cron

java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
org.openorb.io.LocalInputStream.read_boolean(Unknown Source)
org.omg.CosNaming.NamingContextHelper.narrow

1.This is necessary for the Marshalling and building the Objects for the ORB to un-Marshall on the other end.
2.This is available when executing as a normall shell script from command-line but when executing from cron, the cron uses root permissions and settings so these settings as necessitated by Omni-ORB need to be set by us. Otherwise if we run the script using cron it will fail.
LC_MONETARY=en_GB.ISO8859-15
LC_TIME=en_GB.ISO8859-15
LC_MESSAGES=C
LC_CTYPE=en_GB.ISO8859-15
LC_COLLATE=en_GB.ISO8859-15
LC_NUMERIC=en_GB.ISO8859-15

These settings are building blocks for the Object building and communication.

Monday, March 07, 2005

Error Building with Ant in WSAD - Modern compiler not found - looking for classic compiler

Errors:
1.Modern compiler not found - looking for classic compiler
2.[javac] BUILD FAILED: Error starting modern compiler
3.target JDK should be comprised in between '1.1' and '1.4': javac1.4

Hi,
These errors pop up when I use Ant within WSAD 5.1 I was trying to compile my source code for complying to JAVA 1.4 When I use WSAD build/rebuild project it works. Then I figured Ant was using the 1.3 compiler inside eclipse plugin. So I set the compiler attribute to pick up the 1.4 compiler. Still I had similar errors [3rd error]. I think ant script behaves wierd inside of eclipse/wsad. The basic problem is :
Ant starts with whatever JRE/JDK WSAD starts up with.
After exhausting myself with all kinds of solutions pointed over the web :
1. Add tools.jar of java1.4 to ant library path
2. set JAVA_HOME to jdk1.4
etc.,
The solution I found courtesy Google and some blogging is to start WSAD with the specified java virtual machine[jvm] :
"C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.1\wsappdev.exe" -vm "C:\j2sdk1.4.2\bin\java.exe"