Hi,
I have a prob with Jboss. I'm executing a session bean from a servlet in
Resin. The
session bean itself fetchs a entity bean like so:
public String fetchEmployer(String id)
{
System.out.println ("Someone called `fetchEmployer!'");
String employerDetails = "";
int employerID = new Integer(id.trim()).intValue();
System.setProperty("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
System.setProperty("java.naming.provider.url",
"localhost:1099");
try {
// Get context from EJBserver
InitialContext jndiContext = new InitialContext();
// Get the home interface
Object ref = jndiContext.lookup("Employer");
EmployerHome employerHome = (EmployerHome)
PortableRemoteObject.narrow(ref, EmployerHome.class);
System.out.println ("Got home of Employer...");
EmployerRemote employer = employerHome.findByPrimaryKey( new
EmployerPK( employerID ) );
System.out.println ("Got remote of Employer...");
employerDetails = employer.getDetails();
} catch(Exception e) {
System.out.println(e.toString());
}
System.out.println ("Returning string...");
return employerDetails;
}
And i get this sort of error....
java.rmi.ServerException: RemoteException occurred in server thread; nested
exception is:
java.rmi.ServerException: Transaction rolled
back:javax/rmi/PortableRemoteObject
java.rmi.ServerException: Transaction rolled
back:javax/rmi/PortableRemoteObject
at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteC
all.java:245)
at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
at
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invoke(Unknown
Source)
at
org.jboss.ejb.plugins.jrmp.interfaces.StatelessSessionProxy.invoke(Stateless
SessionProxy.java:175)
at
org.jboss.proxy.ProxyCompiler$Runtime.invoke(ProxyCompiler.java:74)
at org.adv.test.EmployerLibraryRemote$Proxy.fetchEmployer(Unknown
Source)
at JBossServlet.doGet(JBossServlet.java:59)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:102)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:83)
at
com.caucho.server.http.AbstractRequest.service(AbstractRequest.java:452)
at
com.caucho.server.http.AbstractRequest.service(AbstractRequest.java:395)
at
com.caucho.server.http.PageCache$Entry.service(PageCache.java:256)
at com.caucho.server.http.PageCache.service(PageCache.java:105)
at com.caucho.server.http.VirtualHost.service(VirtualHost.java:424)
at com.caucho.server.http.Request.dispatch(Request.java:212)
at
com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:313)
at
com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:260
)
at com.caucho.server.TcpConnection.run(TcpConnection.java:142)
at java.lang.Thread.run(Thread.java:475)
Any ideas or suggestions????
Thanks
-John