Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo] Errors when deploying teneo 2.0.1 + hibernate 4 in JBoss 7
[Teneo] Errors when deploying teneo 2.0.1 + hibernate 4 in JBoss 7 [message #1011600] Tue, 19 February 2013 21:54 Go to next message
Pablo Zamudio is currently offline Pablo ZamudioFriend
Messages: 6
Registered: March 2012
Junior Member
Hi. We are trying to migrate an application that works with teneo 1.2 + hibernate 3.6 over JBoss6 to JBoss 7, also upgrading versions of teneo and hibernate.
Currently we are trying to use:
- JBoss 7.1.1
- Teneo 2.0.1
- Hibernate 4.1.9

First problems occurred trying to initialize HBDataStore, it throws the next exception:

16:42:36,061 ERROR [ejb.PersistenceManagerBean] (MSC service thread 1-7) Error initializing Teneo HbDataStore.: org.eclipse.emf.teneo.classloader.StoreClassLoadException: Class for name exception
at org.eclipse.emf.teneo.classloader.ClassLoaderResolver.classForName(ClassLoaderResolver.java:52)
at org.eclipse.emf.teneo.extension.DefaultExtensionManager.getExtension(DefaultExtensionManager.java:129)
at org.eclipse.emf.teneo.extension.DefaultExtensionManager.getExtension(DefaultExtensionManager.java:269)
at org.eclipse.emf.teneo.hibernate.HbDataStore.setDataStoreProperties(HbDataStore.java:519)
at ejb.PersistenceManagerBean.<clinit>(PersistenceManagerBean.java:64)
at java.lang.Class.forName0(Native Method) [rt.jar:1.6.0_33]
at java.lang.Class.forName(Unknown Source) [rt.jar:1.6.0_33]
at org.jboss.invocation.proxy.AbstractProxyFactory.afterClassLoad(AbstractProxyFactory.java:94) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.proxy.AbstractClassFactory.defineClass(AbstractClassFactory.java:166) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.proxy.AbstractProxyFactory.getCachedMethods(AbstractProxyFactory.java:145) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.component.singleton.SingletonComponentDescription$4.configure(SingletonComponentDescription.java:183)
at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:921)
at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_33]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_33]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_33]
Caused by: java.lang.ClassNotFoundException: org.eclipse.emf.teneo.PersistenceOptions from [Module "org.jboss.as.server:main" from local module loader @d507e9 (roots: D:\desa\jboss-as-7.1.1.Final\modules)]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]
at java.lang.Class.forName0(Native Method) [rt.jar:1.6.0_33]
at java.lang.Class.forName(Unknown Source) [rt.jar:1.6.0_33]
at org.eclipse.emf.teneo.classloader.ClassLoaderResolver.classForName(ClassLoaderResolver.java:50)
... 18 more

The error seems to be related to how classloading is managed in JBoss7. To workaround this exception, we tried to set another classloader strategy, as specified here: http://wiki.eclipse.org/Teneo/Hibernate/EMF_Hibernate_Integration_Details#Classloader. We implement a simple classloading strategy that takes current class classloader:

public class CustomClassLoaderStrategy implements ClassLoaderStrategy {
@Override
public ClassLoader getClassLoader() {
return this.getClass().getClassLoader();
}
}

This workaround makes the initialization of datastore to work correctly, but then when we try to retrieve data from the datastore, we get another exception, related to econtainer management of teneo (a NPE in EContainerFeatureIDHolder):

