openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From artaxerxe <mapand...@gmail.com>
Subject Problems with OpenJPA when deploying in Apache Servicemix and Spring. (OSGi environment)
Date Tue, 15 Jul 2014 11:39:32 GMT
Hello everyone. For a time I'm striving with a problem that I have with
OpenJPA. I'm trying to deploy my bundle that contains OpenJPA entities in an
OSGi compliant server, namely Apache Servicemix. I'm accessing the OpenJPA
entities using Spring. The problem is that when I make the deployment for my
bundle, I get this error:

openjpa.Runtime - An error occurred while registering a ClassTransformer
with PersistenceUnitInfo: name 'openjpa-test', root URL [bundle://240.0:1].
The error is logged along with this warning. Load-time class transformation
will not be available.<openjpa-2.3.0-r422266:1540826 nonfatal general error>
org.apache.openjpa.util.GeneralException: Resource does not exist:
bundle://240.0:1
	at
org.apache.openjpa.meta.AbstractCFMetaDataFactory.getPersistentTypeNames(AbstractCFMetaDataFactory.java:635)
	at
org.apache.openjpa.meta.MetaDataRepository.getPersistentTypeNamesInternal(MetaDataRepository.java:1478)
	at
org.apache.openjpa.meta.MetaDataRepository.getPersistentTypeNames(MetaDataRepository.java:1470)
	at
org.apache.openjpa.enhance.PCClassFileTransformer.<init>(PCClassFileTransformer.java:103)
	at
org.apache.openjpa.enhance.PCClassFileTransformer.<init>(PCClassFileTransformer.java:67)
	at
org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerImpl.<init>(PersistenceProviderImpl.java:284)
	at
org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerImpl.<init>(PersistenceProviderImpl.java:266)
	at
org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:169)
	at
org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:62)
	at
org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:288)
	at
org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
	at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
	at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
	at
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1117)
	at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:922)
	at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)
	at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
	at
org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
	at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
	at
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
	at java.lang.Thread.run(Thread.java:744)
Caused by: java.io.IOException: Resource does not exist: bundle://240.0:1
	at
org.apache.felix.framework.URLHandlersBundleURLConnection.<init>(URLHandlersBundleURLConnection.java:60)
	at
org.apache.felix.framework.URLHandlersBundleStreamHandler.openConnection(URLHandlersBundleStreamHandler.java:64)
	at java.net.URL.openConnection(URL.java:971)
	at java.net.URL.openStream(URL.java:1037)
	at
org.apache.openjpa.lib.util.J2DoPrivHelper$43.run(J2DoPrivHelper.java:946)
	at
org.apache.openjpa.lib.util.J2DoPrivHelper$43.run(J2DoPrivHelper.java:944)
	at java.security.AccessController.doPrivileged(Native Method)
	at
org.apache.openjpa.meta.AbstractCFMetaDataFactory.parsePersistentTypeNames(AbstractCFMetaDataFactory.java:769)
	at
org.apache.openjpa.meta.AbstractCFMetaDataFactory.getPersistentTypeNames(AbstractCFMetaDataFactory.java:623)
	... 26 more

 
here is how I configured the EntityManagerFactory in my spring config file:

    <bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="persistenceUnitName" value="openjpa-test" />
        <property name="jpaVendorAdapter" ref="jpaAdapter" />
        <property name="loadTimeWeaver">
            <bean
class="org.springframework.instrument.classloading.SimpleLoadTimeWeaver" />
        </property>
        <property name="dataSource" ref="dataSource" />
        <property name="jpaProperties">
            <map>
                <entry key="openjpa.Log" value="DefaultLevel=TRACE,
Tool=INFO" />
                <entry key="openjpa.jdbc.SynchronizeMappings"
value="validate"/>
            </map>
        </property>
    </bean>

Can anybody help me to solve my issue?



--
View this message in context: http://openjpa.208410.n2.nabble.com/Problems-with-OpenJPA-when-deploying-in-Apache-Servicemix-and-Spring-OSGi-environment-tp7586952.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message