java.lang.Exception

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • I'm using EJB3/hibernate in JBoss. I have the following line in persistence.xml: <property name="hibernate.ejb.cfgfile" value="hibernate_config.xml"/> In hibernate_config.xml, I set up event handlers: <event type="pre-update"> <listener class="com.fcl.util.HibernateEventListener"/> </event> <event type="post-commit-update"> <listener class="com.fcl.util.HibernateEventListener"/> <listener class="org.hibernate.lucene.event.LuceneEventListener"/> </event> <event type="post-commit-insert"> <listener class="com.fcl.util.HibernateEventListener"/> <listener class="org.hibernate.lucene.event.LuceneEventListener"/> </event> <event type="post-commit-delete"> <listener class="com.fcl.util.HibernateEventListener"/> <listener class="org.hibernate.lucene.event.LuceneEventListener"/> </event> My own code is in com.fcl.util.HibernateEventListener. The 3 post-whatever events are being fired, and I can see my Lucene indices. My event listener, the com.fcl.util.HibernateEventListener is not called. After some investigation, I put debug statements to display a stack trace into org.hibernate.event.EventListeners.setPreUpdateEventListeners(PreUpdateEventListener[] preUpdateEventListener) From this, I discovered that the configuration setup on app deployment is configuring the SessionFactory twice. 16:54:16,015 INFO [Configuration] configuring from resource: hibernate_config.xml 16:54:16,015 INFO [Configuration] Configuration resource: hibernate_config.xml 16:54:16,031 INFO [STDOUT] java.lang.Exception: Setting PreUpdateEventListeners 16:54:16,031 INFO [STDOUT] at org.hibernate.event.EventListeners.setPreUpdateEventListeners(EventListeners.java:418) 16:54:16,031 INFO [STDOUT] at org.hibernate.cfg.Configuration.setListeners(Configuration.java:1661) 16:54:16,031 INFO [STDOUT] at org.hibernate.cfg.Configuration.setListeners(Configuration.java:1493) 16:54:16,031 INFO [STDOUT] at org.hibernate.cfg.Configuration.parseEvent(Configuration.java:1469) 16:54:16,031 INFO [STDOUT] at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1401) 16:54:16,031 INFO [STDOUT] at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1363) 16:54:16,031 INFO [STDOUT] at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1339) 16:54:16,031 INFO [STDOUT] at org.hibernate.cfg.Configuration.configure(Configuration.java:1259) 16:54:16,031 INFO [STDOUT] at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:378) 16:54:16,031 INFO [STDOUT] at org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:20 2) 16:54:16,062 INFO [STDOUT] at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.j ava:78) 16:54:16,062 INFO [STDOUT] at org.jboss.ejb3.Ejb3Deployment.initializeManagedEntityManagerFactory(Ejb3Deployment.java:512) 16:54:16,062 INFO [STDOUT] at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:253) 16:54:16,062 INFO [STDOUT] at org.jboss.ejb3.Ejb3JmxDeployment.create(Ejb3JmxDeployment.java:230) 16:54:16,062 INFO [STDOUT] at org.jboss.ejb3.Ejb3Module.createService(Ejb3Module.java:34) and then, a few milliseconds later: 16:54:16,171 INFO [STDOUT] java.lang.Exception: Setting PreUpdateEventListeners 16:54:16,171 INFO [STDOUT] at org.hibernate.event.EventListeners.setPreUpdateEventListeners(EventListeners.java:418) 16:54:16,171 INFO [STDOUT] at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:124) 16:54:16,171 INFO [STDOUT] at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:473) 16:54:16,171 INFO [STDOUT] at org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:20 2) 16:54:16,171 INFO [STDOUT] at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.j ava:78) 16:54:16,171 INFO [STDOUT] at org.jboss.ejb3.Ejb3Deployment.initializeManagedEntityManagerFactory(Ejb3Deployment.java:512) 16:54:16,171 INFO [STDOUT] at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:253) 16:54:16,171 INFO [STDOUT] at org.jboss.ejb3.Ejb3JmxDeployment.create(Ejb3JmxDeployment.java:230) 16:54:16,171 INFO [STDOUT] at org.jboss.ejb3.Ejb3Module.createService(Ejb3Module.java:34) 16:54:16,171 INFO [STDOUT] at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:245) 16:54:16,171 INFO [STDOUT] at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:228) 16:54:16,171 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 16:54:16,171 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 16:54:16,171 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 16:54:16,171 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585) 16:54:16,171 INFO [STDOUT] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141) 16:54:16,171 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80) 16:54:16,171 INFO [STDOUT] at org.jboss.mx.server.Invocation.invoke(Invocation.java:72) 16:54:16,171 INFO [STDOUT] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245) 16:54:16,171 INFO [STDOUT] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644) 16:54:16,171 INFO [STDOUT] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943) It's configuring once from my XML configuration file, and then it does its own configuration where it sets the pre update listener to be a org.hibernate.validator.event.ValidateEventListener The problem is that the org.hibernate.event.EventListeners class only has a method for [b]setting the entire stack[/b] of listeners. OK, you can get the array, create a new one, copy the old one, add yours, and set it, but the org.hibernate.ejb.EventListenerConfigurator doesn't do that, it just uses what's available and stomps over user-specified listeners. Surely, like most event handling patterns there should be an addBlahEventListener() call in org.hibernate.event.EventListeners? Either that or org.hibernate.ejb.EventListenerConfigurator should get the handler array, copy it to a new array, and [b]add[/b] it's own listener at the start or end of the array. I have attached the necessary files in zip archives. You will need to get the provided org.hibernate.event.EventListeners class (with the stacktrace display) into the classpath ahead of the original one, so put aamyhibernate.jar into the server/default/lib directory and restart. You don't event need an actual entity bean to see this, just deploy testcase.par. This just displays a stack trace whenever PostUpdateEventListeners are set. I've just deployed it, and it displays the stack trace [b]three times![/b]
    via by Nigel White,
  • I'm using EJB3/hibernate in JBoss. I have the following line in persistence.xml: <property name="hibernate.ejb.cfgfile" value="hibernate_config.xml"/> In hibernate_config.xml, I set up event handlers: <event type="pre-update"> <listener class="com.fcl.util.HibernateEventListener"/> </event> <event type="post-commit-update"> <listener class="com.fcl.util.HibernateEventListener"/> <listener class="org.hibernate.lucene.event.LuceneEventListener"/> </event> <event type="post-commit-insert"> <listener class="com.fcl.util.HibernateEventListener"/> <listener class="org.hibernate.lucene.event.LuceneEventListener"/> </event> <event type="post-commit-delete"> <listener class="com.fcl.util.HibernateEventListener"/> <listener class="org.hibernate.lucene.event.LuceneEventListener"/> </event> My own code is in com.fcl.util.HibernateEventListener. The 3 post-whatever events are being fired, and I can see my Lucene indices. My event listener, the com.fcl.util.HibernateEventListener is not called. After some investigation, I put debug statements to display a stack trace into org.hibernate.event.EventListeners.setPreUpdateEventListeners(PreUpdateEventListener[] preUpdateEventListener) From this, I discovered that the configuration setup on app deployment is configuring the SessionFactory twice. 16:54:16,015 INFO [Configuration] configuring from resource: hibernate_config.xml 16:54:16,015 INFO [Configuration] Configuration resource: hibernate_config.xml 16:54:16,031 INFO [STDOUT] java.lang.Exception: Setting PreUpdateEventListeners 16:54:16,031 INFO [STDOUT] at org.hibernate.event.EventListeners.setPreUpdateEventListeners(EventListeners.java:418) 16:54:16,031 INFO [STDOUT] at org.hibernate.cfg.Configuration.setListeners(Configuration.java:1661) 16:54:16,031 INFO [STDOUT] at org.hibernate.cfg.Configuration.setListeners(Configuration.java:1493) 16:54:16,031 INFO [STDOUT] at org.hibernate.cfg.Configuration.parseEvent(Configuration.java:1469) 16:54:16,031 INFO [STDOUT] at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1401) 16:54:16,031 INFO [STDOUT] at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1363) 16:54:16,031 INFO [STDOUT] at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1339) 16:54:16,031 INFO [STDOUT] at org.hibernate.cfg.Configuration.configure(Configuration.java:1259) 16:54:16,031 INFO [STDOUT] at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:378) 16:54:16,031 INFO [STDOUT] at org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:20 2) 16:54:16,062 INFO [STDOUT] at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.j ava:78) 16:54:16,062 INFO [STDOUT] at org.jboss.ejb3.Ejb3Deployment.initializeManagedEntityManagerFactory(Ejb3Deployment.java:512) 16:54:16,062 INFO [STDOUT] at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:253) 16:54:16,062 INFO [STDOUT] at org.jboss.ejb3.Ejb3JmxDeployment.create(Ejb3JmxDeployment.java:230) 16:54:16,062 INFO [STDOUT] at org.jboss.ejb3.Ejb3Module.createService(Ejb3Module.java:34) and then, a few milliseconds later: 16:54:16,171 INFO [STDOUT] java.lang.Exception: Setting PreUpdateEventListeners 16:54:16,171 INFO [STDOUT] at org.hibernate.event.EventListeners.setPreUpdateEventListeners(EventListeners.java:418) 16:54:16,171 INFO [STDOUT] at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:124) 16:54:16,171 INFO [STDOUT] at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:473) 16:54:16,171 INFO [STDOUT] at org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:20 2) 16:54:16,171 INFO [STDOUT] at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.j ava:78) 16:54:16,171 INFO [STDOUT] at org.jboss.ejb3.Ejb3Deployment.initializeManagedEntityManagerFactory(Ejb3Deployment.java:512) 16:54:16,171 INFO [STDOUT] at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:253) 16:54:16,171 INFO [STDOUT] at org.jboss.ejb3.Ejb3JmxDeployment.create(Ejb3JmxDeployment.java:230) 16:54:16,171 INFO [STDOUT] at org.jboss.ejb3.Ejb3Module.createService(Ejb3Module.java:34) 16:54:16,171 INFO [STDOUT] at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:245) 16:54:16,171 INFO [STDOUT] at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:228) 16:54:16,171 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 16:54:16,171 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 16:54:16,171 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 16:54:16,171 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585) 16:54:16,171 INFO [STDOUT] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141) 16:54:16,171 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80) 16:54:16,171 INFO [STDOUT] at org.jboss.mx.server.Invocation.invoke(Invocation.java:72) 16:54:16,171 INFO [STDOUT] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245) 16:54:16,171 INFO [STDOUT] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644) 16:54:16,171 INFO [STDOUT] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943) It's configuring once from my XML configuration file, and then it does its own configuration where it sets the pre update listener to be a org.hibernate.validator.event.ValidateEventListener The problem is that the org.hibernate.event.EventListeners class only has a method for [b]setting the entire stack[/b] of listeners. OK, you can get the array, create a new one, copy the old one, add yours, and set it, but the org.hibernate.ejb.EventListenerConfigurator doesn't do that, it just uses what's available and stomps over user-specified listeners. Surely, like most event handling patterns there should be an addBlahEventListener() call in org.hibernate.event.EventListeners? Either that or org.hibernate.ejb.EventListenerConfigurator should get the handler array, copy it to a new array, and [b]add[/b] it's own listener at the start or end of the array. I have attached the necessary files in zip archives. You will need to get the provided org.hibernate.event.EventListeners class (with the stacktrace display) into the classpath ahead of the original one, so put aamyhibernate.jar into the server/default/lib directory and restart. You don't event need an actual entity bean to see this, just deploy testcase.par. This just displays a stack trace whenever PostUpdateEventListeners are set. I've just deployed it, and it displays the stack trace [b]three times![/b]
    via by Nigel White,
    • java.lang.Exception: Setting PreUpdateEventListeners at org.hibernate.event.EventListeners.setPreUpdateEventListeners(EventListeners.java:418) at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:124) at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:473) at org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:202) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:78) at org.jboss.ejb3.Ejb3Deployment.initializeManagedEntityManagerFactory(Ejb3Deployment.java:512) at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:253) at org.jboss.ejb3.Ejb3JmxDeployment.create(Ejb3JmxDeployment.java:230) at org.jboss.ejb3.Ejb3Module.createService(Ejb3Module.java:34) at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:245) at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:228) 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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80) at org.jboss.mx.server.Invocation.invoke(Invocation.java:72) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644) at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943)
    No Bugmate found.