cancel
Showing results for 
Search instead for 
Did you mean: 

JMS Adapter Error

abhradeepbasu
Participant
0 Kudos

Hi All,

We are trying to connect to a JMS Queue which is created on a Netweaver Stack from PO using "Access JMS Provider with JNDI". But we are getting the below error while trying to connect:

A channel error occurred. Detailed error (if any) : com.sap.aii.adapter.jms.api.connector.ConnectorException: Error creating initial context with environment: java.naming.provider.url=http://XXXXXXXXX:50200; java.naming.factory.initial=com.sap.engine.services.jndi.InitialContextFactoryImpl; java.naming.security.principal=administrator; java.naming.security.credentials=**********, force_remote=true; for profile: ConnectionProfile of channel: CC_Get_WorkOrder_JMS_Senderon node: 95436950 having object id: db790a3e9a343bd887081c89e1234f62: javax.naming.NamingException: Exception while trying to get InitialContext. at com.sap.aii.adapter.jms.core.connector.JndiConnectorImpl.createInitialContext(JndiConnectorImpl.java:71) ...

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi A.B.

Have you tried changing the port. Try the P4 port - just change last digit to 4. So in your case that would be 50204. I think the default JMS service port is xxx10. But the P4 port works for me.

And I assume that you have checked the default values for the QueueConnectionFactiry + Queue/Topic, so that it matches the queue details that you have defined in NWA=>Configuration=>Infrastucture=>JMS Server Configuration=>JMS Resources

Regards,Emil

Former Member
0 Kudos

Think Emil might be on to something.

Regards,

Jannus Botha

abhradeepbasu
Participant
0 Kudos

Thanks Emil and Jannus.

Let me tell you when we are trying to connect to a queue which is already exisiting in our PO, the channel works fine both for inbound and outbound cases. But when we are are trying to connect it to a queue which is created on another netweaver stack outside of PO then we are getting initial context error.

We have changed the port to 50204 and also used 'force_remote = true' in the initial context parameter but now we are getting a different error (attached below).

A channel error occurred. Detailed error (if any) : com.sap.engine.services.rmi_p4.exception.P4BaseRuntimeException: Unexpected exception at com.sap.engine.services.rmi_p4.server.P4ObjectBrokerServerImpl.getException(P4ObjectBrokerServerImpl.java:1328) at com.sap.engine.services.rmi_p4.server.P4ObjectBrokerServerImpl.getException(P4ObjectBrokerServerImpl.java:1305) at com.sap.engine.services.rmi_p4.reflect.P4InvocationHandler.invokeInternal(P4InvocationHandler.java:160) at com.sap.engine.services.rmi_p4.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:52) at com.sun.proxy.$Proxy3426.createQueueConnection(Unknown Source) at com.sap.aii.adapter.jms.core.connector.ConnectorImpl.createConnection(ConnectorImpl.java:526) at com.sap.aii.adapter.jms.core.connector.ConnectorImpl.buildConnection(ConnectorImpl.java:451) at com.sap.aii.adapter.jms.core.connector.ConnectorImpl.doConnect(ConnectorImpl.java:409) at com.sap.aii.adapter.jms.core.connector.JndiConnectorImpl.doConnect(JndiConnectorImpl.java:198) at com.sap.aii.adapter.jms.core.connector.ConnectorImpl.connectIfDisconnected(ConnectorImpl.java:230) at com.sap.aii.adapter.jms.core.connector.ConnectorImpl.connect(ConnectorImpl.java:213) at com.sap.aii.adapter.jms.core.channel.ChannelImpl.doStart(ChannelImpl.java:294) at com.sap.aii.adapter.jms.core.channel.ChannelImpl.start(ChannelImpl.java:168) at com.sap.aii.adapter.jms.core.channel.AdapterImpl.doAddUpdateChannel(AdapterImpl.java:901) at com.sap.aii.adapter.jms.core.channel.AdapterImpl.addOrReplaceChannel(AdapterImpl.java:837) at com.sap.aii.adapter.jms.core.channel.AdapterImpl.doStartCpaChannels(AdapterImpl.java:1052) at com.sap.aii.adapter.jms.core.channel.AdapterImpl$2.invoke(AdapterImpl.java:1002) at com.sap.aii.af.lib.scheduler.JobBroker$Worker.run(JobBroker.java:529) 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:185) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:302) Caused by: java.lang.ClassNotFoundException: com.sap.jms.client.connection.ConnectionProxy ------------------------- Loader Info ------------------------- ClassLoader name: [service:com.sap.aii.adapter.jms.svc] Loader hash code: 42ff1452 Living status: alive Direct parent loaders:   [system:Frame]   [interface:com.sap.aii.af.ms.ifc]   [service:com.sap.aii.adapter.xi.svc]   [library:com.sap.aii.adapter.lib] Resources:   /usr/sap/PD4/J09/j2ee/cluster/bin/services/com.sap.aii.adapter.jms.svc/lib/com.sap.aii.adapter.jms.svc_api.jar --------------------------------------------------------------- at com.sap.engine.boot.loader.MultiParentClassLoader.loadClass(MultiParentClassLoader.java:278) at com.sap.engine.boot.loader.MultiParentClassLoader.loadClass(MultiParentClassLoader.java:247) at com.sap.engine.services.rmi_p4.MarshalInputStream.resolveClass(MarshalInputStream.java:114) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1600) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1505) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1759) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1338) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:358) at com.sap.engine.services.rmi_p4.reflect.P4InvocationHandler.readResult(P4InvocationHandler.java:302) at com.sap.engine.services.rmi_p4.reflect.P4InvocationHandler.invokeInternal(P4InvocationHandler.java:138) ...


