当前位置:  开发笔记 > 编程语言 > 正文

Hibernate 5,JPA 2.0 websphere

如何解决《Hibernate5,JPA2.0websphere》经验,为你挑选了0个好方法。

我被要求将我当前在embeded jetty上运行的应用程序移动到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-> 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天:(

推荐阅读
手机用户2402852387
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有