Hello,

is it possible to use Spring @Transactional annotations together 
with ServiceMix lightweight container component?

I am not able to configure my service unit.
The service unit stores some data to a relational database (HSQLDB)
using Hibernate and Spring DAO layer.

If the "servicemix.xml" contains the <tx:annotation-driven> element,
then errors occur during deployment.

(1) 
Firstly, ServiceMix could not find several AOP-related classes from Spring. 
I had to add "spring-aop-2.0.1.jar" and "aopalliance-1.0.jar"
to SERVICEMIX/lib directory.

(2)
During deployment another error occured:

java.lang.ClassNotFoundException: 
org.springframework.transaction.annotation.AnnotationsTransactionAttributeSource
 
in classloader 
org.springframework.transaction.annotation.AnnotationsTransactionAttributeSource

(3)
This looked like a classloader problem, so I tried to reverse the classloader 
order in servicemix.xml:

<classpath inverse="true"/>

(4)
This didn't help either:

org.springframework.beans.factory.BeanDefinitionStoreException: 
Unexpected exception parsing XML document from file [servicemix.xml]; 
nested exception is java.lang.IllegalArgumentException: 
Class [org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler] 
does not implement the NamespaceHandler interface

(5)
It seems that the code contains some class incopatibility - probably a 
classloader issue.
I also put "aspectjrt.jar" and "aspectjweaver.jar" in "SERVICEMIX/lib" but the 
problem still persists.

---

Did anyone manage to combine LWC with annotation driven transactions?

Thanks in advance for help.

mp.

Reply via email to