G
Gast2
Gast
Hallo zusammen,
ich versuche grad einen Service von einem Client aufzurufen, so wie es hier beschrieben ist
Chapter6.JBoss EJB 3.0 extensions
Interface
Impl:
Client:
Exeption
Server Log
Hab ich ein falsche namen im lookup angegeben oder fehlen mir irgendwelche Configs?
Danke und Gruß
ich versuche grad einen Service von einem Client aufzurufen, so wie es hier beschrieben ist
Chapter6.JBoss EJB 3.0 extensions
Interface
Java:
@Remote
public interface AngebotRemoteService {
Set<Angebot> getAngebote();
}
Java:
@Stateful
public class AngebotRemoteServiceImpl implements AngebotRemoteService{
@Override
public Set<Angebot> getAngebote() {
//....
return angebote;
}
}
Client:
Java:
public class Client{
public static void main(String[] args) {
AngebotRemoteService angebotContainerService = null;
// lookup the account manager bean
try {
Context context = new InitialContext();
angebotContainerService = (AngebotRemoteService) context
.lookup(AngebotRemoteService.class.getName());
} catch (NamingException ne) {
throw new RuntimeException("Could not lookup AngebotRemoteService: ",
ne);
}
}
Exeption
Java:
Exception in thread "main" java.lang.RuntimeException: Could not lookup AngebotRemoteService:
at main.Main.main(Main.java:30)
Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at main.Main.main(Main.java:28)
Server Log
Code:
12:16:29,476 INFO [org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
AngebotRemoteServiceImpl/remote - EJB3.x Default Remote Business Interface
AngebotRemoteServiceImpl/remote-remote.AngebotRemoteService - EJB3.x Remote Business Interface
Danke und Gruß