• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

EJB2.0 with JBOSS4.0

 
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.
 
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

 
They worship nothing. They say it's because nothing is worth fighting for. Like this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic