cancel
Showing results for 
Search instead for 
Did you mean: 

JMS Receiver Adapter - com.ibm.websphere.naming.WsnInitialContextFactory

Former Member
0 Kudos

Hello experts,

I am trying to configure JMS Adapter to Access Websphere Application Server via JNDI. The configuration is as follow:

Initial Context Factory: com.ibm.websphere.naming.WsnInitialContextFactory

Connection Factory: jms/messageQueueCF

Server URL: iiop://ammtnode.iubs.intra:2809/

Queue Name: jms/EXT_INPUT_QUEUE

I deployed all required jar files but Iu2019m still unable to connect to WAS because adapter cannot initialize ORB:

javax.naming.NamingException: Failed to initialize the ORB

I wrote a small java class to check where the problem was:

============================================================================

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL, "iiop://ammtnode.iubs.intra:2809/");
env.put("java.naming.corba.orb",org.omg.CORBA.ORB.init((String[])null,null));

Context jndiContext = null;
try {
	
jndiContext = new InitialContext(env);
ConnectionFactory connectionFactory = (ConnectionFactory) jndiContext.lookup("jms/messageQueueCF");
Connection qConn = connectionFactory.createConnection();
Session qSession = qConn.createSession(false,Session.AUTO_ACKNOWLEDGE);
Queue q = (Queue) jndiContext.lookup("jms/EXT_INPUT_QUEUE");
MessageProducer producer = qSession.createProducer(q);
TextMessage message = qSession.createTextMessage();
message.setText(text);
producer.send(message);

producer.close();
qSession.close();
qConn.close();
			
} catch (Exception e) {
	e.printStackTrace();
}

============================================================================

I got the same error until I wrote this line:

env.put("java.naming.corba.orb",org.omg.CORBA.ORB.init((String[])null,null));

And everything worked fine. Now I want to do the same in my JMS Receiver adapter but I donu2019t know how to introduce this line in the Initial Context Environment. I tried as JMS additional parameters and additional properties as well. However, nothing worked. Does anybody know what Iu2019m doing wrong?

Thank you in advance!

Accepted Solutions (1)

Accepted Solutions (1)

agasthuri_doss
Active Contributor
0 Kudos

Hey,

What is the SP level of SAP PI ?

Cheers

Agasthuri

Former Member
0 Kudos

The version is SAP Netweaver PI 7.1 SP08. And now I'll try in a EHP1 for SAP Netweaver 7.1 SP02 system.

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi

write client proxy to read the messages,i think already api available how to read the message from web sphere,what you have written JAVA program use getmethod it will work.i think the logic is very simple.

Regards,

Raj

Former Member
0 Kudos

And when and how the sender proxy is triggered?

Former Member
0 Kudos

I thought to use receiver file adapter to generate a xml file with the message and send it via java class as post processing script. However, I don't know how to use it to receive (sender) messages from the queue. Maybe I can use a Before Processing script to get messages from queue and generate a file... but I don't know...

If I can I prefer to use JMS adapter.

Best Regards!

Former Member
0 Kudos

Here I post the entire error:

0#0#Warning##Java###Catching #1#com.sap.aii.adapter.jms.api.connector.ConnectorException: Error looking up connection fact

oryjms/messageQueueCF, for profile: ConnectionProfile of channel: CC_I002_AMM_JmsReceiveron node: 5949650 having object id: 0

360697bc61b3666aba07a2708ca095a: javax.naming.NamingException: Failed to initialize the ORB

at com.sap.aii.adapter.jms.core.connector.JndiConnectorImpl.createConnectionFactory(JndiConnectorImpl.java:134)

at com.sap.aii.adapter.jms.core.connector.ConnectorImpl.doConnect(ConnectorImpl.java:247)

at com.sap.aii.adapter.jms.core.connector.JndiConnectorImpl.doConnect(JndiConnectorImpl.java:185)

at com.sap.aii.adapter.jms.core.connector.ConnectorImpl.connectIfDisconnected(ConnectorImpl.java:170)

at com.sap.aii.adapter.jms.core.connector.ConnectorImpl.connect(ConnectorImpl.java:153)

at com.sap.aii.adapter.jms.core.channel.ChannelImpl.doStart(ChannelImpl.java:279)

at com.sap.aii.adapter.jms.core.channel.ChannelImpl.start(ChannelImpl.java:166)

at com.sap.aii.adapter.jms.core.channel.AdapterImpl$1.run(AdapterImpl.java:411)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:152)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:247)

Caused by: javax.naming.NamingException: Failed to initialize the ORB [Root exception is java.lang.ClassCastException: class

com.sap.engine.system.ORBProxy:sun.misc.Launcher$AppClassLoaderAT5d0385c1 incompatible with class com.ibm.CORBA.iiop.ORB:libra

ry:com.sap.aii.adapter.libATcom.sap.engine.boot.loader.ResourceMultiParentClassLoaderAT131b92e6ATalive]

at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:364)

at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:421)

at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:123)

at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:798)

at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:164)

at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179)

at javax.naming.InitialContext.lookup(InitialContext.java:351)

at javax.naming.InitialContext.lookup(InitialContext.java:351)

