8 Replies Latest reply on Sep 29, 2008 10:14 AM by jaikiran pai

    Help!! Failed to call remote methods in jboss 4. (EJB3, Stat

    Daniel Deng Newbie

      Hi all,

      I got a problem with my first EJB3 test.
      I could call my remote method ONLY in the computer that runs JBoss.
      Here's the detailed situation:

      I wrote a Stateless Session Bean in Eclipse.
      It simply provides (remote) a static String method SayHello(String name).
      SayHello("Daniel") -> "Daniel says: Hello!"
      Then I copied the exported JAR file into server/default/deploy.
      JBoss 4 was launched and the jndi was up there. HelloWorldBean/remote
      Everything ran pretty well.

      Then I started another project in Eclipse which is called "SwingEJBTest"
      I wanted to use a Swing project to call the remote method.
      There was a JTextField (for Input), a JTextArea (for Output) and a JButton.
      I'm not good at describing things in English, please see my code below...

      I copied the interface HelloWorld.class and all the JARs in client folder.
      Then I set all the Classpaths, wrote codes and generated JAR with FatJAR.
      I launched the SwingEJBTest.jar with .bat file and everything was OK.
      I input "localhost:Daniel" and it outputs "Daniel says: Hello!".

      Then I copied the JAR to another computer and the problem came:
      I input "" (JBossServer:
      There was an exception thrown:
      Could not obtain connection to any of these urls:

      I closed the firewall on the JBossServer computer, pinged,
      but I found nothing abnormal. I can access the server computer,
      JBoss was still running there, firewall totally off.

      I packed the JAR with FatJAR, totally dependant from external JARs.

      Could anyone tell me why I got this Exception on another computer?

      Thanks a lot for your kind help.