users@glassfish.java.net

Problems integrating glassfish with websphere MQ 6

From: <glassfish_at_javadesktop.org>
Date: Tue, 22 Apr 2008 00:56:34 PDT

Hello,

I am having some serious issues connecting from glassfish to weblogic (with a simple servlet I've build).

I've been following this document: https://genericjmsra.dev.java.net/docs/websphere-mq-integration-guide/webspheremq_integration_guide.html


I have tried every possible solution to this and nothing works. I would greatly appreciate any help.

The story:

First of all, I am running windows 2003 server. I ran weblogic on it before, but now I move to glassfish.

Weblogic used to work just fine and in a similiar fashion. But in glassfish it just won't work!

I ran these commands in order to get the resource adapter going:

## asadmin create-resource-adapter-config --user admin --passwordfile password.txt --property SupportsXA=true:ProviderIntegrationMode=jndi:UserName=mqadmin:Password=mqadmin:RMPolicy=OnePerPhysicalConnection:JndiProperties=java.naming.factory.url.pkgs\=com.ibm.mq.jms.naming,java.naming.factory.initial\=com.sun.jndi.fscontext.RefFSContextFactory,java.naming.provider.url\=file\:\/C\:\/JNDI-Directory:LogLevel=finest genericra

## asadmin deploy --user admin --passwordfile password.txt C:\glassfish\lib\addons\resourceadapters\genericjmsra\genericra.rar

## asadmin create-connector-connection-pool --raname genericra --connectiondefinition javax.jms.QueueConnectionFactory --transactionsupport XATransaction --property ConnectionFactoryJndiName=EglueConFac EgluePool

## asadmin create-connector-resource --poolname EgluePool jms/EglueCF

## asadmin create-admin-object --raname genericra --restype javax.jms.Queue --property DestinationJndiName=DCDataQueue jms/DCDataQueue



All of them finished successfuly and I can see the new genericra resource adapter, the new pool and the new queues JNDIs.

When I try to run my servlet I get the following exception(s):



[#|2008-04-21T17:31:56.593+0300|FINEST|sun-appserver9.1|com.sun.genericjmsra|_ThreadID=41;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.genericra.GenericJMSRAProperties;MethodName=getProviderIntegrationMode;_RequestID=2df8867c-f91f-44dc-bc68-00a78fc49146;|ProviderIntegrationMode null|#]

[#|2008-04-21T17:31:56.609+0300|FINEST|sun-appserver9.1|com.sun.genericjmsra|_ThreadID=41;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.genericra.GenericJMSRAProperties;MethodName=getProviderIntegrationMode;_RequestID=2df8867c-f91f-44dc-bc68-00a78fc49146;|ProviderIntegrationMode null|#]

[#|2008-04-21T17:31:56.609+0300|FINEST|sun-appserver9.1|com.sun.genericjmsra|_ThreadID=41;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.genericra.outbound.AbstractManagedConnectionFactory;MethodName=debug;_RequestID=2df8867c-f91f-44dc-bc68-00a78fc49146;|[AbstractMCF] equals - no false yet|#]

[#|2008-04-21T17:31:56.609+0300|FINEST|sun-appserver9.1|com.sun.genericjmsra|_ThreadID=41;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.genericra.outbound.AbstractManagedConnectionFactory;MethodName=debug;_RequestID=2df8867c-f91f-44dc-bc68-00a78fc49146;|[AbstractMCF] equals - final: true|#]

[#|2008-04-21T17:31:56.609+0300|FINEST|sun-appserver9.1|com.sun.genericjmsra|_ThreadID=41;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.genericra.GenericJMSRAProperties;MethodName=getProviderIntegrationMode;_RequestID=2df8867c-f91f-44dc-bc68-00a78fc49146;|ProviderIntegrationMode null|#]

[#|2008-04-21T17:31:56.609+0300|FINE|sun-appserver9.1|com.sun.genericjmsra|_ThreadID=41;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.genericra.util.ObjectBuilder;MethodName=parseToProperties;_RequestID=2df8867c-f91f-44dc-bc68-00a78fc49146;|parseToProperties:java.naming.factory.url.pkgs=com.ibm.mq.jms.naming,java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory,java.naming.provider.url=file:/C:/JNDI-Directory delimited:, seperator:=|#]

[#|2008-04-21T17:31:56.609+0300|FINEST|sun-appserver9.1|com.sun.genericjmsra|_ThreadID=41;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.genericra.util.ObjectBuilder;MethodName=parseToProperties;_RequestID=2df8867c-f91f-44dc-bc68-00a78fc49146;|PropertyValuePair : java.naming.factory.url.pkgs=com.ibm.mq.jms.naming, separator:=|#]

[#|2008-04-21T17:31:56.609+0300|FINER|sun-appserver9.1|com.sun.genericjmsra|_ThreadID=41;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.genericra.util.ObjectBuilder;MethodName=parseToProperties;_RequestID=2df8867c-f91f-44dc-bc68-00a78fc49146;|Property : java.naming.factory.url.pkgs:com.ibm.mq.jms.naming|#]

[#|2008-04-21T17:31:56.609+0300|FINEST|sun-appserver9.1|com.sun.genericjmsra|_ThreadID=41;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.genericra.util.ObjectBuilder;MethodName=parseToProperties;_RequestID=2df8867c-f91f-44dc-bc68-00a78fc49146;|PropertyValuePair : java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory, separator:=|#]

[#|2008-04-21T17:31:56.609+0300|FINER|sun-appserver9.1|com.sun.genericjmsra|_ThreadID=41;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.genericra.util.ObjectBuilder;MethodName=parseToProperties;_RequestID=2df8867c-f91f-44dc-bc68-00a78fc49146;|Property : java.naming.factory.initial:com.sun.jndi.fscontext.RefFSContextFactory|#]

[#|2008-04-21T17:31:56.609+0300|FINEST|sun-appserver9.1|com.sun.genericjmsra|_ThreadID=41;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.genericra.util.ObjectBuilder;MethodName=parseToProperties;_RequestID=2df8867c-f91f-44dc-bc68-00a78fc49146;|PropertyValuePair : java.naming.provider.url=file:/C:/JNDI-Directory, separator:=|#]

[#|2008-04-21T17:31:56.609+0300|FINER|sun-appserver9.1|com.sun.genericjmsra|_ThreadID=41;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.genericra.util.ObjectBuilder;MethodName=parseToProperties;_RequestID=2df8867c-f91f-44dc-bc68-00a78fc49146;|Property : java.naming.provider.url:file:/C:/JNDI-Directory|#]

[#|2008-04-21T17:31:56.609+0300|FINEST|sun-appserver9.1|com.sun.genericjmsra|_ThreadID=41;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.genericra.util.ObjectBuilderFactory;MethodName=debug;_RequestID=2df8867c-f91f-44dc-bc68-00a78fc49146;|Properties passed to InitialContext :: {java.naming.provider.url=file:/C:/JNDI-Directory, java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory, java.naming.factory.url.pkgs=com.ibm.mq.jms.naming}|#]

[#|2008-04-21T17:31:56.609+0300|FINEST|sun-appserver9.1|com.sun.genericjmsra|_ThreadID=41;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.genericra.util.ObjectBuilderFactory;MethodName=debug;_RequestID=2df8867c-f91f-44dc-bc68-00a78fc49146;|Looking the JNDI name :EglueConFac|#]

[#|2008-04-21T17:31:56.609+0300|FINEST|sun-appserver9.1|com.sun.genericjmsra|_ThreadID=41;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.genericra.util.ObjectBuilder;MethodName=build;_RequestID=2df8867c-f91f-44dc-bc68-00a78fc49146;|Created the object based on class :javax.naming.Reference|#]

[#|2008-04-21T17:31:56.609+0300|FINEST|sun-appserver9.1|com.sun.genericjmsra|_ThreadID=41;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.genericra.util.ObjectBuilder;MethodName=build;_RequestID=2df8867c-f91f-44dc-bc68-00a78fc49146;|About to set properties on Reference Class Name: com.ibm.mq.jms.MQQueueConnectionFactory
Type: VER
Content: 6
Type: TRAN
Content: 0
Type: QMGR
Content: testqmgr
Type: HOST
Content: localhost
Type: PORT
Content: 1414
Type: CHAN
Content: SYSTEM.DEF.SVRCONN
Type: CCS
Content: 819
Type: CTO
Content: 0
Type: SRC
Content: 0
Type: SFIPS
Content: false
Type: SPAG
Content: false
Type: UCP
Content: true
Type: PINT
Content: 5000
Type: MBS
Content: 10
Type: FIQ
Content: 1
Type: LA
Content:
Type: RINT
Content: 5000
Type: TCM
Content: true
Type: MNST
Content: true
Type: TM
Content: SYSTEM.DEFAULT.MODEL.QUEUE
Type: TQPFX
Content:
Type: MRET
Content: 1
|#]

[#|2008-04-21T17:31:56.609+0300|FINE|sun-appserver9.1|com.sun.genericjmsra|_ThreadID=41;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.genericra.util.ObjectBuilder;MethodName=parseToProperties;_RequestID=2df8867c-f91f-44dc-bc68-00a78fc49146;|parseToProperties:null delimited:, seperator:=|#]

[#|2008-04-21T17:31:56.609+0300|WARNING|sun-appserver9.1|javax.enterprise.resource.resourceadapter|_ThreadID=41;_ThreadName=httpSSLWorkerThread-8080-1;EgluePool;javax.naming.Reference;_RequestID=2df8867c-f91f-44dc-bc68-00a78fc49146;|RAR5117 : Failed to obtain/create connection from connection pool [ EgluePool ]. Reason : javax.naming.Reference|#]

[#|2008-04-21T17:31:56.609+0300|INFO|sun-appserver9.1|com.sun.genericjmsra|_ThreadID=41;_ThreadName=httpSSLWorkerThread-8080-1;|Error in allocating a connection. Cause: javax.naming.Reference
javax.resource.spi.ResourceAllocationException: Error in allocating a connection. Cause: javax.naming.Reference
at com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:353)
at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:235)
at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:165)
at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:158)
at com.sun.genericra.outbound.ConnectionFactory.createConnection(ConnectionFactory.java:75)
at com.sun.genericra.outbound.ConnectionFactory.createQueueConnection(ConnectionFactory.java:115)
at dror.test.MyJMSServlet.doGet(MyJMSServlet.java:46)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:270)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:339)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:261)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:212)
at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:361)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Caused by: com.sun.enterprise.resource.PoolingException: javax.naming.Reference
at com.sun.enterprise.resource.AbstractResourcePool.createSingleResource(AbstractResourcePool.java:899)
at com.sun.enterprise.resource.AbstractResourcePool.createResourceAndAddToPool(AbstractResourcePool.java:1750)
at com.sun.enterprise.resource.AbstractResourcePool.createResources(AbstractResourcePool.java:917)
at com.sun.enterprise.resource.AbstractResourcePool.initPool(AbstractResourcePool.java:225)
at com.sun.enterprise.resource.AbstractResourcePool.internalGetResource(AbstractResourcePool.java:516)
at com.sun.enterprise.resource.AbstractResourcePool.getResource(AbstractResourcePool.java:443)
at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:248)
at com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerImpl.java:176)
at com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:337)
... 35 more
|#]

As you can see, it gets to the connection pool, manages to read the .bindings file, but cannot get to websphere mq!

I have tried every possible combination to get this running and nothing works. I tried replacing the single backslash you see in the first command to get the resource adapter going to double backslash, no go, I tried fiddling with the web.xml .. again, no go. I tried using bpels and not a servlet, same error. I tried changing the queues and factory in MQ, no luck.


I am lost.

Please if anyone had this problem before, do tell, once I'll have the answer I promise I will post it if it hasn't been posted yet.



Thanks in advance,

Nir Peled
















P.S -- The servlet code:

package dror.test;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Properties;

import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.TextMessage;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
* Servlet implementation class for Servlet: MyJMSServlet
*
*/
public class MyJMSServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
static final long serialVersionUID = 1L;

/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#HttpServlet()
*/
public MyJMSServlet() {
super();
}

/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter writer = response.getWriter();
try{
writer.print(" hello JMS v5<br>");
Context ctx = new InitialContext();
writer.print("Context cretraed<br>");
QueueConnectionFactory fac = (QueueConnectionFactory)ctx.lookup("java:comp/env/jms/EglueCF");
writer.print("found QueueConnectionFactory <br>" );//
Queue q = (Queue)ctx.lookup("java:comp/env/jms/DCDataQueue");
writer.print("found Queue <br>" ); QueueConnection con = fac.createQueueConnection();
writer.print("con create");
QueueSession s=con.createQueueSession(true, QueueSession.AUTO_ACKNOWLEDGE);
writer.print("session create");
con.start();
writer.print("con started");
QueueSender sender = s.createSender(q);
writer.print("sender create");
TextMessage msg = s.createTextMessage();
msg.setText("heelo dror");

sender.send(msg);
writer.print("msg sent");
con.close();
writer.print("con close");
}catch (Exception e) {
writer.print("<hr>");
writer.print("<pre>");
e.printStackTrace(writer);
writer.print("</pre>");
if (e instanceof JMSException){
JMSException e1 = (JMSException)e;
e = e1.getLinkedException();
if(e!=null){
writer.print("<hr>");
writer.print("<pre>");
e.printStackTrace(writer);
writer.print("</pre>");
}else{
writer.print("<hr>");
writer.print("<pre>");
writer.print("linked exception is null");
writer.print("</pre>");
}
}
}

}
}
[Message sent by forum member 'techdeck' (techdeck)]

http://forums.java.net/jive/thread.jspa?messageID=270520