File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes error executing Head First EJB first example Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "error executing Head First EJB first example" Watch "error executing Head First EJB first example" New topic
Author

error executing Head First EJB first example

Shouvanik Haldar
Greenhorn

Joined: Jun 16, 2010
Posts: 19


I am following Head First EJB. I know it has EJB 2.0 which is old as now EJB 3.1 is in. But I consider Head first book a good book for learning for amateurs like us.

I am using J2ee 1.3.1 RI and jdk 1.4. I ran the "deploy" tool to deploy by EJB and now I have a ejb client JAVA program given below:








Following the book, I compiled the program. The "Properties" part is something not mentioned in the example. I got it from some other examples on the web. Now, that when I am executing the client, am getting the following error:


F:\EJBProject\advice>java -classpath AdviceAppClient.jar;. AdviceClient
javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:

java.net.SocketTimeoutException: Read timed out]
at com.sun.jndi.rmi.registry.RegistryContext.lookup(Unknown Source)
at com.sun.jndi.rmi.registry.RegistryContext.lookup(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at AdviceClient.go(AdviceClient.java:26)
at AdviceClient.main(AdviceClient.java:11)
Caused by: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
... 5 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at java.io.DataInputStream.readByte(Unknown Source)

Please help. I am stuck up badly here. I wanted to sit for the OCBCD exam!

Regards, Shouvanik

Shouvanik Haldar
SCJP 1.5
Shouvanik Haldar
Greenhorn

Joined: Jun 16, 2010
Posts: 19
I am surprised. I thought this forum is very active. Still I did not get a reply. Anyone who had this running in the past, please share the steps
Shouvanik Haldar
Greenhorn

Joined: Jun 16, 2010
Posts: 19
If you hit a roadblock while running the first EJB example simply follow these steps
to run the first example of HeadFirst EJB.

Softwares
1. j2sdk1.4.1 - jdk
2. j2sdkee1.3.1 - j2ee RI
3. CMD (command prompt)

Compile all the classes using c:\j2sdkee1.3.1\lib\j2ee.jar library.
Now, create a App and deploy EJB inside RI. download the application client as shown in the book.

Now, comes the tricky part.

Compile client class using the following jars

javac -classpath AdviceAppClient.jar;c:\j2sdkee1.3.1\lib\j2ee.jar AdviceClient.java

Next, run the client as follows

java -cp AdviceAppClient.jar;c:\j2sdkee1.3.1\lib\j2ee.jar;c:\j2sdk1.4.1\jre\lib\rt.jar;. AdviceClient
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: error executing Head First EJB first example
 
Similar Threads
JNDI problem
NoInitialContextException:
Error in compiling Advice Client in ejb
Error connecting to local host
Client does not run - NoInitialContextException !