aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Not intutive exception logs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Not intutive exception logs" Watch "Not intutive exception logs" New topic
Author

Not intutive exception logs

Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
when i used PersistenceContextType.Extended on Stateless Bean, i expected the server.log will complain about EntityManagerScoping.

/**
* Session Bean implementation class CarCreatorBean
*/
@Stateless(name="StatelessSessionBean", mappedName="ejb/SimpleJNDIName")
public class CarCreatorBean implements CarCreator {
{
@PersistenceContext(unitName ="actionBazaar", type=PersistenceContextType.EXTENDED)
private EntityManager entityManager;

}

but it didn't the log's were like this-

[#|2008-11-24T18:58:19.406-0500|INFO|sun-appserver-pe9.0|javax.enterprise.system.container.ejb|_ThreadID=27;_ThreadName=p: thread-pool-1; w: 37;StatelessSessionBean;|EJB5018: An exception was thrown during an ejb invocation on [StatelessSessionBean]|#]

[#|2008-11-24T18:58:19.406-0500|INFO|sun-appserver-pe9.0|javax.enterprise.system.container.ejb|_ThreadID=27;_ThreadName=p: thread-pool-1; w: 37;|
javax.ejb.EJBException
at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:3730)
at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3630)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3431)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:197)
at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:110)
at $Proxy78.addCarComponents(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:597)
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.doWork(SocketOrChannelConnectionImpl.java:1270)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)
Caused by: java.lang.NullPointerException
at com.sun.enterprise.util.EntityManagerWrapper.persist(EntityManagerWrapper.java:433)
at Pack.CarCreatorBean.addCarComponents(CarCreatorBean.java:30)
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:597)
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)
... 17 more
|#]


SCJP 1.4, SCWCD 5, SCBCD 5, OCPJWSD 5,SCEA-1, Started Assignment Part 2
My blog- http://rkydesigns.blogspot.com
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

I've looked through the spec, but I can't find anything specific to how the container should behave when an extended persistence context is used with a stateless session bean. It's true that this error is difficult to trace with this log.


[My Blog]
All roads lead to JavaRanch
Chaminda Amarasinghe
Ranch Hand

Joined: May 17, 2006
Posts: 402


Extended in stateless ???

Its not allowed at all....

See the section of JPA spec

5.6.2 Container-managed Extended Persistence Context
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Not intutive exception logs