[EJB3] - Transaction problems, possible bug in ApplicationExceptionComponentMetaDataLoaderFactory
by Benoit Heinrich
Benoit Heinrich [http://community.jboss.org/people/benoit.heinrich] created the discussion
"Transaction problems, possible bug in ApplicationExceptionComponentMetaDataLoaderFactory"
To view the discussion, visit: http://community.jboss.org/message/599161#599161
--------------------------------------------------------------
Hi All,
I think I've found a possible bug with transaction attributes management in jboss 6.0.0 Final.
The problem appears when using the @TransactionAttribute annotation on an EJB bean with the @Interceptors.
When using that it seems that the @TransactionAttribute annotation is ignored.
By removing the @Interceptors annotation it works and the right transaction attribute is used.
After doing some debugging, I think I've finally found the problem in jboss-ejb3-transactions module in the ApplicationExceptionComponentMetaDataLoaderFactory class.
I think the bug is around the createComponentMetaDataRetrieval() method where it searches for the *ApplicationExceptionMetaData appExMetaData*, but then it checks if the *metaData* exists instead of checking for the *appExMetaData*.
public MetaDataRetrieval createComponentMetaDataRetrieval(JBossEnterpriseBeanMetaData metaData, Signature signature,
ScopeKey key, ClassLoader classLoader)
{
if(signature instanceof ClassSignature)
{
ApplicationExceptionMetaData appExMetaData = findApplicationException(metaData, signature.getName());
if(metaData != null)
return new BridgedMetaDataLoader<ApplicationExceptionMetaData>(key, appExMetaData, classLoader, defaultBridges);
}
return null;
}
So then, as the metaData here is always no-null, it then always fallback to a this MetaDataRetrieval instance which in the end doesn't read the TransactionAttribute properly and so, ignores the attribute type.
I'm wondering what other impacts this could have.
If someone can verify that this is the actual problem, I'll be happy to test the bug fix.
Meanwhile I'll get latest from svn and make the change locally and try it. So I can also confirm that it works.
btw - I've not been able to reproduce with a simple test case and this is happening in a very large project that I can't easily extract the code from.
fyi - I'm using jboss-seam 2.2.1.Final in this project, and I'm wondering if this can also be a lead for reproducing that problem.
Let me know if I should open a Jira for that.
Cheers,
/Benoit
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/599161#599161]
Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 9 months
[jBPM] - Drools persistence + Websphere 7 + DB2
by Philippe Goncalves
Philippe Goncalves [http://community.jboss.org/people/filipon] created the discussion
"Drools persistence + Websphere 7 + DB2"
To view the discussion, visit: http://community.jboss.org/message/599266#599266
--------------------------------------------------------------
Hi everyone,
I'm trying to get the persistence of drools flow working in a Websphere 7 + DB2 environment:
- If I run a simple workflow that runs without any wait state, it's ok, I have no errors. SessionInfo is well persisted.
- If I run a workflow with a wait state (First launch well persisted), after completing this wait state and before finishing the workflow, I have an error at line 41 of class JPAWorkItemManager:
((WorkItemImpl) workItem).setId(workItemInfo.getId()); // -> Nullpointer exception because of the the null returned by workItemInfo.getId()
- If I run a workflow running (For example one with a wait state) and if I try to run another workflow in parallel, I have an error at line 141 of class SingleSessionCommandService:
((InternalKnowledgeRuntime) ksession).setId( this.sessionInfo.getId() ); // -> Nullpointer exception because of the the null returned by this.sessionInfo.getId()
After invesgating, it seems that I have a problem once the database is locked by a process, the persists methods from drools don't work anymore for the autogenerated columns of the tables, and then I have problems with tables SessionInfo, WorkItemInfo, etc.
About the way I instantiate the environment variable for the persistence, I make it singleton:
...
public static Environment getEnvironment() {
if (environment == null) {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("testWorkflow");
environment = KnowledgeBaseFactory.newEnvironment();
environment.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
}
return environment;
}
...
Here is my persistence.xml:
<persistence xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
xmlns=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence"
xsi:schemaLocation=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
version="1.0">
<persistence-unit name="testWorkflow" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/testWorkflow</jta-data-source>
<class>org.drools.persistence.info.SessionInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceEventInfo</class>
<class>org.drools.persistence.info.WorkItemInfo</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.DB2Dialect" />
<property name="hibernate.max_fetch_depth" value="5" />
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="show_sql" value="true" />
</properties>
</persistence-unit>
</persistence>
Thanks for your help!
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/599266#599266]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 9 months
[JBoss Messaging] - HornetQ can't resolve class of ObjectMessage payload.
by Kevin Healy
Kevin Healy [http://community.jboss.org/people/kjh21] created the discussion
"HornetQ can't resolve class of ObjectMessage payload."
To view the discussion, visit: http://community.jboss.org/message/599052#599052
--------------------------------------------------------------
Following is my environment
JBossAS [6.0.0.Final "Neo"]
HornetQ Server version 2.1.2.Final (Colmeia, 120)
I'm getting the same error described here
http://community.jboss.org/message/517604#517604 http://community.jboss.org/message/517604#517604
and here
http://community.jboss.org/thread/162024 http://community.jboss.org/thread/162024
Specifically, HornetQ is unable to resolve the class of an object that serves as the payload of an ObjectMessage.
The exception and stack trace are as follows:
477 SEVERE [toplevel.services.push.ProxyMessageListener] Caught Exception processing incoming message: javax.jms.JMSException: toplevel.services.heartbeat.Heartbeat
01:18:36,477 ERROR [STDERR] javax.jms.JMSException: toplevel.services.heartbeat.Heartbeat
01:18:36,477 ERROR [STDERR] at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
01:18:36,477 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
01:18:36,477 ERROR [STDERR] at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
01:18:36,477 ERROR [STDERR] at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
01:18:36,493 ERROR [STDERR] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
01:18:36,493 ERROR [STDERR] at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
01:18:36,493 ERROR [STDERR] at java.lang.Class.forName0(Native Method)
01:18:36,493 ERROR [STDERR] at java.lang.Class.forName(Class.java:247)
01:18:36,493 ERROR [STDERR] at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:284)
01:18:36,493 ERROR [STDERR] at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1152)
01:18:36,493 ERROR [STDERR] at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:886)
01:18:36,493 ERROR [STDERR] at org.jboss.classloader.spi.base.BaseClassLoader.doLoadClass(BaseClassLoader.java:505)
01:18:36,493 ERROR [STDERR] at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:450)
01:18:36,493 ERROR [STDERR] at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
01:18:36,493 ERROR [STDERR] at java.lang.Class.forName0(Native Method)
01:18:36,493 ERROR [STDERR] at java.lang.Class.forName(Class.java:247)
01:18:36,493 ERROR [STDERR] at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:603)
01:18:36,493 ERROR [STDERR] at org.hornetq.utils.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:69)
01:18:36,493 ERROR [STDERR] at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1574)
01:18:36,493 ERROR [STDERR] at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)
01:18:36,493 ERROR [STDERR] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731)
01:18:36,493 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
01:18:36,493 ERROR [STDERR] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
01:18:36,493 ERROR [STDERR] at org.hornetq.jms.client.HornetQObjectMessage.getObject(HornetQObjectMessage.java:158)
01:18:36,493 ERROR [STDERR] at gov.dhs.st.bordernet.services.push.ProxyMessageListener.onMessage(ProxyMessageListener.java:71)
01:18:36,493 ERROR [STDERR] at org.hornetq.jms.client.JMSMessageListenerWrapper.onMessage(JMSMessageListenerWrapper.java:91)
01:18:36,493 ERROR [STDERR] at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:822)
01:18:36,493 ERROR [STDERR] at org.hornetq.core.client.impl.ClientConsumerImpl.access$100(ClientConsumerImpl.java:46)
01:18:36,493 ERROR [STDERR] at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:940)
01:18:36,493 ERROR [STDERR] at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100)
01:18:36,493 ERROR [STDERR] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
01:18:36,493 ERROR [STDERR] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
01:18:36,493 ERROR [STDERR] at java.lang.Thread.run(Thread.java:662)
HornetQ is able to resolve the class of an ObjectMessage when my receiving client is an MDB but not when it is a client MessageListener that I have deployed as part of a JBoss system service.
Following is a representative view of the package structure of my deployment
my.ear
|
|
|--------> payload-objects.jar
| |
| |--------> class(es) used as payload of ObjectMessage located here (and below.)
|
|--------> my-ejb.jar
| |
| |--------> my-service.xml
| |
| |--------> toplevel
| | |
| | |--------> mdb
| | | |
| | | |--------> MDB's located here (and below.) *HornetQ references to classes in payload-objects.jar resolve fine.*
| | |
| | |--------> services
| | |
| | |--------> Other MessageListeners located here (and below.) *HornetQ references to classes in payload-objects.jar fail!*
|
|--------> my-war.war
|
|--------> WEB-INF
|
|--------> classes
| |
| |--------> no HornetQ MessageListeners here (or below) but other references to classes in payload-objects.jar here (and below) resolve fine.
|
|--------> lib
|
|--------> payload-objects.jar
Please advise.
Kevin H.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/599052#599052]
Start a new discussion in JBoss Messaging at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 9 months