cancel
Showing results for 
Search instead for 
Did you mean: 

JMS Client Program

Former Member
0 Kudos

Hi,

I'm trying to run my JMS Client program to post a message to XI JMS Queue.

But I'm getting the following exception... java.lang.ClassCastException

at QueueConnectionFactory.

Also tried to catch the name of the returned class name...

com.sap.engine.services.jndi.persistent.UnsatisfiedReferenceImpl

Can anyone has an idea what could be the possible solution?

Any help is highly appreciated.

Here are the details...

SAP_NAMING_PROVIDER_URL = localhost:50204 (50200 being J2EE port)

SAP_INITIAL_CONTEXT_FACTORY_IMPL = "com.sap.engine.services.jndi.InitialContextFactoryImpl"

QueueConnectionFactory queueConnectionFactory =(QueueConnectionFactory) jndiContext.lookup("jmsfactory/default/QueueConnectionFactory")

Queue queue = (Queue) jndiContext.lookup(

"jmsqueues/default/MyTestQueue")

Thanks and Regards,

Vijay

Accepted Solutions (1)

Accepted Solutions (1)

STALANKI
Active Contributor
0 Kudos

Can u check the JMS adapter section https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/5393.You [original link is broken] [original link is broken] [original link is broken] [original link is broken] will have very useful info there.

Former Member
0 Kudos

Hi Sravya,

I have already created the queue and related items through Visual Administrator, as specified in the blog.

Now my problem is to access that queue by pushing a message into it.

My JMS Client code is throwing ClassCastException.

Please let me know if something needs to be done to eliminate this.

Thanks and Regards,

Vijay Kalyan

Answers (1)

Answers (1)

Former Member
0 Kudos

below is the link to sample jms client program given by SAP. try to run this to see if its ok or getting error.

http://help.sap.com/search/highlightContent.jsp

Former Member
0 Kudos

Hi Archana,

The link isn't working and giving a message as..."Error: Session expired!"

By the way my code is an extract of the one that is available at... <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/44/efec3341ad67d8e10000000a155369/frameset.htm">help.sap.com</a>

If you think this is different to the one that you intend to send, can you please send me the correct one?

Thanks and Regards,

Vijay Kalyan

Former Member
0 Kudos

I have solved it on my own and would like to share the solution.

I found that there is a conflict whenever the referred class is in more than one JAR.

Hence only included relevant JARs one by one.

Also the ClassCastException disappeared and the program executed successfully, when sapjms.jar was included.

Regards,

Vijay Kalyan G.