at com.sap.aii.adapter.jms.core.connector.JndiConnectorImpl.createConnectionFactory(JndiConnectorImpl.java:130)

... 11 more

Caused by: java.lang.ClassCastException: class com.sap.engine.system.ORBProxy:sun.misc.Launcher$AppClassLoaderAT5d0385c1 incom

patible with class com.ibm.CORBA.iiop.ORB:library:com.sap.aii.adapter.libATcom.sap.engine.boot.loader.ResourceMultiParentClass

LoaderAT131b92e6ATalive

at com.ibm.ws.orb.GlobalORBFactory.init(GlobalORBFactory.java:92)

at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:179)

at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:83)

at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:59)

at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:102)

at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:356)

... 19 more

Caused by:

javax.naming.NamingException: Failed to initialize the ORB [Root exception is java.lang.ClassCastException: class com.sap.eng

ine.system.ORBProxy:sun.misc.Launcher$AppClassLoaderAT5d0385c1 incompatible with class com.ibm.CORBA.iiop.ORB:library:com.sap.

aii.adapter.libATcom.sap.engine.boot.loader.ResourceMultiParentClassLoaderAT131b92e6ATalive]

at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:364)

at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:421)

at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:123)

at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:798)

at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:164)

at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179)

at javax.naming.InitialContext.lookup(InitialContext.java:351)

at javax.naming.InitialContext.lookup(InitialContext.java:351)

at com.sap.aii.adapter.jms.core.connector.JndiConnectorImpl.createConnectionFactory(JndiConnectorImpl.java:130)

... 11 more

Caused by: java.lang.ClassCastException: class com.sap.engine.system.ORBProxy:sun.misc.Launcher$AppClassLoaderAT5d0385c1 incom

patible with class com.ibm.CORBA.iiop.ORB:library:com.sap.aii.adapter.libATcom.sap.engine.boot.loader.ResourceMultiParentClass

LoaderAT131b92e6ATalive

at com.ibm.ws.orb.GlobalORBFactory.init(GlobalORBFactory.java:92)

at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:179)

at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:83)

at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:59)

at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:102)

at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:356)

... 19 more

Caused by:

javax.naming.NamingException: Failed to initialize the ORB [Root exception is java.lang.ClassCastException: class com.sap.eng

ine.system.ORBProxy:sun.misc.Launcher$AppClassLoaderAT5d0385c1 incompatible with class com.ibm.CORBA.iiop.ORB:library:com.sap.

aii.adapter.libATcom.sap.engine.boot.loader.ResourceMultiParentClassLoaderAT131b92e6ATalive]

at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:364)

at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:421)

at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:123)

at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:798)

at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:164)

at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179)

at javax.naming.InitialContext.lookup(InitialContext.java:351)

at javax.naming.InitialContext.lookup(InitialContext.java:351)

at com.sap.aii.adapter.jms.core.connector.JndiConnectorImpl.createConnectionFactory(JndiConnectorImpl.java:130)

at com.sap.aii.adapter.jms.core.connector.ConnectorImpl.doConnect(ConnectorImpl.java:247)

at com.sap.aii.adapter.jms.core.connector.JndiConnectorImpl.doConnect(JndiConnectorImpl.java:185)

at com.sap.aii.adapter.jms.core.connector.ConnectorImpl.connectIfDisconnected(ConnectorImpl.java:170)

at com.sap.aii.adapter.jms.core.connector.ConnectorImpl.connect(ConnectorImpl.java:153)

at com.sap.aii.adapter.jms.core.channel.ChannelImpl.doStart(ChannelImpl.java:279)

at com.sap.aii.adapter.jms.core.channel.ChannelImpl.start(ChannelImpl.java:166)

at com.sap.aii.adapter.jms.core.channel.AdapterImpl$1.run(AdapterImpl.java:411)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:152)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:247)

Caused by: java.lang.ClassCastException: class com.sap.engine.system.ORBProxy:sun.misc.Launcher$AppClassLoaderAT5d0385c1 incom

patible with class com.ibm.CORBA.iiop.ORB:library:com.sap.aii.adapter.libATcom.sap.engine.boot.loader.ResourceMultiParentClass

LoaderAT131b92e6ATalive

at com.ibm.ws.orb.GlobalORBFactory.init(GlobalORBFactory.java:92)

at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:179)

at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:83)

at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:59)

at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:102)

at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:356)

... 19 more

rajasekhar_reddy14
Active Contributor
0 Kudos

better to raise OSS notes,SAP will come up with solution.

Answers (1)

Answers (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

Write Java proxy in receiver side,u alredy have the java program,convert the same in to Server Proxy it will work without using JMS adapter.

I dont think its possible to add any line of code to JMS adapter.Otherwise develop adapter module and add to Receiver channnel,try this option.

'

Regards,

Raj

Former Member
0 Kudos

Yes, I thought to write a java proxy to send messages without JMS adapter, but what about sender adapter? I will need to receive (read) messages from a Websphere queue as well.

How people is configuring JMS Adapter to connect to Websphere Application Server? I found few documentation on this. I tried other Initial Context Factories like com.ibm.mq.jms.context.WMQInitialContextFactory, but I haven't MQ installed so I can't connect to the queue.