-
1. Re: very urgent! javax.naming.CommunicationException:Receive
darranl Nov 6, 2003 7:49 AM (in response to rupasrivi)The format of the /etc/hosts file should be
IP_address canonical_hostname aliases
The -D:java.rmi.server.hostname=144.0.121.253 that you have specified is a command line argument that you would pass to the JVM when starting JBoss. -
2. Re: very urgent! javax.naming.CommunicationException:Receive
u268 Nov 7, 2003 9:30 AM (in response to rupasrivi)1) the command line option for java must look like this:
-Djava.rmi.server.hostname=xxx.xxx.xxx.xxx
No ':' such symbols!!! like in your string
-D:java.rmi.server.hostname=144.0.121.253
2) I found that windows sometimes blocks port 1099, don't know excatly how this happens, but I always change this port number in jBoss to 11099 ;) -
3. Re: very urgent! javax.naming.CommunicationException:Receive
rupasrivi Nov 8, 2003 12:29 AM (in response to rupasrivi)Thanks, for ur precious help.
-Djava.rmi.server.hostname=144.0.121.253 worked.
Now when i test the client it gives foll message:
javax.naming.NameNotFoundException: helloworld.HelloWorld not bound
my ejb-jar.xml in the Meta-inf dir is:
<ejb-name>helloworld.HelloWorld</ejb-name>
helloworld.HelloWorldHome
helloworld.HelloWorld
<ejb-class>helloworld.HelloWorldBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
And the jboss.xml also is in the meta-inf dir, is as follows:
<enterprise-beans>
<ejb-name>helloworld.HelloWorld</ejb-name>
<jndi-name>helloworld.HelloWorld</jndi-name>
</enterprise-beans>
</jboss
Also the client code for the HelloWorldClient is:
public static void main(String[] args)
{
Properties p = new Properties();
p.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
p.setProperty(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
p.setProperty(Context.PROVIDER_URL,"jnp://144.0.121.253:1099");
try
{
Context jndiContext = new InitialContext(p);
System.out.println("Got context");
Object ref = jndiContext.lookup("java:helloworld.HelloWorld") ;
System.out.println(" got reference");
HelloWorldHome home = (HelloWorldHome)
PortableRemoteObject.narrow(ref, HelloWorldHome.class);
HelloWorld helloworld = home.create();
helloworld.sayHello();
}
catch(Exception e)
{
System.out.println(e.toString());
}
}
Please help i have been trying to run this client since days on jboss.
At the final stage i am getting these exceptions.
Its very important for me to run this client successfully on jboss.
plz reply soon
Thanks in advance -
4. Re: very urgent! javax.naming.CommunicationException:Receive
rupasrivi Nov 8, 2003 12:36 AM (in response to rupasrivi)Thanks, for ur precious help.
-Djava.rmi.server.hostname=144.0.121.253 worked.
Now when i test the client it gives foll message:
javax.naming.NameNotFoundException: helloworld.HelloWorld not bound
my ejb-jar.xml in the Meta-inf dir is:
<ejb-name>helloworld.HelloWorld</ejb-name>
helloworld.HelloWorldHome
helloworld.HelloWorld
<ejb-class>helloworld.HelloWorldBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
And the jboss.xml is as follows:
<enterprise-beans>
<ejb-name>helloworld.HelloWorld</ejb-name>
<jndi-name>helloworld.HelloWorld</jndi-name>
</enterprise-beans>
</jboss
The jboss.xml file is also in the meta-inf dir along with ejb-jar.xml .
The helloworld.jar is successfully deployed on the jboss server.
Also the client code for the HelloWorldClient is:
public static void main(String[] args)
{
Properties p = new Properties();
p.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
p.setProperty(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
p.setProperty(Context.PROVIDER_URL,"jnp://144.0.121.253:1099");
try
{
Context jndiContext = new InitialContext(p);
System.out.println("Got context");
Object ref = jndiContext.lookup("java:helloworld.HelloWorld") ;
System.out.println(" got reference");
HelloWorldHome home = (HelloWorldHome)
PortableRemoteObject.narrow(ref, HelloWorldHome.class);
HelloWorld helloworld = home.create();
helloworld.sayHello();
}
catch(Exception e)
{
System.out.println(e.toString());
}
}
Please help i have been trying to run this client since days on jboss.
At the final stage i am getting these exceptions.
Its very important for me to run this client successfully on jboss.
plz reply soon
Thanks in advance -
5. Re: very urgent! javax.naming.CommunicationException:Receive
u268 Nov 10, 2003 7:21 AM (in response to rupasrivi)check your jndi names at jboss.xml! for example:
<!-- jboss.xml -->
<!-- All bean containers use this security manager by default -->
<security-domain>java:/jaas/goslips</security-domain>
<enterprise-beans>
<ejb-name>ClientController</ejb-name>
<jndi-name>goSlips/ClientController</jndi-name>
</enterprise-beans>
-------------
so lookup will be done as:
Object objref = initial.lookup("goSlips/ClientController");
ClientControllerHome refHome = (ClientControllerHome) PortableRemoteObject.narrow(objref, ClientControllerHome.class);
clientController = refHome.create();
-----------------
try it -
6. Re: very urgent! javax.naming.CommunicationException:Receive
u268 Nov 10, 2003 7:25 AM (in response to rupasrivi)P.S. the main difference is in referencing to jndi without "java:" - it's wrong ;)