14 Replies Latest reply: Dec 3, 2011 9:26 AM by 903478 RSS

    javax.ejb.TransactionRolledbackLocalException Exception

    813022
      Hi Everybody.

      I'm getting the following exception with Glassfish v3

      javax.ejb.TransactionRolledbackLocalException: Client's transaction aborted
      at com.sun.ejb.containers.BaseContainer.useClientTx(BaseContainer.java:4576)
      at com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:4454)
      at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1826)
      at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:188)
      at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:84)
      at $Proxy494.getMaximoDescuento(Unknown Source)
      at py.com.rde.gestion.comercial.ejb.__EJB31_Generated__DescuentoEJB__Intf____Bean__.getMaximoDescuento(Unknown Source)

      Does any body knows the source of the problem?
        • 1. Re: javax.ejb.TransactionRolledbackLocalException Exception
          gimbal2
          Most likely, an exception occurred in the getMaximoDescuento() method, which is an call in an EJB somewhere. Because the exception occurred, the server rolled back the transaction that was active.

          Is there by any chance a root cause in your stacktrace? That should point somewhere to the real exception that occurred. From there you're on your own I'm afraid; I recommend a good debugger so you can step through the code and figure out why the exception is happening.
          • 2. Re: javax.ejb.TransactionRolledbackLocalException Exception
            813022
            Thanks for the quick answer.

            The real cause I don't know because when it calls the getMaximoDescuento method from DescuentoEJB EJB it raises that exception. It says nothing about the cause. I'm using netbeans 6.8 for debugging.

            the entire stacktrace is

            ADVERTENCIA: A system exception occurred during an invocation on EJB DescuentoEJB method public java.lang.Float py.com.rde.gestion.comercial.ejb.DescuentoEJB.getMaximoDescuento(py.com.rde.gestion.stock.jpa.Producto,py.com.rde.gestion.comercial.jpa.ListaPrecio)
            javax.ejb.TransactionRolledbackLocalException: Client's transaction aborted
            at com.sun.ejb.containers.BaseContainer.useClientTx(BaseContainer.java:4576)
            at com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:4454)
            at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1826)
            at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:188)
            at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:84)
            at $Proxy494.getMaximoDescuento(Unknown Source)
            at py.com.rde.gestion.comercial.ejb.__EJB31_Generated__DescuentoEJB__Intf____Bean__.getMaximoDescuento(Unknown Source)
            at py.com.rde.gestion.comercial.ejb.ComprobanteVentaEJB.controlPrecio(ComprobanteVentaEJB.java:345)
            at py.com.rde.gestion.comercial.ejb.ComprobanteVentaEJB.controlarComprobanteVenta(ComprobanteVentaEJB.java:311)
            at py.com.rde.gestion.comercial.ejb.ComprobanteVentaEJB.antesInsertar(ComprobanteVentaEJB.java:185)
            at py.com.rde.gestion.comercial.ejb.ComprobanteVentaEJB.antesInsertarComprobanteVentaNotaRemision(ComprobanteVentaEJB.java:833)
            at py.com.rde.gestion.comercial.ejb.ComprobanteVentaEJB.insertarComprobanteVentaNotaRemision(ComprobanteVentaEJB.java:826)
            at py.com.rde.gestion.comercial.ejb.ComprobanteVentaEJB.insertar(ComprobanteVentaEJB.java:821)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:616)
            at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
            at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
            at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5243)
            at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:615)
            at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
            at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:567)
            at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:157)
            at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:139)
            at sun.reflect.GeneratedMethodAccessor1123.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:616)
            at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:858)
            at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
            at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:367)
            at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5215)
            at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5203)
            at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:190)
            at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:84)
            at $Proxy500.insertar(Unknown Source)
            at py.com.rde.gestion.comercial.ejb.__EJB31_Generated__ComprobanteVentaEJB__Intf____Bean__.insertar(Unknown Source)
            at py.com.rde.gestion.comercial.ejb.NotaRemisionEJB.devolverNota(NotaRemisionEJB.java:120)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:616)
            at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
            at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
            at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5243)
            at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:615)
            at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
            at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:567)
            at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:157)
            at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:139)
            at sun.reflect.GeneratedMethodAccessor1123.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:616)
            at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:858)
            at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
            at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:367)
            at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5215)
            at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5203)
            at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:190)
            at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:84)
            at $Proxy477.devolverNota(Unknown Source)
            at py.com.rde.gestion.comercial.ejb.__EJB31_Generated__NotaRemisionEJB__Intf____Bean__.devolverNota(Unknown Source)
            at py.com.rde.gestion.comercial.cdi.NotaRemisionDevueltaController.devolverNota(NotaRemisionDevueltaController.java:84)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:616)
            at org.jboss.weld.bean.proxy.ClientProxyMethodHandler.invoke(ClientProxyMethodHandler.java:113)
            at py.com.rde.gestion.comercial.cdi.NotaRemisionDevueltaController_$$_javassist_406.devolverNota(NotaRemisionDevueltaController_$$_javassist_406.java)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:616)
            at javax.el.BeanELResolver.invokeMethod(BeanELResolver.java:737)
            at javax.el.BeanELResolver.invoke(BeanELResolver.java:467)
            at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:246)
            at com.sun.el.parser.AstValue.invoke(AstValue.java:228)
            at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
            at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:43)
            at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:72)
            at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:98)
            at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:148)
            at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
            at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:772)
            at javax.faces.component.UICommand.broadcast(UICommand.java:300)
            at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)
            at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1267)
            at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
            at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
            at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
            at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
            at py.com.rde.gestion.base.jsf.ControlAccesoFilter.doFilter(ControlAccesoFilter.java:77)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
            at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
            at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
            at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
            at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
            at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
            at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
            at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
            at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
            at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
            at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
            at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
            at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
            at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
            at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
            at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
            at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
            at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
            at java.lang.Thread.run(Thread.java:636)

            ADVERTENCIA: A system exception occurred during an invocation on EJB ComprobanteVentaEJB method public void py.com.rde.gestion.comercial.ejb.ComprobanteVentaEJB.insertar(py.com.rde.gestion.comercial.jpa.NotaRemision,py.com.rde.gestion.stock.jpa.ComprobanteStock,py.com.rde.gestion.stock.jpa.ComprobanteStock) throws py.com.rde.gestion.base.util.GestionRDEExcepcion,java.lang.Exception
            javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean
            at com.sun.ejb.containers.BaseContainer.checkExceptionClientTx(BaseContainer.java:4926)
            at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4761)
            at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1955)
            at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1906)
            at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:198)
            at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:84)
            at $Proxy500.insertar(Unknown Source)
            at py.com.rde.gestion.comercial.ejb.__EJB31_Generated__ComprobanteVentaEJB__Intf____Bean__.insertar(Unknown Source)
            at py.com.rde.gestion.comercial.ejb.NotaRemisionEJB.devolverNota(NotaRemisionEJB.java:120)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:616)
            at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
            at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
            at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5243)
            at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:615)
            at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
            at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:567)
            at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:157)
            at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:139)
            at sun.reflect.GeneratedMethodAccessor1123.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:616)
            at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:858)
            at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
            at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:367)
            at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5215)
            at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5203)
            at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:190)
            at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:84)
            at $Proxy477.devolverNota(Unknown Source)
            at py.com.rde.gestion.comercial.ejb.__EJB31_Generated__NotaRemisionEJB__Intf____Bean__.devolverNota(Unknown Source)
            at py.com.rde.gestion.comercial.cdi.NotaRemisionDevueltaController.devolverNota(NotaRemisionDevueltaController.java:84)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:616)
            at org.jboss.weld.bean.proxy.ClientProxyMethodHandler.invoke(ClientProxyMethodHandler.java:113)
            at py.com.rde.gestion.comercial.cdi.NotaRemisionDevueltaController_$$_javassist_406.devolverNota(NotaRemisionDevueltaController_$$_javassist_406.java)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:616)
            at javax.el.BeanELResolver.invokeMethod(BeanELResolver.java:737)
            at javax.el.BeanELResolver.invoke(BeanELResolver.java:467)
            at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:246)
            at com.sun.el.parser.AstValue.invoke(AstValue.java:228)
            at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
            at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:43)
            at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:72)
            at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:98)
            at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:148)
            at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
            at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:772)
            at javax.faces.component.UICommand.broadcast(UICommand.java:300)
            at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)
            at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1267)
            at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
            at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
            at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
            at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
            at py.com.rde.gestion.base.jsf.ControlAccesoFilter.doFilter(ControlAccesoFilter.java:77)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
            at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
            at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
            at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
            at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
            at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
            at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
            at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
            at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
            at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
            at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
            at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
            at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
            at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
            at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
            at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
            at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
            at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
            at java.lang.Thread.run(Thread.java:636)
            • 3. Re: javax.ejb.TransactionRolledbackLocalException Exception
              gimbal2
              I did a little research on this error and it is unfortunately not one easily explained. Transaction aborted is not something that happens because of a programming failure, that much is clear to me. Something in the internals of the server blew (which is why there is no root cause); and now it is the game of figuring out what.


              Since you are using Glassfish - this particular blog post might be of use to you:

              http://pcjuzeren.blogspot.com/2008/12/clients-transaction-aborted.html


              This blogpost indicates to increase the maximum thread count.
              • 4. Re: javax.ejb.TransactionRolledbackLocalException Exception
                ramp
                810019 wrote:
                Thanks for the quick answer.

                The real cause I don't know because when it calls the getMaximoDescuento method from DescuentoEJB EJB it raises that exception. It says nothing about the cause. I'm using netbeans 6.8 for debugging.
                An unchecked exception (of type java.lang.RuntimeException or it's subclass) causes a transaction rollback for CMT. You can wrap the method in a try catch block and figure out the cause of the exception.
                ... getMaximoDescuento (..){
                  try{
                       ...your code..
                  }catch(Throwable t){
                      System.out.println(t); //or other logging
                  }
                Of course that would prevent the ejb from completing it's logical flow. But at least you would know what caused the exception and take it from there.

                cheers,
                ram.
                • 5. Re: javax.ejb.TransactionRolledbackLocalException Exception
                  813022
                  Thanks again for the answers! The exception became weird now! At some point in the code I create a Query Object and try getting a single result but it throws me a duplicate key exception(Usuario Entity) but I have never persisted or merged that entity in the workflow of my program. It's really crazy. How can I debug this?

                  ADVERTENCIA: Local Exception Stack:
                  Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.0.v20091127-r5931): org.eclipse.persistence.exceptions.DatabaseException
                  Internal Exception: org.postgresql.util.PSQLException: ERROR: llave duplicada viola restricción de unicidad «ut_usuarios_username_key»
                  Error Code: 0
                  Call: INSERT INTO UT_USUARIOS (USERNAME, PASSWORD, ACTIVO, SUCURSAL_ID, EMPRESA_ID, PUNTOVENTA_ID, PERSONA_ID, DEPOSITO_ID) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
                  bind => [prueba, 12345, true, 1, 1, 1, 1002, 13]
                  Query: WriteObjectQuery(py.com.rde.gestion.utilitarios.usuario.Usuario[id=2201])
                  at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:333)
                  at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.processExceptionForCommError(DatabaseAccessor.java:1415)
                  at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:798)
                  at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:866)
                  at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:586)
                  at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:529)
                  at org.eclipse.persistence.internal.sessions.AbstractSession.executeCall(AbstractSession.java:914)
                  at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:205)
                  at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:191)
                  at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.insertObject(DatasourceCallQueryMechanism.java:334)
                  at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:162)
                  at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:177)
                  at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.insertObjectForWrite(DatabaseQueryMechanism.java:461)
                  at org.eclipse.persistence.queries.InsertObjectQuery.executeCommit(InsertObjectQuery.java:80)
                  at org.eclipse.persistence.queries.InsertObjectQuery.executeCommitWithChangeSet(InsertObjectQuery.java:90)
                  at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.performUserDefinedWrite(DatabaseQueryMechanism.java:547)
                  at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.performUserDefinedInsert(DatabaseQueryMechanism.java:515)
                  at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.insertObjectForWrite(DatabaseQueryMechanism.java:392)
                  at org.eclipse.persistence.queries.WriteObjectQuery.executeCommitWithChangeSet(WriteObjectQuery.java:121)
                  at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:286)
                  at org.eclipse.persistence.queries.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:58)
                  at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:675)
                  at org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:589)
                  at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:109)
                  at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:86)
                  at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2863)
                  at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1225)
                  at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1207)
                  at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1167)
                  at org.eclipse.persistence.mappings.ObjectReferenceMapping.update(ObjectReferenceMapping.java:1042)
                  at org.eclipse.persistence.mappings.ObjectReferenceMapping.preUpdate(ObjectReferenceMapping.java:545)
                  at org.eclipse.persistence.descriptors.DescriptorQueryManager.preUpdate(DescriptorQueryManager.java:1018)
                  at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.updateObjectForWriteWithChangeSet(DatabaseQueryMechanism.java:1099)
                  at org.eclipse.persistence.queries.UpdateObjectQuery.executeCommitWithChangeSet(UpdateObjectQuery.java:84)
                  at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:286)
                  at org.eclipse.persistence.queries.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:58)
                  at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:675)
                  at org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:589)
                  at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:109)
                  at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:86)
                  at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2863)
                  at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1225)
                  at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1207)
                  at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1167)
                  at org.eclipse.persistence.internal.sessions.CommitManager.commitChangedObjectsForClassWithChangeSet(CommitManager.java:233)
                  at org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:108)
                  at org.eclipse.persistence.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:3260)
                  at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1405)
                  at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitToDatabase(RepeatableWriteUnitOfWork.java:547)
                  at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithPreBuiltChangeSet(UnitOfWorkImpl.java:1551)
                  at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.writeChanges(RepeatableWriteUnitOfWork.java:360)
                  at org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:696)
                  at org.eclipse.persistence.internal.jpa.EJBQueryImpl.performPreQueryFlush(EJBQueryImpl.java:1182)
                  at org.eclipse.persistence.internal.jpa.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:404)
                  at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getSingleResult(EJBQueryImpl.java:702)
                  at py.com.rde.gestion.utilitarios.ejb.TipoComprobanteEJB.getTipoComprobante(TipoComprobanteEJB.java:46)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.lang.reflect.Method.invoke(Method.java:616)
                  at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
                  at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
                  at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5243)
                  at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:615)
                  at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
                  at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:567)
                  at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:157)
                  at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:139)
                  at sun.reflect.GeneratedMethodAccessor1223.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.lang.reflect.Method.invoke(Method.java:616)
                  at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:858)
                  at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
                  at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:367)
                  at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5215)
                  at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5203)
                  at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:190)
                  at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:84)
                  at $Proxy589.getTipoComprobante(Unknown Source)
                  at py.com.rde.gestion.utilitarios.ejb.__EJB31_Generated__TipoComprobanteEJB__Intf____Bean__.getTipoComprobante(Unknown Source)
                  at py.com.rde.gestion.comercial.ejb.ComprobanteVentaEJB.antesInsertar(ComprobanteVentaEJB.java:184)
                  at py.com.rde.gestion.comercial.ejb.ComprobanteVentaEJB.antesInsertarComprobanteVentaNotaRemision(ComprobanteVentaEJB.java:835)
                  at py.com.rde.gestion.comercial.ejb.ComprobanteVentaEJB.insertarComprobanteVentaNotaRemision(ComprobanteVentaEJB.java:828)
                  at py.com.rde.gestion.comercial.ejb.ComprobanteVentaEJB.insertar(ComprobanteVentaEJB.java:823)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.lang.reflect.Method.invoke(Method.java:616)
                  at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
                  at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
                  at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5243)
                  at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:615)
                  at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
                  at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:567)
                  at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:157)
                  at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:139)
                  at sun.reflect.GeneratedMethodAccessor1223.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.lang.reflect.Method.invoke(Method.java:616)
                  at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:858)
                  at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
                  at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:367)
                  at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5215)
                  at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5203)
                  at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:190)
                  at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:84)
                  at $Proxy585.insertar(Unknown Source)
                  at py.com.rde.gestion.comercial.ejb.__EJB31_Generated__ComprobanteVentaEJB__Intf____Bean__.insertar(Unknown Source)
                  at py.com.rde.gestion.comercial.ejb.NotaRemisionEJB.devolverNota(NotaRemisionEJB.java:120)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.lang.reflect.Method.invoke(Method.java:616)
                  at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
                  at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
                  at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5243)
                  at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:615)
                  at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
                  at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:567)
                  at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:157)
                  at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:139)
                  at sun.reflect.GeneratedMethodAccessor1223.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.lang.reflect.Method.invoke(Method.java:616)
                  at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:858)
                  at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
                  at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:367)
                  at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5215)
                  at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5203)
                  at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:190)
                  at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:84)
                  at $Proxy594.devolverNota(Unknown Source)
                  at py.com.rde.gestion.comercial.ejb.__EJB31_Generated__NotaRemisionEJB__Intf____Bean__.devolverNota(Unknown Source)
                  at py.com.rde.gestion.comercial.cdi.NotaRemisionDevueltaController.devolverNota(NotaRemisionDevueltaController.java:84)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.lang.reflect.Method.invoke(Method.java:616)
                  at org.jboss.weld.bean.proxy.ClientProxyMethodHandler.invoke(ClientProxyMethodHandler.java:113)
                  at py.com.rde.gestion.comercial.cdi.NotaRemisionDevueltaController_$$_javassist_532.devolverNota(NotaRemisionDevueltaController_$$_javassist_532.java)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.lang.reflect.Method.invoke(Method.java:616)
                  at javax.el.BeanELResolver.invokeMethod(BeanELResolver.java:737)
                  at javax.el.BeanELResolver.invoke(BeanELResolver.java:467)
                  at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:246)
                  at com.sun.el.parser.AstValue.invoke(AstValue.java:228)
                  at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
                  at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:43)
                  at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:72)
                  at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:98)
                  at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:148)
                  at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
                  at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:772)
                  at javax.faces.component.UICommand.broadcast(UICommand.java:300)
                  at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)
                  at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1267)
                  at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
                  at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
                  at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
                  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
                  at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
                  at py.com.rde.gestion.base.jsf.ControlAccesoFilter.doFilter(ControlAccesoFilter.java:77)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
                  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
                  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
                  at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
                  at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
                  at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
                  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
                  at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
                  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
                  at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
                  at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
                  at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
                  at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
                  at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
                  at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
                  at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
                  at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
                  at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
                  at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
                  at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
                  at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
                  at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
                  at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
                  at java.lang.Thread.run(Thread.java:636)
                  Caused by: org.postgresql.util.PSQLException: ERROR: llave duplicada viola restricción de unicidad «ut_usuarios_username_key»
                  at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)
                  at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
                  at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)
                  at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
                  at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)
                  at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:304)
                  at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:791)
                  ... 188 more
                  • 6. Re: javax.ejb.TransactionRolledbackLocalException Exception
                    813022
                    the stack trace continues here

                    ADVERTENCIA: A system exception occurred during an invocation on EJB TipoComprobanteEJB method public py.com.rde.gestion.utilitarios.jpa.TipoComprobante py.com.rde.gestion.utilitarios.ejb.TipoComprobanteEJB.getTipoComprobante(java.lang.Long) throws py.com.rde.gestion.base.util.GestionRDEExcepcion
                    javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean
                    at com.sun.ejb.containers.BaseContainer.checkExceptionClientTx(BaseContainer.java:4926)
                    at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4761)
                    at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1955)
                    at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1906)
                    at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:198)
                    at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:84)
                    at $Proxy589.getTipoComprobante(Unknown Source)
                    at py.com.rde.gestion.utilitarios.ejb.__EJB31_Generated__TipoComprobanteEJB__Intf____Bean__.getTipoComprobante(Unknown Source)
                    at py.com.rde.gestion.comercial.ejb.ComprobanteVentaEJB.antesInsertar(ComprobanteVentaEJB.java:184)
                    at py.com.rde.gestion.comercial.ejb.ComprobanteVentaEJB.antesInsertarComprobanteVentaNotaRemision(ComprobanteVentaEJB.java:835)
                    at py.com.rde.gestion.comercial.ejb.ComprobanteVentaEJB.insertarComprobanteVentaNotaRemision(ComprobanteVentaEJB.java:828)
                    at py.com.rde.gestion.comercial.ejb.ComprobanteVentaEJB.insertar(ComprobanteVentaEJB.java:823)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                    at java.lang.reflect.Method.invoke(Method.java:616)
                    at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
                    at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
                    at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5243)
                    at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:615)
                    at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
                    at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:567)
                    at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:157)
                    at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:139)
                    at sun.reflect.GeneratedMethodAccessor1223.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                    at java.lang.reflect.Method.invoke(Method.java:616)
                    at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:858)
                    at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
                    at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:367)
                    at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5215)
                    at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5203)
                    at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:190)
                    at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:84)
                    at $Proxy585.insertar(Unknown Source)
                    at py.com.rde.gestion.comercial.ejb.__EJB31_Generated__ComprobanteVentaEJB__Intf____Bean__.insertar(Unknown Source)
                    at py.com.rde.gestion.comercial.ejb.NotaRemisionEJB.devolverNota(NotaRemisionEJB.java:120)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                    at java.lang.reflect.Method.invoke(Method.java:616)
                    at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
                    at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
                    at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5243)
                    at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:615)
                    at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
                    at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:567)
                    at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:157)
                    at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:139)
                    at sun.reflect.GeneratedMethodAccessor1223.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                    at java.lang.reflect.Method.invoke(Method.java:616)
                    at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:858)
                    at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
                    at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:367)
                    at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5215)
                    at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5203)
                    at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:190)
                    at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:84)
                    at $Proxy594.devolverNota(Unknown Source)
                    at py.com.rde.gestion.comercial.ejb.__EJB31_Generated__NotaRemisionEJB__Intf____Bean__.devolverNota(Unknown Source)
                    at py.com.rde.gestion.comercial.cdi.NotaRemisionDevueltaController.devolverNota(NotaRemisionDevueltaController.java:84)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                    at java.lang.reflect.Method.invoke(Method.java:616)
                    at org.jboss.weld.bean.proxy.ClientProxyMethodHandler.invoke(ClientProxyMethodHandler.java:113)
                    at py.com.rde.gestion.comercial.cdi.NotaRemisionDevueltaController_$$_javassist_532.devolverNota(NotaRemisionDevueltaController_$$_javassist_532.java)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                    at java.lang.reflect.Method.invoke(Method.java:616)
                    at javax.el.BeanELResolver.invokeMethod(BeanELResolver.java:737)
                    at javax.el.BeanELResolver.invoke(BeanELResolver.java:467)
                    at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:246)
                    at com.sun.el.parser.AstValue.invoke(AstValue.java:228)
                    at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
                    at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:43)
                    at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:72)
                    at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:98)
                    at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:148)
                    at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
                    at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:772)
                    at javax.faces.component.UICommand.broadcast(UICommand.java:300)
                    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)
                    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1267)
                    at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
                    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
                    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
                    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
                    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
                    at py.com.rde.gestion.base.jsf.ControlAccesoFilter.doFilter(ControlAccesoFilter.java:77)
                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
                    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
                    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
                    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
                    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
                    at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
                    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
                    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
                    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
                    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
                    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
                    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
                    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
                    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
                    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
                    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
                    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
                    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
                    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
                    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
                    at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
                    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
                    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
                    at java.lang.Thread.run(Thread.java:636)
                    • 7. Re: javax.ejb.TransactionRolledbackLocalException Exception
                      gimbal2
                      ... by using a debugger. Step through the code and see where it blows. Along the way I hope you'll find the root of your wrong assumptions, because you are making one somewhere. The code is generating an insert statement, so a persist must happen somewhere along the line. Perhaps your code is taking a route you aren't expecting, who knows. Only one way to find out: debug and step through to see which code is being executed.

                      What can also help in the future is to add debug logging to your code so it can tell you what it was doing. Debugging is easy when you are still in the development phase, but once you put an application in production you become severely limited in diagnosing problems. You will still want to be able to trace what was going on when something blows in production; a simple log file can make the difference between spending 10 minutes and 10 hours figuring out a problem.
                      • 8. Re: javax.ejb.TransactionRolledbackLocalException Exception
                        813022
                        I'm still thinking is a internal error of Glassfish. I did this test

                        em.flush();

                        someList.remove(someItem);

                        em.flsuh();

                        In the second flush it raises the exception I have posted. It has no sense at all. If I had done a previously persist it should raise at first flush. Anyway thanks for your help.
                        • 9. Re: javax.ejb.TransactionRolledbackLocalException Exception
                          816458
                          Hi,

                          I had the same problem.
                          In my case, I was using multiple EJBs injected into a base EJB, and each EJB had their own EntityManger injected.
                          After I removed one injected EJB from the base EJB and changed to use the same EntityManger as on a base EJB, the error disappeared.

                          I'm not sure why, but it works in my case.
                          Maybe it'll help you.

                          Thanks.
                          • 10. Re: javax.ejb.TransactionRolledbackLocalException Exception
                            gimbal2
                            M.Nakazato wrote:
                            Hi,

                            I had the same problem.
                            In my case, I was using multiple EJBs injected into a base EJB, and each EJB had their own EntityManger injected.
                            After I removed one injected EJB from the base EJB and changed to use the same EntityManger as on a base EJB, the error disappeared.

                            I'm not sure why, but it works in my case.
                            Maybe it'll help you.

                            Thanks.
                            Whatever was causing your problem, it didn't have anything to do with using multiple entity managers. Most likely it was an oversight caused by you not knowing enough about what you are doing, such as screwing up the transaction management. You 'just changing some stuff' might have caused you to accidentally remove the problem. It certainly wasn't a fix, it was luck.

                            In any case, your 'advice' certainly won't help anybody. It is never a solution to just try something and hope for the best; the only solution is to understand the problem, reason about it and then fix it with the best solution you can think of.
                            • 11. Re: javax.ejb.TransactionRolledbackLocalException Exception
                              816458
                              gimbal2, yes, you are right.

                              So, I've investigated a little more and found that the error had gone by removing EJB injection, but not by removing using multiple EntityManagers.

                              But now I found the solution for this error.

                              I think that your injected EJB is annotated by @Local, @Remote, or none.
                              Add(or remove) these annotations and re-clean up and re-deploy your application.
                              So, the error will disappear.

                              I know that it's still just luck.
                              I don't know the exact reason and I'm not so sure it woks in your case.

                              Thanks,
                              Nakazato.
                              • 12. Re: javax.ejb.TransactionRolledbackLocalException Exception
                                813022
                                I dont' understand your solution Nazakato

                                I have No interface Stateless EJB injected in anothers EJBs, and each time I want to run my aplicaction, I clean y deploy it.
                                • 13. Re: javax.ejb.TransactionRolledbackLocalException Exception
                                  816458
                                  OK.

                                  If you have no @Local nor @Remote, please try to add one of them or both and re-deploy your application,
                                  and then remove it and re-deploy it again.

                                  0.
                                  @Stateless
                                  class YOUR_EJB {...}

                                  1. add @Local or @Remote
                                  @Stateless
                                  @Local
                                  class YOUR_EJB {...}

                                  2. re-deploy

                                  3. remove @Local or @Remote (back to the original class definition.)
                                  @Stateless
                                  class YOUR_EJB {...}

                                  4. re-deploy again

                                  Nakazato.
                                  • 14. Re: javax.ejb.TransactionRolledbackLocalException Exception
                                    903478
                                    I was having the same problem which was extremely frustrating because stepping through the debugger gave no information about why this exception was being thrown. Furthermore, the same method called in another class gave me no problem. So it made no sense.

                                    I found that catching and handling exceptions in the methods in which they were thrown eliminated this problem. I was lazily catching Exception in my main code, and even though there shouldnt be a problem with this, whenever any exception was thrown in my data access code, or my data manipulation code, which were 2-3 classes down from my main code, I would get this error.

                                    So for those of you for whom Nakazato's 'solution' doesn't work (like me), try going down through your code and catching the exceptions where they happen. After 2 days of hair pulling, it just seemed like when exceptions bubbled up through my classes, it somehow screwed up Eclipselink's db connectivity.