-
1. Re: Basic EJB - cant be invoked from client
jaikiran Apr 3, 2008 5:05 AM (in response to resh123)How are you starting JBoss? Do you use -b option to start JBoss? And what have you specified in the jndi.properties file?
-
2. Re: Basic EJB - cant be invoked from client
jwenting Apr 3, 2008 5:05 AM (in response to resh123)that's a network error. Make sure the URI you refer to in your naming.properties is correct and can be reached from your client.
-
3. Re: Basic EJB - cant be invoked from client
resh123 Apr 3, 2008 8:10 AM (in response to resh123)Thanks for the replies!
I am not using -b to start JBoss. And I am using JNDI.properties from the JBoss/server/default/conf folder. It has the following :# DO NOT EDIT THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING # java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
Is some other value required in JNDI.properties? -
4. Re: Basic EJB - cant be invoked from client
jaikiran Apr 3, 2008 8:19 AM (in response to resh123)What does the following command return from the machine where you are running the client:
telnet localhost 1099
-
5. Re: Basic EJB - cant be invoked from client
resh123 Apr 3, 2008 9:46 AM (in response to resh123)It returns the some the following response:
¼Ã�sr↓java.rmi.MarshalledObject|¢▲ùÃ�c³>☻♥I♦hashlocBytest☻[BobjBytesq~☺xp]?Ãur☻[B¼ ↨°TÓ☻xp'¼Ã�t▬http://127.0.0.1:8083/q~q~uq~♥└¼Ã�sr org.jnp.server.NamingServer_Stub ☻☻xrjava.rmi.server.RemoteStubÚ■▄╔ïße☻xr∟java.rmi.server.RemoteObjectËa┤æ a3▲♥xpw 4 UnicastRef2 127.0.0.1♦JÌò↔°☺↓¶çOßÇx Connection to host lost.
-
6. Re: Basic EJB - cant be invoked from client
jaikiran Apr 3, 2008 11:04 AM (in response to resh123)This output looks fine to me. Can you post the complete exception stacktrace that you are seeing?
-
7. Re: Basic EJB - cant be invoked from client
resh123 Apr 3, 2008 11:15 AM (in response to resh123)Following is the complete stacktrace:
Exception in thread "main" javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1465) at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1594) 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:351) at uk.co.autotrader.ejb3.client.CalculatorClient.main(CalculatorClient.java:13) Caused by: java.net.SocketTimeoutException: Receive timed out at java.net.PlainDatagramSocketImpl.receive0(Native Method) at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136) at java.net.DatagramSocket.receive(DatagramSocket.java:712) at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1435) ... 5 more
-
8. Re: Basic EJB - cant be invoked from client
jaikiran Apr 3, 2008 11:45 AM (in response to resh123)"r12345_2003" wrote:
I have included the necessary JAR files and also have jndi.properties in my client code class path
Can you try removing the jboss jar files that you have included in the client classpath and only include jbossall-client.jar file which you will find in %JBOSS_HOME%/client folder. -
9. Re: Basic EJB - cant be invoked from client
resh123 Apr 4, 2008 5:30 AM (in response to resh123)Do you mean removing all JBoss related jar files & keep only jbossall-client.jar? I tried that & still doesnt work. I also tried removing all other jar files as well & keeping only jbossall-client.jar but its still the same :(
-
10. Re: Basic EJB - cant be invoked from client
jaikiran Apr 4, 2008 5:59 AM (in response to resh123)The code and the telnet output that you posted does not show any obvious errors to me. I usually place only the jbossall-client.jar file in the classpath as this includes almost all JBoss related classes. Can you post the console log that you see on the server when the server is started? Also can you access http://localhost:8080/jmx-console from the browser? Any firewalls/anti-virus running on your system?
-
11. Re: Basic EJB - cant be invoked from client
resh123 Apr 4, 2008 7:16 AM (in response to resh123)yes i can access JMX Console. I can even see the EJB in the JMX console.
Yes i think my system is behind a firewall.
Would that make a difference?
Its really driving me crazy.. i did not think deploying a simple EJB would be so difficult :( -
12. Re: Basic EJB - cant be invoked from client
jaikiran Apr 4, 2008 11:09 AM (in response to resh123)"r12345_2003" wrote:
Yes i think my system is behind a firewall.
Would that make a difference?
Well if you are able to telnet from the machine where you have the client to the server, then i guess you should be able to run the client too. But probably, you could give it a try to disable the firewall and run the client. At this point, i am really running out of ideas.
-
13. Re: Basic EJB - cant be invoked from client
jwenting Apr 4, 2008 1:11 PM (in response to resh123)A remote EJB client using an EJB local interface?
Might be the problem. -
14. Re: Basic EJB - cant be invoked from client
jeff.rosen Apr 6, 2008 12:54 AM (in response to resh123)"jwenting" wrote:
A remote EJB client using an EJB local interface?
Might be the problem.
It would be a problem, but I think it would show up later. The exception occurs during the JNDI lookup. At worst he should get a NamingException.
The problem is that he hasn't told the client where the naming provider is located. One possible solution would be to modify the something like:InitialContext ic = new InitialContext(); Context jndiRoot = (Context) ic.lookup("jnp://localhost:1099"); CalculatorLocal calculator = (CalculatorLocal)jndiRoot.lookup("CalculatorBean/local");
Assuming that JBoss is running on the same machine as the client, otherwise adjust the URL accordingly.