Announcement

Collapse
No announcement yet.

Connection von remote client auf EJBs

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Connection von remote client auf EJBs

    Hallo!

    Wenn ich meine Client-Anwendung local ausführe (auf gleichem Rechner wo auch JBoss läuft) ist es alles OK.
    Wenn ich das vom Remote-Rechner versuche gibt es Fehlermeldung:

    javax.naming.CommunicationException: Could not obtain connection to any of these urls: Rational:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out .....

    Rational ist ja Name von Rechner mit JBoss.

    Code-Ausschitt von Client-Aplication:

    Properties p = new Properties();
    p.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
    p.put("java.naming.factory.url.pkgs", "=org.jboss.namingrg.jnp.interfaces");
    p.put("java.naming.provider.url", "jnp://Rational:1099");

    Ich habe auch mit IP versucht, funktioniert nicht.
    Benutze Jboss-4.2.1.GA, EJB3 und MyEclipse5.5. Auf Remote Rechner - nur MyEclipse.
    Wo lieg mein Fehler? Hat jemand eine Idee?
    Danke in voraus.
    isch

  • #2
    siehe diesen thread: http://entwickler-forum.de/showthread.php?t=48038

    Comment


    • #3
      habe Lösung in JBoss Doku gefunden (es liegt an dem Host-Binding ...):
      Dass jBoss auf localhost und auf der externen Schnittstellen lauscht, einfach JBoss mit folgenden Aufruf starten:
      jboss/bin/run.bat -b "0.0.0.0"

      From JBOSS Readmy.txt:
      JBossAS now binds its services to localhost (127.0.0.1) *by default*, instead of binding to all available interfaces (0.0.0.0). This was primarily done for security reasons because of concerns of users going to production without having secured their servers properly. To enable remote access by binding JBoss services to a particular interface, simply run jboss with the -b option. To bind to all available interfaces and re-enable the legacy behaviour use -b 0.0.0.0. In any case, be aware you still need to secure you server properly.

      Comment


      • #4
        Hallo,
        bei mir (Linux, JDK1.6, JBoss5.0.0GA) es funktioniert erst nach EAR Einpackung, also:
        1. EJB3 ereugen
        2. EAR erzeugen
        3. In JBoss deploieren

        JNDI Name: es ist in Konsole zu sehen (EAR AppName / EJB3 Name / remote )

        Hier ist noch Klient Code:
        ...
        Properties props = new Properties();
        props.setProperty("java.naming.factory.initial",
        "org.jnp.interfaces.NamingContextFactory");
        props.setProperty("java.naming.provider.url", "localhost:1099");
        props.setProperty("java.naming.factory.url.pkgs",
        "org.jboss.naming");
        context = new InitialContext(props);
        MeinService beanRemote = (MeinService) context
        .lookup("MeinAppName/MeinService/remote");
        ...

        Grüße
        Albert
        Zuletzt editiert von agorski; 18.12.2008, 15:03.

        Comment

        Working...
        X