GeeCON Prague 2014*
The moose likes EJB and other Java EE Technologies and the fly likes EJB2.0 with JBOSS4.0 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 "EJB2.0 with JBOSS4.0" Watch "EJB2.0 with JBOSS4.0" New topic
Author

EJB2.0 with JBOSS4.0

pankaj semwal
Ranch Hand

Joined: Oct 07, 2008
Posts: 301
This is my code.I am using Jboss4.0 and EJB2.0 with myeclipse 6.1
I am getting the following exception.Even i add jbossall-client.jar in buildpath.
This is my client code
public static void main(String argt[]) throws Exception
{


Properties props = new Properties(System.getProperties());
props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
props.put("java.naming.factory.url.pkgs", "org.jboss.naming rg.jnp.interfaces");
props.put("java.naming.provider.url", " jnp://localhost:1099");

Context ctx=new InitialContext(props);
Object obj=ctx.lookup("ejb/Simple");
SimpleHome home =(SimpleHome)javax.rmi.PortableRemoteObject.narrow(obj, SimpleHome.class);
Simple remote=home.create();

remote.show();





Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: jnp://localhost:1099 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 connect to server jnp:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server jnp:1099 [Root exception is java.net.UnknownHostException: jnp: jnp]]]
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(Unknown Source)
at s.Client.main(Client.java:24)




please help me.

Thankx
pankaj semwal
Ranch Hand

Joined: Oct 07, 2008
Posts: 301
hi guys,

Now my problem get solved.
nettemn raj
Greenhorn

Joined: Oct 13, 2008
Posts: 1
Originally posted by pankaj semwal:
This is my code.I am using Jboss4.0 and EJB2.0 with myeclipse 6.1
I am getting the following exception.Even i add jbossall-client.jar in buildpath.
This is my client code
public static void main(String argt[]) throws Exception
{


Properties props = new Properties(System.getProperties());
props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
props.put("java.naming.factory.url.pkgs", "org.jboss.naming rg.jnp.interfaces");
props.put("java.naming.provider.url", " jnp://localhost:1099");

Context ctx=new InitialContext(props);
Object obj=ctx.lookup("ejb/Simple");
SimpleHome home =(SimpleHome)javax.rmi.PortableRemoteObject.narrow(obj, SimpleHome.class);
Simple remote=home.create();

remote.show();





Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: jnp://localhost:1099 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 connect to server jnp:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server jnp:1099 [Root exception is java.net.UnknownHostException: jnp: jnp]]]
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(Unknown Source)
at s.Client.main(Client.java:24)




please help me.

Thankx
 
GeeCON Prague 2014
 
subject: EJB2.0 with JBOSS4.0