Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

EJB2.0 with JBOSS4.0

 
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi guys,

Now my problem get solved.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic