Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Name comp/env/ejb not found in context "java:" application client problem

752 views
Skip to first unread message

shane...@gmail.com

unread,
Mar 12, 2009, 11:07:47 PM3/12/09
to
when i change my context to be:
{code}Object homeObject = initCtx.lookup("com.ibm.example.jms.MessageProducerHome"); {code}

I get the error:
{code}WSCL0014I: Invoking the Application Client class MessageProducerTest
Naming exception when looking up session bean Context: JMTBCORTS089433Node01Cell
/nodes/JMTBCORTS089433Node01/servers/server1, name: com.ibm.example.jms.MessageP
roducerHome: First component in name com.ibm.example.jms.MessageProducerHome not
found. {code}

Any ideas!
Just checked on the admin console my enterprise application on websphere and in my ejb jndi names the Target Resource JNDI name is MessageProducer, dont think that is correct is it?

shane...@gmail.com

unread,
Mar 12, 2009, 11:06:08 PM3/12/09
to
I get this error when launching my application client using the websphere client container.
My enterprise project is deployed on websphere application server 6.1, using JEE4.
When i run the command launchClient C:\WebSphereClients\JMSExample.ear i get that error.

My application client class call is:
{code} initCtx = new InitialContext();
Object homeObject = initCtx.lookup("java:comp/env/ejb/MessageProducer");
MessageProducerHome home;
home = (MessageProducerHome) PortableRemoteObject.narrow(homeObject,
MessageProducerHome.class);
MessageProducer bc = home.create();
{code}

application.xml is
{code}
JMSExampleClient

ejb/MessageProducer
Session
com.ibm.example.jms.MessageProducerHome
com.ibm.example.jms.MessageProducer
{code}

section of my ejb-jar.xml i:
{code}]


MessageProducer

MessageProducer

com.ibm.example.jms.MessageProducerHome
com.ibm.example.jms.MessageProducer
com.ibm.example.jms.MessageProducerLocalHome
com.ibm.example.jms.MessageProducerLocal
com.ibm.example.jms.MessageProducerSession
Stateless
Container {code}

Please help as i am going around in circles here or is there an easier way to run an jee application client when my project is deployed and running on WAS server 6.1.

shane...@gmail.com

unread,
Mar 15, 2009, 8:12:58 PM3/15/09
to
Most recent error i get now when launching client is:
launchClient C:\WebSphereClients\JMSExample.ear

NMSV0610I: A NamingException is being thrown from a javax.naming.Conte
xt implementation. Details follow:
Context implementation: com.ibm.ws.naming.java.javaURLContextRoot
Context method: lookup(Name)
Context name: java:
Target name: comp/env/ejb/MessageProducer
Other data: ""
Exception stack trace: com.ibm.websphere.naming.CannotInstantiateObjectException
: A NameNotFoundException occurred on an indirect lookup on the name java:comp/e
nv/ejb/MessageProducer. The name java:comp/env/ejb/MessageProducer maps to a JND
I name in deployment descriptor bindings for the application performing the JNDI
lookup. Make sure that the JNDI name mapping in the deployment descriptor bindi
ng is correct. If the JNDI name mapping is correct, make sure the target resourc
e can be resolved with the specified name relative to the default initial contex
t. [Root exception is javax.naming.NameNotFoundException: Context: JMTBCORTS089
433Node01Cell/nodes/JMTBCORTS089433Node01/servers/server1, name: MessageProducer
: First component in name MessageProducer not found. [Root exception is org.omg.

Any ideas!
Just checked on the admin console my enterprise application on websphere and in my ejb jndi names the Target Resource JNDI name is MessageProducer, I changed this to ejb/MessageProducer and restarted the server but i still get that error, in my ejb bindings file binding is now

rcro...@tsys.com

unread,
Mar 17, 2009, 8:04:44 AM3/17/09
to
You can try just looking up "lookup("ejb/MessageProducer");", which may work but you want to use the java:comp.

What do your ejb-jar.xml and ibm-ejb-jar-bnd.xmi look like for this?

shane...@gmail.com

unread,
Mar 19, 2009, 12:28:33 AM3/19/09
to
Thanks for the reply, after nearly a week looking into this i found the problem, it was my bootstrap port. So now my launchClient command is:
launchClient C:\WebSphereClients\JMSExample.ear -CCdumpJavaNameSpace=true -CCverbose=true -CCBootstrapPort=2810

the default when was 6.1.0 was setup was port 2809 so i had to pass in the argument myself.

0 new messages