Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

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

 
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
Have a look at this
 
Gurumurthy Ramamurthy
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Report post to moderator
Yes, I have used the <ef-ref> as given in this URL only, still I am getting exceptions.

Thanks,
Guru
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 273
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator

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.
 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi Gurumurthy,
I am having the same issue. Did you solved this problem ? Can you tell me how?
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
Emanuele, please do not wake the zombies. Instead, start a new topic and provide the details.
 
He baked a muffin that stole my car! And this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!