ERLEDIGT
NEIN
NEIN
ANTWORTEN
0
0
ZUGRIFFE
636
636
EMPFEHLEN
-
05.04.11 13:02 #1
- Registriert seit
- Dec 2009
- Beiträge
- 125
Hallo zusammen,
ich versuche nun schon eine ganze Weile meinen EJB Service von einem Remote Client aus aufzurufen:
Stateless Sessionbean:
Code java:1 2 3 4 5 6 7 8 9 10
@Stateless public class NewSessionBean implements NewSessionBeanRemote { public static final String RemoteJNDIName = NewSessionBean.class.getSimpleName() + "/remote"; public static final String LocalJNDIName = NewSessionBean.class.getSimpleName() + "/local"; public String businessMethod() { return "Hello World"; } }
Interface:
Client:
Code java:1 2 3 4 5 6 7 8 9
Context c = new InitialContext(); Properties properties = new Properties(); properties.put("java.naming.factory.initial","com.sun.enterprise.naming.SerialInitContextFactory"); properties.put("java.naming.factory.url.pkgs","com.sun.enterprise.naming"); properties.put("java.naming.provider.url", "jnp://localhost:1099"); Context ctx = new InitialContext(properties); System.out.println("Got context"); NewSessionBeanRemote ans = (NewSessionBeanRemote) ctx.lookup(NewSessionBean.RemoteJNDIName);
Leider bekomme ich immer einen NPE. Jemand eine Ahnung was hier schief läuft?
Viele Dank für Eure Hilfe!
Sebastian
Ähnliche Themen
-
log4j für ejb3 + glassfish ?
Von reweiss im Forum Enterprise Java (JEE, J2EE, Spring & Co.)Antworten: 0Letzter Beitrag: 06.08.08, 09:56 -
RCP EJB3 Remote Collection -> InvocationException
Von maksbor80 im Forum Enterprise Java (JEE, J2EE, Spring & Co.)Antworten: 7Letzter Beitrag: 27.05.08, 20:18 -
File upload, benutze EJB3 und Swing-Client
Von ThirdKeeper im Forum Enterprise Java (JEE, J2EE, Spring & Co.)Antworten: 4Letzter Beitrag: 13.02.08, 16:44 -
EJB3 - Instanz von Remote Stateful Bean an Client zurückgeben?
Von sepan im Forum Enterprise Java (JEE, J2EE, Spring & Co.)Antworten: 5Letzter Beitrag: 15.07.07, 14:33 -
EJB3, JNDI, lokale Interfaces und Glassfish
Von loopdruid im Forum Enterprise Java (JEE, J2EE, Spring & Co.)Antworten: 0Letzter Beitrag: 12.12.06, 22:57





Zitieren
Login





