我被要求将我目前在嵌入式码头上运行的应用程序移动到 websphere。我使用 Hibernate5.0 Spring Java 配置,Websphere8.5.5。
我的观察:
Websphere 使用 JPA2.0 而 Hibernate 5 使用 JPA 2.1,我尝试了所有可能的方法来告诉 websphere 使用 JPA2.1 没有运气
我在 websphere 上尝试过的事情
- 在 2 个位置最后将类加载器更改为父级
应用程序->Websphere 企业应用程序->单击应用程序名称-> 类加载器并更新检测-> 类加载器首先使用本地类加载器(parent_last)
应用程序->Websphere 企业应用程序->单击应用程序name->Manage Modules->点击application_Name.war->class loader order as parent_last - 服务器->Websphere 应用程序服务器->服务器名称->容器服务->默认 Persitence Api 设置->org.Hibernate.jpa.HibernatePersistenceProvider
- http://www-01.ibm.com/support/docview.wss?uid=swg1PM26361
每次更改后,我都重新启动了服务器
有没有办法让 Hibernate 5 和 Spring LocalEntityManageFActory 与 JPA 2.0 一起工作,我试图从 hibernate-entitymanager 中排除 jpa 2.1 并添加 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.<init>(EntityManagerFactoryBuilderImpl.java:194) ~[hibernate-entitymanager-5.0.1.Final.jar:5.0.1.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(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(<generated>) ~[spring-core-4.2.1.RELEASE.jar:?]
at no.vipps.dnb.p2b.bussvc.config.DatabaseConfiguration$$EnhancerBySpringCGLIB$$3bab1a12$$FastClassBySpringCGLIB$$69ddca7c.invoke(<generated>) ~[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(<generated>) ~[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 天开始我到底应该做什么:(