openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OPENJPA-2521) Cannot load entities from a different bundle in an OSGi environment.
Date Thu, 31 Jul 2014 10:44:43 GMT

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

ASF GitHub Bot commented on OPENJPA-2521:
-----------------------------------------

GitHub user artaxerxe opened a pull request:

    https://github.com/apache/openjpa/pull/1

    OPENJPA-2521 Cannot load entities from a different bundle in an OSGi environment

    Fixed this issue, so that now you can load those entities even in a OSGi context.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/artaxerxe/openjpa 2.3.x

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/openjpa/pull/1.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1
    
----
commit e664d67daa30a59cce88ca903925026d30aa7902
Author: Mura Andrei <andrei.mura@moredevs.ro>
Date:   2014-07-30T13:13:05Z

    OPENJPA-2521 Cannot load entities from a different bundle in an OSGi environment.

----


> Cannot load entities from a different bundle in an OSGi environment.
> --------------------------------------------------------------------
>
>                 Key: OPENJPA-2521
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2521
>             Project: OpenJPA
>          Issue Type: Improvement
>    Affects Versions: 2.3.0, 2.3.1
>         Environment: Apache Servicemix
>            Reporter: Mura Andrei Petru
>             Fix For: 2.3.1
>
>         Attachments: fix_osgi_entities_loading.patch
>
>
> When you integrate the OpenJPA 2.3.0 with Spring and Apache-Camel in an OSGi environment
like Apache Servicemix, you can't load the entities from a different bundle because the path
given for this bundle in OSGi specific. A stack trace is bellow:
> 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 



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message