What are the transaction attributes for the business methods of the 2
beans, defined in either annotations or descriptors? Please also
provide the business interfaces.
Cheng
Dyego Souza Dantas Leal wrote:
>
> I have this cenario:
>
> Project A with EJB called myEjbOne with method
>
> public User getUser(int userid);
>
>
> and Project B with EJB called myEjbOnProjectTwo with methods...
>
>
> @Stateless
> public class myEjbOnProjectTwo ....
>
> @EJB()
> private myEjbOneRemote userBean;
>
> private User getUser(int id) {
> try {
> return userBean.getUser(id);
> } catch (Exception e) {
> e.printStacktrace();
> }
> }
>
> public methodOne() {
> User a = getUser(12);
> }
>
>
> public void methodTwo() {
> methodOne();
> User a = getUser(12);
>
> }
>
> }
>
>
> On call myEjbOnProjectTwo.methodTwo() i got this error:
>
>
> [#|2006-09-20T13:39:50.086-0300|INFO|sun-appserver-pe9.1|javax.enterprise.system.container.ejb|_ThreadID=28;_ThreadName=p:
> thread-pool-1; w: 8;UsuarioSessionBean;|EJB5018: An exception was
> thrown during an ejb invocation on [myEjbOne]|#]
>
> [#|2006-09-20T13:39:50.086-0300|INFO|sun-appserver-pe9.1|javax.enterprise.system.container.ejb|_ThreadID=28;_ThreadName=p:
> thread-pool-1; w: 8;|
> javax.ejb.TransactionRequiredLocalException
> at
> com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:3126)
> at
> com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1158)
> at
> com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:189)
>
> at
> com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:67)
>
> at $Proxy128.get(Unknown Source)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:585)
> at
> com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121)
>
> at
> com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
>
> at
> com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
>
> at
> com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
>
> at
> com.sun.corba.ee.impl.protocol.SharedCDRClientRequestDispatcherImpl.marshalingComplete(SharedCDRClientRequestDispatcherImpl.java:154)
>
> at
> com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:194)
>
> at
> com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:159)
>
> at
> com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:119)
>
> at
> com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:197)
>
> at
> tests.interfaces.__myEjbOneRemote_Remote_DynamicStub.get(__myEjbOneRemote_Remote_DynamicStub.java)
>
> at
> tests.interfaces._myEjbOneRemote_Wrapper.get(tests.interfaces._myEjbOneRemote_Wrapper.java)
>
> at tests.myEjbOnProjectTwo.getUser(myEjbOnProjectTwo.java:84)
> at tests.myEjbOnProjectTwo.methodTwo(myEjbOnProjectTwo.java:199)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:585)
> at
> com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1050)
>
> at
> com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:165)
> at
> com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2766)
>
> at
> com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3847)
> at
> com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:190)
>
> at
> com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:67)
>
> at $Proxy150.add(Unknown Source)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:585)
> at
> com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121)
>
> at
> com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
>
> at
> com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
>
> at
> com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
>
> at
> com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565)
>
> at
> com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947)
>
> at
> com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178)
>
> at
> com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717)
>
> at
> com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
>
> at
> com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.read(SocketOrChannelConnectionImpl.java:300)
>
> at
> com.sun.corba.ee.impl.transport.ReaderThreadImpl.doWork(ReaderThreadImpl.java:73)
>
> at
> com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)
>
> |#]
>
>
>
> User.java is a EntityBean
>
>
>
>