• Post Reply Bookmark Topic Watch Topic
  • New Topic

JNDI not working

 
srinivas sy
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
im new to EJB.Please help me on this..
im using EJB2. AND Jboss 4.2

server started and deployed it successfully, but when i run client program ..it is not looking for jndi....i wrote sop's in client program. Please look it .properties got loaded..JNDI NAME ALSO CORRECTLY i have written.
I tried allot..

this statement is not called in client program:
Object obj=ctx.lookup("HelloHomeJNDI");







jboss.xml



ejb-jar.xml



Client program:

 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My first comment is: why are you using EJB 2 in this day and age? If you're trying to learn EJBs, then get rid of whatever tutorial you're following and get one that covers EJB 3.

Secondly, please UseCodeTags when posting code of any length. Otherwise the code is unnecessarily hard to read, making it less likely that people will bother to do so. I have added the tags for you in this case; please do so yourself next time.

Thirdly, I bet that statement *is* being called (I have a hard time picturing the JVM simply stopping execution), but that there was an error that you don't know about because you're suppressing all exception handling in the catch block. So start by doing something meaningful in that catch block, like printing out the exception stack trace.
 
srinivas sy
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf,

Iam sorry, i didn't know that how to add code tags. Next time i will do like that only.

I got solution..instead of localhost i used 127.0.0.1 this resolved everything..M fresher ..so trying both ejb 2 and 3..

thanks
 
srinivas sy
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Iam getting this error after deploying ejb app into jboss server.

I have killed all process and tried..and even used new port no.. still am getting this error???pl help me


instead of 127.0.0.1 i have tried localhost also..


javax.naming.CommunicationException: Could not obtain connection to any of these urls: 127.0.0.1:4556 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to retrieve stub from server 127.0.0.1:4556 [Root exception is java.io.EOFException]]
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1562)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.web.bookstore.ejb2.client.Lab3Client.main(Lab3Client.java:30)
Caused by: javax.naming.CommunicationException: Failed to retrieve stub from server 127.0.0.1:4556 [Root exception is java.io.EOFException]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:268)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533)
... 4 more
Caused by: java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2281)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2750)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:780)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280)
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:255)
... 5 more

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!