|
Re: Using Rap with EJB 3 [message #91298 is a reply to message #91111] |
Tue, 03 June 2008 04:36 |
Eclipse User |
|
|
|
Originally posted by: fappel.innoopract.com
Hm,
what can I say? Are there any stacktraces, OSGi status traces etc.
available? It may be helpful to have an exception handling in place
after catching the NamingException, at least printing the stacktrace to
the console.
Ciao
Frank
-----Ursprüngliche Nachricht-----
Von: kruemel_monster [mailto:tobias.bergtholdt@gmail.com]
Bereitgestellt: Montag, 2. Juni 2008 11:03
Bereitgestellt in: eclipse.technology.rap
Unterhaltung: Using Rap with EJB 3
Betreff: Using Rap with EJB 3
Hi,
I want to use rap with a EJB 3 business layer. I started with a very
simple HelloWorldEjbExample, but its not working at all.
Any ideas or comments would be fine.
Here my EJB Code:
package hello;
@javax.ejb.Remote
public interface HelloWorld {
public String hello(String who);
}
@javax.ejb.Stateless
public class HelloWorldImpl implements HelloWorld {
public String hello(String who) {
System.out.println("Say hello to " + who);
return "Hello " + who;
}
}
Here the Code on the RAP Side:
public class SayHello {
public String helloEjb() {
Properties props = new Properties();
props.put("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
props.put("java.naming.provider.url",
"jnp://localhost:1099");
try {
InitialContext context = new
InitialContext(props);
HelloWorld hello = (HelloWorld) context
..lookup("HelloWorld/HelloWorldImpl/remote");
return hello.hello("es funkioniert !!!");
} catch (NamingException e) {
}
return "Error";
}
}
Im usisn for Rap Jetty and for the EJB Jboss 4.2
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03589 seconds