cancel
Showing results for 
Search instead for 
Did you mean: 

JNDI lookup for JMS Factory generates "Path does not exist" error

Former Member
0 Kudos

Hello,

I would like to search for a JMS Queue Connection Factory that already been configured by SAP on the WAS which is up and running. It's name is: DAserviceQueueFactory.

The problem is that if I search it I receive "Path to object does not exist at java:comp, the whole lookup name is..."

I tried searching with:

1. queueConnectionFactory = (QueueConnectionFactory)

ctx.lookup("java:comp/env/DAserviceQueueFactory");

2. queueConnectionFactory = (QueueConnectionFactory)

ctx.lookup("java:comp/env/jms/DAserviceQueueFactory");

And I receive the same error on both.

Any idea why?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

did you try

<b>jmsfactory/default/DAserviceQueueFactory</b>

Former Member
0 Kudos

I thought about it too, since this is the path and the JNDI registry but it makes no sence do search like this since it is not the standard way. I think this is just a mapping between the java:comp/jms/ and the actual location of SAP JNDI registry. Anyway, I gave it a try now and as I suspected, for this search I receive: "Object not found in lookup of DAserviceQueueFactory"

Former Member
0 Kudos

Hi Roy,

You are right, the recommended and the standard way is to lookup it from your java:comp/env, not from the global root. Any other ways - (using the global context root) may stop working in subsequent server versions, since it is not according to the J2EE specification.

If everything is declared in the deployment descriptors , your resource should be visible should be visible under

"java:comp/env/jms/DAserviceQueueFactory";

How you can search what you have in the naming :

open the telnet administration (can be done from MMC) and type the following commands :

jump 0

add naming

lsn > c:\my_naming.txt

Then open the file manually and check what has been bound and where. I hope you can find your DAserviceQueueFactory and get an idea where it is.

Btw, one possible problem is that you have obtained the context from another bean in another ear and you have cached it (ServiceLocator design patter). Then afterwards the lookup to java:comp/env - would be against the first application and its resources, where the factory won't be declared.

HTH

Peter

Former Member
0 Kudos

Hi Peter,

If all I need is to declare the resource-rf at the session bean and search the jms and the JNDI context than I assume I did everything. If I missed something I will be happy to know what.

The cached context is not the case here but it was a very good thinking in my opinion...

What I am trying to do is simply add an MDB to the Quick Car application example using an already configured Factory.

When I open the file I see it at the correct location (I think). Here is what I see:

  • QuickOrderProcessorBean [Context]

  • java:comp [Context]

HandleDelegate

ORB

  • env [Context]

  • QuickCarRental [Context]

QuickBookingBean

  • jms [Context]

DAserviceQueueFactory

  • InformerBean [Context]

  • java:comp [Context]

By the way, now I see I get a different message:

Exception during lookup operation of object with name ejbContexts/sap.com/QuickCarRentalApplication/sap.com/QuickCarRentalApplication/QuickOrderProcessorBean/java:comp/env/jms/DAserviceQueueFactory, cannot resolve object reference.

Former Member
0 Kudos

Solved it!

The mapping at the ejb-j2ee-engine.xml file should be the Factory and Queue name without the jms/ pefix. This prefix should be only at the "standard" ejb-jar.xml file.

former_member182372
Active Contributor
0 Kudos

Hi Roy,

Are you using it in web project?

Did you add "jms/DAserviceQueueFactory" as "Resource entries" of type "javax.jms.QueueConnectionFactory" on "Resource" tab of web.xml?

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

Hi Maksim,

I am using it from a Session Bean and I declared it at it's resource-ref like this:

<resource-ref>

<res-ref-name>jms/DAserviceQueueFactory</res-ref-name>

<res-type>javax.jms.QueueConnectionFactory</res-type>

<res-auth>Container</res-auth>

</resource-ref>