• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB2.0 with JBOSS4.0

 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,

Now my problem get solved.
 
nettemn raj
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic