OSGI + Hibernate = javax.transaction problem [message #689372] |
Mon, 27 June 2011 14:24 |
Christian A Messages: 13 Registered: March 2011 |
Junior Member |
|
|
Hi,
i am trying to set up an OSGi application with Spring-Hibernate support.
After a couple of days, i'm able to deploy the bundles completely.
But when i try to run the application and perform an action which attempts to create
an hibernate transaction, i get the following exception:
java.lang.NoClassDefFoundError: javax/transaction/Synchronization
at org.hibernate.impl.SessionImpl.<init>(SessionImpl.java:256)
at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:616)
at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:640)
at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:648)
at org.springframework.orm.hibernate3.SessionFactoryUtils.getNewSession(SessionFactoryUtils.java:522)
at org.springframework.orm.hibernate3.SessionFactoryUtils.getNewSession(SessionFactoryUtils.java:490)
at de.idarewest.backend.service.transaction.TransactionManager.<init>(TransactionManager.java:64)
at de.idarewest.backend.service.UserSession.<init>(UserSession.java:44)
at de.idarewest.backend.service.transaction.UserSessionLifecycle.getUserSession(UserSessionLifecycle.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy18.getUserSession(Unknown Source)
at de.pascada.idarewest.ServiceConnector.getValidUserSession(ServiceConnector.java:32)
at de.pascada.idarewest.rap.LoginHandler.createUserSession(LoginHandler.java:43)
at de.pascada.idarewest.rap.LoginDialog.login(LoginDialog.java:143)
at de.pascada.idarewest.rap.LoginDialog.access$0(LoginDialog.java:134)
at de.pascada.idarewest.rap.LoginDialog$1.handleEvent(LoginDialog.java:95)
at org.eclipse.swt.internal.widgets.UntypedEventAdapter.dispatchEvent(UntypedEventAdapter.java:651)
at org.eclipse.swt.internal.widgets.UntypedEventAdapter.widgetSelected(UntypedEventAdapter.java:88)
at org.eclipse.swt.events.SelectionEvent.dispatchToObserver(SelectionEvent.java:194)
at org.eclipse.rwt.internal.events.Event.processEvent(Event.java:44)
at org.eclipse.swt.events.TypedEvent.processEvent(TypedEvent.java:161)
at org.eclipse.swt.events.TypedEvent.executeNext(TypedEvent.java:201)
at org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1100)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1090)
at de.pascada.idarewest.rap.LoginDialog.open(LoginDialog.java:64)
at de.pascada.idarewest.rap.EntryPoint.createUI(EntryPoint.java:111)
at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createUI(EntryPointManager.java:92)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:245)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:114)
at java.lang.Thread.run(Thread.java:662)
at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:102)
Caused by: java.lang.ClassNotFoundException: javax.transaction.Synchronization
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 50 more
I tried to import the package 'javax.transaction' from an OSGI bundled version of
jta.jar, but i did not work. It seems, that the incomplete stuff from RT is used,
instead of the packages from jta. If i import 'javax.transaction' with version
restrictions, i get the same error and 'javax.transaction' is still taken from RT.
An attempt to add jta as bundle dependency is also not successful. In this case the
deployment fails due to a package use conflict with one of the spring bundles.
After some reading i recognized, that it is a common problem with no common solution.
Is there anything i missed?
Best regards,
Chris
[Updated on: Mon, 27 June 2011 14:25] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03213 seconds