我被要求将我当前在embeded jetty上运行的应用程序移动到websphere.我使用Hibernate5.0 Spring Java配置,Websphere8.5.5.
我的观察:
Websphere使用JPA2.0而Hibernate 5使用JPA 2.1,我尝试了所有可能的方法告诉websphere使用JPA2.1没有运气
更改类加载器作为父最后2处
应用程序- > WebSphere企业应用程序- >点击应用名称- >类加载器和更新检测- >类加载器与当地的类加载器第一(PARENT_LAST)
应用程序- > WebSphere企业应用程序- >点击申请name-> Manage Modules->点击application_Name.war-> clas loader order为parent_last
Servers-> Websphere application servers-> server Name-> Container services-> Default Persitence Api settings-> org.Hibernate.jpa.HibernatePersistenceProvider
http://www-01.ibm.com/support/docview.wss?uid=swg1PM26361
每次更改后,我重新启动服务器
有没有什么办法,使休眠5和Spring LocalEntityManageFActory与JPA 2.0工作,我试图从休眠-的EntityManager排除JPA 2.1和addeed JPA 2.0,但LocalEntityManageFActory
Caused by: java.lang.ClassNotFoundException: javax.persistence.Converter at java.net.URLClassLoader$1.run(URLClassLoader.java:366) ~[?:1.7.0_79] at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[?:1.7.0_79] at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_79] at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[?:1.7.0_79] at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[?:1.7.0_79] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) ~[?:1.7.0_79] at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[?:1.7.0_79] at org.hibernate.boot.archive.scan.spi.ClassFileArchiveEntryHandler.toClassDescriptor(ClassFileArchiveEntryHandler.java:91) ~[hibernate-core-5.0.1.Final.jar:5.0.1.Final] at org.hibernate.boot.archive.scan.spi.ClassFileArchiveEntryHandler.handleEntry(ClassFileArchiveEntryHandler.java:48) ~[hibernate-core-5.0.1.Final.jar:5.0.1.Final] at org.hibernate.boot.archive.internal.ExplodedArchiveDescriptor.processDirectory(ExplodedArchiveDescriptor.java:143) ~[hibernate-core-5.0.1.Final.jar:5.0.1.Final] at org.hibernate.boot.archive.internal.ExplodedArchiveDescriptor.processDirectory(ExplodedArchiveDescriptor.java:118) ~[hibernate-core-5.0.1.Final.jar:5.0.1.Final] at org.hibernate.boot.archive.internal.ExplodedArchiveDescriptor.processDirectory(ExplodedArchiveDescriptor.java:118) ~[hibernate-core-5.0.1.Final.jar:5.0.1.Final] at org.hibernate.boot.archive.internal.ExplodedArchiveDescriptor.processDirectory(ExplodedArchiveDescriptor.java:118) ~[hibernate-core-5.0.1.Final.jar:5.0.1.Final] at org.hibernate.boot.archive.internal.ExplodedArchiveDescriptor.processDirectory(ExplodedArchiveDescriptor.java:118) ~[hibernate-core-5.0.1.Final.jar:5.0.1.Final] at org.hibernate.boot.archive.internal.ExplodedArchiveDescriptor.processDirectory(ExplodedArchiveDescriptor.java:118) ~[hibernate-core-5.0.1.Final.jar:5.0.1.Final] at org.hibernate.boot.archive.internal.ExplodedArchiveDescriptor.visitArchive(ExplodedArchiveDescriptor.java:54) ~[hibernate-core-5.0.1.Final.jar:5.0.1.Final] at org.hibernate.boot.archive.scan.spi.AbstractScannerImpl.scan(AbstractScannerImpl.java:46) ~[hibernate-core-5.0.1.Final.jar:5.0.1.Final] at org.hibernate.boot.model.process.internal.ScanningCoordinator.coordinateScan(ScanningCoordinator.java:75) ~[hibernate-core-5.0.1.Final.jar:5.0.1.Final] at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.prepare(MetadataBuildingProcess.java:98) ~[hibernate-core-5.0.1.Final.jar:5.0.1.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.(EntityManagerFactoryBuilderImpl.java:194) ~[hibernate-entitymanager-5.0.1.Final.jar:5.0.1.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl. (EntityManagerFactoryBuilderImpl.java:144) ~[hibernate-entitymanager-5.0.1.Final.jar:5.0.1.Final] at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:54) ~[spring-orm-4.2.1.RELEASE.jar:4.2.1.RELEASE] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:343) ~[spring-orm-4.2.1.RELEASE.jar:4.2.1.RELEASE] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318) ~[spring-orm-4.2.1.RELEASE.jar:4.2.1.RELEASE] at no.vipps.dnb.p2b.bussvc.config.DatabaseConfiguration.entityManagerFactory(DatabaseConfiguration.java:99) ~[classes/:?] at no.vipps.dnb.p2b.bussvc.config.DatabaseConfiguration$$EnhancerBySpringCGLIB$$3bab1a12.CGLIB$entityManagerFactory$1( ) ~[spring-core-4.2.1.RELEASE.jar:?] at no.vipps.dnb.p2b.bussvc.config.DatabaseConfiguration$$EnhancerBySpringCGLIB$$3bab1a12$$FastClassBySpringCGLIB$$69ddca7c.invoke( ) ~[spring-core-4.2.1.RELEASE.jar:?] at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.2.1.RELEASE.jar:4.2.1.RELEASE] at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:318) ~[spring-context-4.2.1.RELEASE.jar:4.2.1.RELEASE] at no.vipps.dnb.p2b.bussvc.config.DatabaseConfiguration$$EnhancerBySpringCGLIB$$3bab1a12.entityManagerFactory( ) ~[spring-core-4.2.1.RELEASE.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_79] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_79] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_79] at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_79]
有人可以帮助我,我应该做什么,我坚持过去3天:(