This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JBoss and the fly likes Question: ejb-ref with ejb3.0 and jboss-4.2.0.GA Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » JBoss
Reply locked New topic
Author

Question: ejb-ref with ejb3.0 and jboss-4.2.0.GA

Gurumurthy Ramamurthy
Ranch Hand

Joined: Feb 13, 2003
Posts: 272
I am trying to deploy stateful session bean in the jboss-4.2.0.GA server.
I want the bean to get bound to the java:comp/env namespace,
so that i can lookup for the bean as
Count objCount = (Count)ctx.lookup("java:comp/env/ejb/count")

But i get the following stack trace when i access the client,
javax.naming.NameNotFoundException: comp not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)

at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.nec.client.CountClient.main(CountClient.java:19)

Please clarify whether we can use <ejb-ref> with ejb 3.0 and jboss-4.2.0.GA server.

Thanks,
Guru
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 8145
    
  52

Have a look at this


[My Blog] [JavaRanch Journal]
Gurumurthy Ramamurthy
Ranch Hand

Joined: Feb 13, 2003
Posts: 272
Yes, I have used the <ef-ref> as given in this URL only, still I am getting exceptions.

Thanks,
Guru
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 8145
    
  52

Please post the xml contents and the code where you are doing the lookup. Also, please post the output of the following steps:

- Go to http://localhost:8080/jmx-console
- Search for service=JNDIView
- Click on that link
- On the page that comes up click on the Invoke button beside the list() method
- The page that comes up will show the contents of the JNDI tree. Post that here.
Gurumurthy Ramamurthy
Ranch Hand

Joined: Feb 13, 2003
Posts: 272
These are the xml contents:

Global JNDI Namespace
+- CountBean (class: org.jnp.interfaces.NamingContext)
| +- remote (class: java.lang.Object)
| +- remoteStatefulProxyFactory (proxy: $Proxy100 implements interface org.jboss.ejb3.ProxyFactory)

Look up code:
Count objCount = (Count)ctx.lookup("java:comp/env/ejb/count")

Thanks,
Guru
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 8145
    
  52

Originally posted by Gurumurthy Ramamurthy:
These are the xml contents:


The xml contents are missing.

Originally posted by Gurumurthy Ramamurthy:
Global JNDI Namespace
+- CountBean (class: org.jnp.interfaces.NamingContext)
| +- remote (class: java.lang.Object)
| +- remoteStatefulProxyFactory (proxy: $Proxy100 implements interface org.jboss.ejb3.ProxyFactory)

Look up code:
Count objCount = (Count)ctx.lookup("java:comp/env/ejb/count")

Thanks,
Guru


The jndi contents that you posted is for the Global JNDI namespace. If you want to use the java: namespace then you will have to look into the appropriate java: namespace of your application. You will find it on the same jndi tree view.
Emanuele Ghe
Ranch Hand

Joined: Feb 04, 2009
Posts: 111
Hi Gurumurthy,
I am having the same issue. Did you solved this problem ? Can you tell me how?


SCJP6 with score 90%. I am conscious of my ignorance and ready to learn from everyone.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5536

Emanuele, please do not wake the zombies. Instead, start a new topic and provide the details.


JBoss In Action
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Question: ejb-ref with ejb3.0 and jboss-4.2.0.GA
 
Similar Threads
Does jboss bind to 0.0.0.0 on a non-clustered server ?
javax.naming.NameNotFoundException: javax.transaction.UserTransaction not bound
Problem deploying sample HelloWorld Bean in JBoss 4.2.1 GA
Lookup problem with EJB3
JNDI question in JBoss environment