19:41:40,521 ERROR [org.jboss.ejb3.invocation] (EJB default - 3) JBAS014134: EJB Invocation failed on component PersistenceManagerBean for method public abstract java.util.List test.teneo.jboss7.ejb.PersistenceManagerRemote.getAs(): javax.ejb.EJBException: java.lang.NullPointerException
at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:166) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:230) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.remote.EJBRemoteTransactionPropagatingInterceptor.processInvocation(EJBRemoteTransactionPropagatingInterceptor.java:80) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:43) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.invokeMethod(MethodInvocationMessageHandler.java:302) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$200(MethodInvocationMessageHandler.java:64) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:196) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.6.0_33]
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) [rt.jar:1.6.0_33]
at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.6.0_33]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_33]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_33]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_33]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.NullPointerException
at org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerFeatureIDUserType$EContainerFeatureIDHolder.convertFromString(EContainerFeatureIDUserType.java:167) [org.eclipse.emf.teneo.hibernate-2.0.1-v201301151903.jar:]
at org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerFeatureIDUserType.nullSafeGet(EContainerFeatureIDUserType.java:118) [org.eclipse.emf.teneo.hibernate-2.0.1-v201301151903.jar:]
at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:124) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.type.AbstractType.hydrate(AbstractType.java:106) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2702) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1541) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1473) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.loader.Loader.getRow(Loader.java:1373) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:640) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.loader.Loader.doQuery(Loader.java:850) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.loader.Loader.loadCollection(Loader.java:2159) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:61) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:622) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:82) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:1718) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:379) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:112) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:137) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.collection.internal.PersistentList.size(PersistentList.java:114) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
at org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersistableEList.delegateSize(HibernatePersistableEList.java:516) [org.eclipse.emf.teneo.hibernate-2.0.1-v201301151903.jar:]
at org.eclipse.emf.common.util.DelegatingEList.size(DelegatingEList.java:58) [org.eclipse.emf.common-2.8.0-v20120911-0500.jar:]
at test.teneo.jboss7.ejb.PersistenceManagerBean.getAs(PersistenceManagerBean.java:91) [teneo.jboss7-ejb-0.0.1-SNAPSHOT.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_33]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.6.0_33]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.6.0_33]
at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.6.0_33]
at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:127) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:135) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.concurrency.ContainerManagedConcurrencyInterceptor.processInvocation(ContainerManagedConcurrencyInterceptor.java:104) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:101) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.component.singleton.SingletonComponentInstanceAssociationInterceptor.processInvocation(SingletonComponentInstanceAssociationInterceptor.java:53) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
... 27 more

I attach a simple enterprise application with an EJB that instantiates HBDataStore and exposes some methods to get instances of an EMF object from a simple model included (just to entities A <>------> B), and a test class that calls the EJB services, triggering the NPE.