Former Member
0 Kudos

Hi A.B.

Ah, now I think I understand your scenario. The 'force_remote' is not an initial context property - well,, it is. But I only got it to work when I maintained it in the additional parameters. Like this:

This config works for me, when connecting to an external JMS provider.

Try it out.

Reg, Emil

abhradeepbasu
Participant
0 Kudos

Hi Emil,

Changed as per your instruction but received the same error again.

/A.B

Former Member
0 Kudos

Hi A.B.

Can i Ask you to send me 2 screenshots. One of your connection details. Please just hide your IP and the second of your Advanced tab?

Thank you,

Jannus Botha

abhradeepbasu
Participant
0 Kudos

Hi Jannus,

.

Former Member
0 Kudos

Hi A.B.

Please change 2 things for me and then test. Please see my screenshots below. It is marked in blue.

Dont forget to reward points. Emil has been doing a good job at helping.

Regards,

Jannus Botha

abhradeepbasu
Participant
0 Kudos

Hi Jannus,

Sure,'ll definitely do it.

Changed the settings but now got the previous error:

com.sap.aii.adapter.jms.api.connector.ConnectorException: Error creating initial context with environment:

/A.B

Former Member
0 Kudos

Hi A.B.

Might be a stupid thing to ask but you guys have deployed all the required drivers etc?

Because your config is correct. Can you please try and connect to SAP PI's JMS queue?

Just replace your IP with localhost and replicate my config and it should point to your local JMS queue on the SAP PI system. If it connects there then we know that JMS is working correctly. Then we will start looking at other possiblities.

So just have a look at my screenshots i send earlier and then copy everything.

jmsfactory/alertingVP/AlertingConsumerConnectionFactory

jmsqueues/alertingVP/jms/queue/xi/monitoring/alert/ALERT-TO-MAIL

com.sap.engine.services.jndi.InitialContextFactoryImpl

localhost:Port4

username

password

JNDI.InitialContext.property 5

force_remote true

.

Regards,

Jannus Botha

Former Member
0 Kudos

Sorry to point to some basic stuff, but just to make sure:

1) you are using the 'default' virtual JMS provider on the external netweaver system hosting the JMS provider, right? I notice that 'default' is used in your channel configuration.

2) User and pw - have you checked that you are entering the 'administrator' pw valid for the user on the external netweaver system? And check that the user is not locked on the external system.

Are the two netweaver systems same version/SP?

/Emil

abhradeepbasu
Participant
0 Kudos

Hi Jennus,

We already tried that Jennus and we were able to connect to the SAP PI's JMS Queue both for the outbound and inbound scenarios. So JMS is working correctly.

/A.B

abhradeepbasu
Participant
0 Kudos

Emil,

We just created the queues. Do we need to follow anything else. Are we missing any steps here?

Versions and SP levels are different but do you really think this will cause the problem?

/A.B

Former Member
0 Kudos

Hmm, that looks ok.

Try to do what Jannus suggest above, and connect to one of the standard queues on the external JMS provider. If you get the same error, then you will at least have identified that the problem is in the connecting PI system.

Have you been able to test that there is no firewall between the two servers? Some network teams limit the firewall exceptions to specific ports.

/Emil 

Former Member
0 Kudos

Hi Abhradeep,

Have a look at my JDNI connection properties below and compare it to yours?

Please add the following value :

JNDI.InitialContext.property 5

Also use Hermes(JMS Queue Viewer) to see if you can use that to view the queues.

Regards,

Jannus Botha

iaki_vila
Active Contributor
0 Kudos

HI Basu,

Check if these threads are helpful:

Regards.

abhradeepbasu
Participant
0 Kudos

Hi Iñaki,

We have already gone through those posts but didn't get any luck.

Once the queue is created on the netweaver stack, do we need to follow any other steps over there?

/A.B