commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Flavio Donzé (JIRA) <j...@apache.org>
Subject [jira] [Commented] (DBCP-445) java.lang.NoClassDefFoundError: javax/transaction/SystemException after update
Date Tue, 18 Aug 2015 17:07:47 GMT

    [ https://issues.apache.org/jira/browse/DBCP-445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14701608#comment-14701608
] 

Flavio Donzé commented on DBCP-445:
-----------------------------------

I thought maybe SystemException is only used by 2.1.1, but both versions have a dependency
in TransactionContext and TransactionRegistry.

Is there a possibility that there is a use case where those two classes were not used in 2.0.1
and are used in 2.1.1?

> java.lang.NoClassDefFoundError: javax/transaction/SystemException after update
> ------------------------------------------------------------------------------
>
>                 Key: DBCP-445
>                 URL: https://issues.apache.org/jira/browse/DBCP-445
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: java 8, OSGi
>            Reporter: Flavio Donzé
>
> Updating dbcp in my OSGi application, from 2.0.1 to 2.1.1 I now get the following exception:
> ...
> Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'dataSource': FactoryBean threw exception on object creation; nested exception is
java.lang.NoClassDefFoundError: javax/transaction/SystemException
> 	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:175)
~[org.apache.servicemix.bundles.spring-beans-4.2.0.RELEASE_1.jar:na]
> 	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103)
~[org.apache.servicemix.bundles.spring-beans-4.2.0.RELEASE_1.jar:na]
> 	at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1574)
~[org.apache.servicemix.bundles.spring-beans-4.2.0.RELEASE_1.jar:na]
> 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:316)
~[org.apache.servicemix.bundles.spring-beans-4.2.0.RELEASE_1.jar:na]
> 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
~[org.apache.servicemix.bundles.spring-beans-4.2.0.RELEASE_1.jar:na]
> 	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
~[org.apache.servicemix.bundles.spring-beans-4.2.0.RELEASE_1.jar:na]
> 	... 72 common frames omitted
> Caused by: java.lang.NoClassDefFoundError: javax/transaction/SystemException
> 	at org.apache.commons.dbcp2.managed.LocalXAConnectionFactory.<init>(LocalXAConnectionFactory.java:57)
~[na:na]
> 	at org.apache.commons.dbcp2.managed.BasicManagedDataSource.createConnectionFactory(BasicManagedDataSource.java:139)
~[na:na]
> 	at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2033)
~[na:na]
> 	at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533)
~[na:na]
> 	at com.softmodeler.server.persistence.BasicManagedDataSourceFactory.getBasicManagedDataSource(BasicManagedDataSourceFactory.java:115)
~[na:na]
> 	at com.softmodeler.server.persistence.BasicManagedDataSourceFactory.getObject(BasicManagedDataSourceFactory.java:331)
~[na:na]
> 	at com.softmodeler.server.persistence.BasicManagedDataSourceFactory.getObject(BasicManagedDataSourceFactory.java:1)
~[na:na]
> 	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168)
~[org.apache.servicemix.bundles.spring-beans-4.2.0.RELEASE_1.jar:na]
> 	... 77 common frames omitted
> Caused by: java.lang.ClassNotFoundException: javax.transaction.SystemException cannot
be found by org.apache.commons.dbcp2_2.1.1
> 	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:389)
[org.eclipse.osgi_3.10.100.v20150529-1857.jar:na]
> 	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:352) [org.eclipse.osgi_3.10.100.v20150529-1857.jar:na]
> 	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:344) [org.eclipse.osgi_3.10.100.v20150529-1857.jar:na]
> 	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
[org.eclipse.osgi_3.10.100.v20150529-1857.jar:na]
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) [na:1.8.0_51]
> 	... 85 common frames omitted
> In my environment I have javax.transaction 1.2, I suspected that since there is no version
declared in the Manifest.MF, the JRE package "javax.transaction" is used. 
> Where there is no SystemException.
> So changing the Manifest.MF from  
>  javax.transaction,
>  javax.transaction.xa
> to
>  javax.transaction;version="1.1.0",
>  javax.transaction.xa;version="1.1.0",
> solves the issue.
> Setting it to version 1.1.0 instead of 1.2.0 since there is no sign that 1.2.0 is required.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message