Any ideas of what we are doing wrong, maybe some wrong configurations?
Thanks in advance.
Pablo
Re: [Teneo] Errors when deploying teneo 2.0.1 + hibernate 4 in JBoss 7 [message #1011633 is a reply to message #1011600] Tue, 19 February 2013 23:40 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Pablo,
The NPE occurs because an epackage can not be found in the EPackage registry. Can you put a breakpoint at the NPE location:
org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerFeatureIDUserType$EContainerFeatureIDHolder.convertFromString(EContainerFeatureIDUserType.java:167)
[org.eclipse.emf.teneo.hibernate-2.0.1-v201301151903.jar:]

The epackage retrieval (using the nsuri) happens a few lines before the NPE location. The package registry being used is
retrieved from the PackageRegistryProvider class.

Can you see/check if there is anything special with the epackage which is being searched for? Or if the registry being
used in the User type is empty or something?

gr. Martin

On 02/19/2013 10:54 PM, Pablo Zamudio wrote:
> Hi. We are trying to migrate an application that works with teneo 1.2 + hibernate 3.6 over JBoss6 to JBoss 7, also upgrading versions of teneo and hibernate.
> Currently we are trying to use:
> - JBoss 7.1.1
> - Teneo 2.0.1
> - Hibernate 4.1.9
>
> First problems occurred trying to initialize HBDataStore, it throws the next exception:
>
> 16:42:36,061 ERROR [ejb.PersistenceManagerBean] (MSC service thread 1-7) Error initializing Teneo HbDataStore.: org.eclipse.emf.teneo.classloader.StoreClassLoadException: Class for name exception
> at org.eclipse.emf.teneo.classloader.ClassLoaderResolver.classForName(ClassLoaderResolver.java:52)
> at org.eclipse.emf.teneo.extension.DefaultExtensionManager.getExtension(DefaultExtensionManager.java:129)
> at org.eclipse.emf.teneo.extension.DefaultExtensionManager.getExtension(DefaultExtensionManager.java:269)
> at org.eclipse.emf.teneo.hibernate.HbDataStore.setDataStoreProperties(HbDataStore.java:519)
> at ejb.PersistenceManagerBean.<clinit>(PersistenceManagerBean.java:64)
> at java.lang.Class.forName0(Native Method) [rt.jar:1.6.0_33]
> at java.lang.Class.forName(Unknown Source) [rt.jar:1.6.0_33]
> at org.jboss.invocation.proxy.AbstractProxyFactory.afterClassLoad(AbstractProxyFactory.java:94) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.invocation.proxy.AbstractClassFactory.defineClass(AbstractClassFactory.java:166) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.invocation.proxy.AbstractProxyFactory.getCachedMethods(AbstractProxyFactory.java:145) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ejb3.component.singleton.SingletonComponentDescription$4.configure(SingletonComponentDescription.java:183)
> at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:921)
> at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81)
> at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_33]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_33]
> at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_33]
> Caused by: java.lang.ClassNotFoundException: org.eclipse.emf.teneo.PersistenceOptions from [Module "org.jboss.as.server:main" from local module loader @d507e9 (roots: D:\desa\jboss-as-7.1.1.Final\modules)]
> at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
> at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
> at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]
> at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) [jboss-modules.jar:1.1.1.GA]
> at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]
> at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]
> at java.lang.Class.forName0(Native Method) [rt.jar:1.6.0_33]
> at java.lang.Class.forName(Unknown Source) [rt.jar:1.6.0_33]
> at org.eclipse.emf.teneo.classloader.ClassLoaderResolver.classForName(ClassLoaderResolver.java:50)
> ... 18 more
>
> The error seems to be related to how classloading is managed in JBoss7. To workaround this exception, we tried to set another classloader strategy, as specified here: http://wiki.eclipse.org/Teneo/Hibernate/EMF_Hibernate_Integration_Details#Classloader. We implement a simple classloading strategy that takes current class classloader:
>
> public class CustomClassLoaderStrategy implements ClassLoaderStrategy {
> @Override
> public ClassLoader getClassLoader() {
> return this.getClass().getClassLoader();
> }
> }
>
> This workaround makes the initialization of datastore to work correctly, but then when we try to retrieve data from the datastore, we get another exception, related to econtainer management of teneo (a NPE in EContainerFeatureIDHolder):
>
> 19:41:40,521 ERROR [org.jboss.ejb3.invocation] (EJB default - 3) JBAS014134: EJB Invocation failed on component PersistenceManagerBean for method public abstract java.util.List test.teneo.jboss7.ejb.PersistenceManagerRemote.getAs(): javax.ejb.EJBException: java.lang.NullPointerException
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:166) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:230) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ejb3.remote.EJBRemoteTransactionPropagatingInterceptor.processInvocation(EJBRemoteTransactionPropagatingInterceptor.java:80) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:43) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.invokeMethod(MethodInvocationMessageHandler.java:302) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$200(MethodInvocationMessageHandler.java:64) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:196) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
> at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.6.0_33]
> at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) [rt.jar:1.6.0_33]
> at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.6.0_33]
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_33]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_33]
> at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_33]
> at org.jboss.threads.JBossThread.run(JBossThread.java:122)
> Caused by: java.lang.NullPointerException
> at org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerFeatureIDUserType$EContainerFeatureIDHolder.convertFromString(EContainerFeatureIDUserType.java:167) [org.eclipse.emf.teneo.hibernate-2.0.1-v201301151903.jar:]
> at org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerFeatureIDUserType.nullSafeGet(EContainerFeatureIDUserType.java:118) [org.eclipse.emf.teneo.hibernate-2.0.1-v201301151903.jar:]
> at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:124) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
> at org.hibernate.type.AbstractType.hydrate(AbstractType.java:106) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
> at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2702) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
> at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1541) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
> at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1473) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
> at org.hibernate.loader.Loader.getRow(Loader.java:1373) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
> at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:640) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
> at org.hibernate.loader.Loader.doQuery(Loader.java:850) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
> at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
> at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
> at org.hibernate.loader.Loader.loadCollection(Loader.java:2159) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
> at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:61) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
> at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:622) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
> at org.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:82) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
> at org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:1718) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
> at org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:379) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
> at org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:112) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
> at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:137) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
> at org.hibernate.collection.internal.PersistentList.size(PersistentList.java:114) [hibernate-core-4.1.1.Final.jar:4.1.1.Final]
> at org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersistableEList.delegateSize(HibernatePersistableEList.java:516) [org.eclipse.emf.teneo.hibernate-2.0.1-v201301151903.jar:]
> at org.eclipse.emf.common.util.DelegatingEList.size(DelegatingEList.java:58) [org.eclipse.emf.common-2.8.0-v20120911-0500.jar:]
> at test.teneo.jboss7.ejb.PersistenceManagerBean.getAs(PersistenceManagerBean.java:91) [teneo.jboss7-ejb-0.0.1-SNAPSHOT.jar:]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_33]
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.6.0_33]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.6.0_33]
> at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.6.0_33]
> at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:127) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:135) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ejb3.concurrency.ContainerManagedConcurrencyInterceptor.processInvocation(ContainerManagedConcurrencyInterceptor.java:104) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:101) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ejb3.component.singleton.SingletonComponentInstanceAssociationInterceptor.processInvocation(SingletonComponentInstanceAssociationInterceptor.java:53) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
> ... 27 more
>
> I attach a simple enterprise application with an EJB that instantiates HBDataStore and exposes some methods to get instances of an EMF object from a simple model included (just to entities A <>------> B), and a test class that calls the EJB services, triggering the NPE.
>
> Any ideas of what we are doing wrong, maybe some wrong configurations?
> Thanks in advance.
> Pablo
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Errors when deploying teneo 2.0.1 + hibernate 4 in JBoss 7 [message #1011928 is a reply to message #1011633] Wed, 20 February 2013 14:27 Go to previous messageGo to next message
Pablo Zamudio is currently offline Pablo ZamudioFriend
Messages: 6
Registered: March 2012
Junior Member
Hi, i add the debug data:
nsuri = "model/1.0" (with http://)
eContainerPackage = null
eContainerEClassName = "A"
packageRegistry asociated to context thread is empty

We initialize HbDatastore when we initialize a singleton ejb that manages access to teneo. This initialization is done in the context of the main classloader of the server, so the packages are initialized associated to this classloader. When we call a method over the ejb, the context classloader is different (classloader of the EJB module directly), so it has no packages registered. Is there any way to make teneo take the first context, instead of the current context? If this isn´t possible, how can we make package registration available always?

Thanks in advance,
Pablo
Re: [Teneo] Errors when deploying teneo 2.0.1 + hibernate 4 in JBoss 7 [message #1011947 is a reply to message #1011928] Wed, 20 February 2013 15:12 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Pablo,
You can control the Package Registry which is being used through the PackageRegistryProvider so you can set a specific
package registry to be used by your thread (check the api on the PackageRegistryProvider), can you see if that helps?

gr. Martin

On 02/20/2013 03:27 PM, Pablo Zamudio wrote:
> Hi, i add the debug data:
> nsuri = "model/1.0" (with http://)
> eContainerPackage = null
> eContainerEClassName = "A"
> packageRegistry asociated to context thread is empty
>
> We initialize HbDatastore when we initialize a singleton ejb that manages access to teneo. This initialization is done
> in the context of the main classloader of the server, so the packages are initialized associated to this classloader.
> When we call a method over the ejb, the context classloader is different (classloader of the EJB module directly), so it
> has no packages registered. Is there any way to make teneo take the first context, instead of the current context? If
> this isn´t possible, how can we make package registration available always?
>
> Thanks in advance,
> Pablo


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Errors when deploying teneo 2.0.1 + hibernate 4 in JBoss 7 [message #1012020 is a reply to message #1011947] Wed, 20 February 2013 17:58 Go to previous messageGo to next message
Pablo Zamudio is currently offline Pablo ZamudioFriend
Messages: 6
Registered: March 2012
Junior Member
You are right! Setting a simple PackageRegistryImpl as the packageRegistry of PackageRegistryProvider works just fine. The only thing we need to do is to configure the packageRegistry with the EPackages that we are going to support in the datastore, which with the default impl gets done automatically (i guess when the datastore is initialized). Is there any way to avoid setting the packages to support in the instance of package registry and then include them on the datastore also (to avoid setting almost the same twice)?.

What we don now is:

Properties propsTeneo = new Properties();
propsTeneo.load(is);

// build package registry and set it in provider
EPackage.Registry packageRegistry = new EPackageRegistryImpl();
packageRegistry.put(ModelPackage.eINSTANCE.getNsURI(), ModelPackage.eINSTANCE);

PackageRegistryProvider.getInstance().setPackageRegistry(packageRegistry);

// workaround to fix 1st error when instantiating datastore
ClassLoaderResolver.setClassLoaderStrategy(new ClassClassLoaderStrategy());

dataStore = HbHelper.INSTANCE.createRegisterDataStore("ModelDataStore");
dataStore.setDataStoreProperties(propsTeneo);

// set the packages to support (again repeating emf packages we use)
dataStore.setEPackages(new EPackage[] { ModelPackage.eINSTANCE });

dataStore.initialize();


Thanks for the tips!
Pablo
Re: [Teneo] Errors when deploying teneo 2.0.1 + hibernate 4 in JBoss 7 [message #1012049 is a reply to message #1012020] Wed, 20 February 2013 19:36 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Pablo,
Currently there is no other way to do this, I can change this in the datastore implementation but I rather not change
this. If it works fine for you in this way it seems to be good/okay enough.

gr. Martin

On 02/20/2013 06:58 PM, Pablo Zamudio wrote:
> You are right! Setting a simple PackageRegistryImpl as the packageRegistry of PackageRegistryProvider works just fine.
> The only thing we need to do is to configure the packageRegistry with the EPackages that we are going to support in the
> datastore, which with the default impl gets done automatically (i guess when the datastore is initialized). Is there any
> way to avoid setting the packages to support in the instance of package registry and then include them on the datastore
> also (to avoid setting almost the same twice)?.
>
> What we don now is:
>
>
> Properties propsTeneo = new Properties();
> propsTeneo.load(is);
>
> // build package registry and set it in provider
> EPackage.Registry packageRegistry = new EPackageRegistryImpl();
> packageRegistry.put(ModelPackage.eINSTANCE.getNsURI(), ModelPackage.eINSTANCE);
>
> PackageRegistryProvider.getInstance().setPackageRegistry(packageRegistry);
>
> // workaround to fix 1st error when instantiating datastore
> ClassLoaderResolver.setClassLoaderStrategy(new ClassClassLoaderStrategy());
>
> dataStore = HbHelper.INSTANCE.createRegisterDataStore("ModelDataStore");
> dataStore.setDataStoreProperties(propsTeneo);
>
> // set the packages to support (again repeating emf packages we use)
> dataStore.setEPackages(new EPackage[] { ModelPackage.eINSTANCE });
>
> dataStore.initialize();
>
>
> Thanks for the tips!
> Pablo


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Previous Topic:Proper way to update UI from EContentAdapter
Next Topic:EMF 2.9 and RAP 1.5
Goto Forum:
  


Current Time: Tue Mar 19 10:18:16 GMT 2024

Powered by FUDForum. Page generated in 0.02372 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top