Springframework.data.jpa与javassist.util.proxy.proxy对象不兼容,导致W



我在这里的一些帖子中看到了这个问题,但我仍然在发布这个问题,因为我无法找到问题的解决方案:

Failed to load webapp: Failed to load webapp: org.springframework.data.jpa.repository.cdi.JpaRepositoryExtension_$$_jvste4_0 incompatible with javassist.util.proxy.ProxyObject
at com.ibm.wsspi.runtime.component.WsComponentImpl.join(WsComponentImpl.java:432)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCUList(CompositionUnitMgrImpl.java:1295)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:275)
at com.ibm.ws.runtime.component.ContainerHelper.startComponents(ContainerHelper.java:540)
at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:627)
at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:618)
at com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:252)
at com.ibm.ws.runtime.component.ContainerHelper.startComponents(ContainerHelper.java:540)
at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:627)
at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:618)
at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:540)
at com.ibm.ws.runtime.WsServerImpl.bootServerContainer(WsServerImpl.java:325)
at com.ibm.ws.runtime.WsServerImpl.start(WsServerImpl.java:238)
at com.ibm.ws.runtime.WsServerImpl.main(WsServerImpl.java:711)
at com.ibm.ws.runtime.WsServer.main(WsServer.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:508)
at com.ibm.wsspi.bootstrap.WSLauncher.launchMain(WSLauncher.java:234)
at com.ibm.wsspi.bootstrap.WSLauncher.main(WSLauncher.java:96)
at com.ibm.wsspi.bootstrap.WSLauncher.run(WSLauncher.java:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:508)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:508)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:340)
at org.eclipse.core.launcher.Main.basicRun(Main.java:282)
at org.eclipse.core.launcher.Main.run(Main.java:981)
at com.ibm.wsspi.bootstrap.WSPreLauncher.launchEclipse(WSPreLauncher.java:424)
at com.ibm.wsspi.bootstrap.WSPreLauncher.main(WSPreLauncher.java:177)
Caused by: com.ibm.ws.exception.RuntimeWarning: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Failed to load webapp: org.springframework.data.jpa.repository.cdi.JpaRepositoryExtension_$$_jvste4_0 incompatible with javassist.util.proxy.ProxyObject
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:433)
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:719)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1211)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1464)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:642)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:1042)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:795)
at com.ibm.ws.runtime.component.ApplicationMgrImpl$5.run(ApplicationMgrImpl.java:2279)
at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5536)
at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5662)
at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2284)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:436)
at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:379)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:127)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:985)
at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:524)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)
Caused by: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Failed to load webapp: org.springframework.data.jpa.repository.cdi.JpaRepositoryExtension_$$_jvste4_0 incompatible with javassist.util.proxy.ProxyObject
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:914)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:789)
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:427)
... 18 more
Caused by: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: org.springframework.data.jpa.repository.cdi.JpaRepositoryExtension_$$_jvste4_0 incompatible with javassist.util.proxy.ProxyObject
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:186)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:904)
... 20 more
Caused by: java.lang.ClassCastException: org.springframework.data.jpa.repository.cdi.JpaRepositoryExtension_$$_jvste4_0 incompatible with javassist.util.proxy.ProxyObject
at org.apache.webbeans.proxy.JavassistProxyFactory.createNormalScopedBeanProxy(JavassistProxyFactory.java:225)
at org.apache.webbeans.container.BeanManagerImpl.getReference(BeanManagerImpl.java:966)
at org.apache.webbeans.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:285)
at org.apache.webbeans.event.NotificationManager.fireEvent(NotificationManager.java:455)
at org.apache.webbeans.container.BeanManagerImpl.fireEvent(BeanManagerImpl.java:469)
at org.apache.webbeans.util.WebBeansUtil.fireProcessAnnotatedTypeEvent(WebBeansUtil.java:2657)
at org.apache.webbeans.config.BeansDeployer.deploySingleAnnotatedType(BeansDeployer.java:538)
at org.apache.webbeans.config.BeansDeployer.deployFromClassPath(BeansDeployer.java:488)
at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:171)
at org.apache.webbeans.lifecycle.AbstractLifeCycle.startApplication(AbstractLifeCycle.java:124)
at org.apache.webbeans.web.lifecycle.WebContainerLifecycle.startApplication(WebContainerLifecycle.java:77)
at com.ibm.ws.webbeans.common.CommonLifeCycle.startApplication(CommonLifeCycle.java:106)
at com.ibm.ws.webbeans.services.JCDIServletContainerInitializer.onStartup(JCDIServletContainerInitializer.java:85) at com.ibm.ws.webcontainer.webapp.WebAppImpl.initializeServletContainerInitializers(WebAppImpl.java:620)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:410)
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:171)
... 21 more

当我尝试在websphere上部署应用程序时,我会遇到上述异常,它无法启动。还有其他具有类似依赖关系的项目得到部署并启动。根据我读到的类似于我的问题的帖子,我尝试了以下内容:

  • 排除javassist依赖项
  • ClassLoaderMode也设置为PARENT_LAST

WAS上的javassist似乎与我的应用程序jar附带的jar中的javassit冲突。我已经注释掉了我的应用程序中的依赖项,该应用程序具有javassist可传递依赖项,并在依赖项中排除了它们,如:hibernate内核:5.4.21最终版本org.springframework.data:spring data jpa:2.3.RELEASE

并为javassist版本添加了另一个条目:3.21.0-GA,因为我从我们项目的websphere团队成员那里获得了这个版本。

依赖树如下:


[INFO] +- com.myproject:jar:1-SNAPSHOT:compile
[INFO] |  +- org.apache.commons:commons-lang3:jar:3.7:compile
[INFO] |  +- org.apache.commons:commons-collections4:jar:4.1:compile
[INFO] |  +- org.springframework:spring-orm:jar:5.3.4:compile
[INFO] |  +- org.springframework.data:spring-data-jpa:jar:2.3.3.RELEASE:compile
[INFO] |  |  +- org.springframework.data:spring-data-commons:jar:2.3.3.RELEASE:compile
[INFO] |  |  - org.aspectj:aspectjrt:jar:1.9.6:compile
[INFO] |  +- org.hibernate:hibernate-core:jar:5.4.21.Final:compile
[INFO] |  |  +- javax.persistence:javax.persistence-api:jar:2.2:compile
[INFO] |  |  +- net.bytebuddy:byte-buddy:jar:1.10.10:compile
[INFO] |  |  +- antlr:antlr:jar:2.7.7:compile
[INFO] |  |  +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.1.1.Final:compile
[INFO] |  |  +- org.jboss:jandex:jar:2.1.3.Final:compile
[INFO] |  |  +- javax.activation:javax.activation-api:jar:1.2.0:compile
[INFO] |  |  +- org.hibernate.common:hibernate-commons-annotations:jar:5.1.0.Final:compile
[INFO] |  |  +- javax.xml.bind:jaxb-api:jar:2.3.1:compile
[INFO] |  |  - org.glassfish.jaxb:jaxb-runtime:jar:2.3.1:compile
[INFO] |  |     +- org.glassfish.jaxb:txw2:jar:2.3.1:compile
[INFO] |  |     +- com.sun.istack:istack-commons-runtime:jar:3.0.7:compile
[INFO] |  |     +- org.jvnet.staxex:stax-ex:jar:1.8:compile
[INFO] |  |     - com.sun.xml.fastinfoset:FastInfoset:jar:1.2.15:compile
[INFO] |  +- org.hibernate:hibernate-entitymanager:jar:5.4.21.Final:compile
[INFO] |  +- com.myotherproject:jar:5:compile
[INFO] |  |  +- com.myotherproject:jar:1.0.2:compile
[INFO] |  |  - org.apache.commons:commons-text:jar:1.9:compile
[INFO] |  +- com.myotherproject:jar:1:compile
[INFO] |  |  - io.swagger:swagger-annotations:jar:1.5.20:compile
[INFO] |  +- com.myotherproject:0.0.6:compile
[INFO] |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.11.0:compile
[INFO] |  +- com.myotherproject:jar:0.0.4:compile
[INFO] |  +- com.myotherproject:jar:1.0.2:compile
[INFO] |  - org.javassist:javassist:jar:3.21.0-GA:compile
[INFO] +- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile
[INFO] +- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] +- org.hibernate.validator:hibernate-validator:jar:6.0.21.Final:compile
[INFO] |  +- org.jboss.logging:jboss-logging:jar:3.3.2.Final:compile
[INFO] |  - com.fasterxml:classmate:jar:1.3.4:compile
[INFO] +- com.myotherproject:jar:1.4:compile
[INFO] |  +- com.ibm.db2:jcc:jar:11.1.4.4:compile
[INFO] |  +- com.ibm.db2:db2jcc_license_cisuz:jar:1.0:compile
[INFO] |  - com.myotherproject:jar:3.0.0:compile
[INFO] +- com.myotherproject:jar:3.0.0:compile
[INFO] |  +- com.myotherproject:jar:3.2:compile
[INFO] |  - commons-logging:commons-logging:jar:1.2:compile
[INFO] +- org.springframework:spring-webmvc:jar:5.3.4:compile
[INFO] +- org.springframework:spring-web:jar:5.3.4:compile
[INFO] +- org.springframework:spring-aop:jar:5.3.4:compile
[INFO] +- org.springframework:spring-context:jar:5.3.4:compile
[INFO] +- org.springframework:spring-tx:jar:5.3.4:compile
[INFO] +- org.springframework:spring-beans:jar:5.3.4:compile
[INFO] +- org.springframework:spring-core:jar:5.3.4:compile
[INFO] |  - org.springframework:spring-jcl:jar:5.3.4:compile
[INFO] +- org.springframework:spring-jdbc:jar:5.3.4:compile
[INFO] +- org.springframework:spring-expression:jar:5.3.4:compile
[INFO] +- com.myotherproject:jar:4.0.4:compile
[INFO] |  +- commons-beanutils:commons-beanutils:jar:1.9.3:compile
[INFO] |  |  - commons-collections:commons-collections:jar:3.2.2:compile
[INFO] |  +- com.myotherproject:jar:3.0.0:compile
[INFO] |  - com.myotherproject:jar:3.0.1:compile
[INFO] +- com.myotherproject:jar:3.0.2:compile
[INFO] |  +- com.myotherproject:log4j2-impl:jar:2.1.0:compile
[INFO] |  |  +- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.9.0:compile
[INFO] |  |  +- org.apache.logging.log4j:log4j-api:jar:2.9.0:compile
[INFO] |  |  +- org.apache.logging.log4j:log4j-core:jar:2.9.0:compile
[INFO] |  |  +- com.lmax:disruptor:jar:3.3.0:compile
[INFO] |  |  +- javax.interceptor:javax.interceptor-api:jar:1.2.1:compile
[INFO] |  |  - javax.jms:javax.jms-api:jar:2.0.1:compile
[INFO] |  +- com.ibm.websphere:recjava:jar:6.0.2.37:compile
[INFO] |  +- com.ibm.websphere:eablib:jar:6.0.2.37:compile
[INFO] |  +- com.myotherproject:jar:3.0.0:compile
[INFO] |  +- com.myotherproject:jar:1.0.0:compile
[INFO] |  |  +- javax.resource:javax.resource-api:jar:1.7.1:compile
[INFO] |  |  |  - javax.transaction:javax.transaction-api:jar:1.3:compile
[INFO] |  |  +- com.ibm.ims:imsico:jar:13.2.1:compile
[INFO] |  |  - com.ibm.websphere.ws:marshall:jar:8.5.5.3:compile
[INFO] |  - com.myotherproject:jar:1.0.0:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.11.0:compile
[INFO] |  - com.fasterxml.jackson.core:jackson-core:jar:2.11.0:compile
[INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.11.0:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] +- com.myotherproject:jar:3.0.2:compile
[INFO] +- com.myotherproject:jar:3.2:compile
[INFO] +- com.myotherproject:jar:0.1.10:compile
[INFO] +- com.myotherproject:jar:1.3:compile
[INFO] |  +- com.myotherproject:1.0.13:compile
[INFO] |  - com.myotherproject:pom:1.0.1:compile
[INFO] +- com.myotherproject:0.0.22:compile
[INFO] +- com.myotherproject:jar:0.1:compile
[INFO] |  +- com.google.code.gson:gson:jar:2.8.5:compile
[INFO] |  +- com.myotherproject:jar:3.0.0:compile
[INFO] |  +- com.myotherproject:jar:1.13:compile
[INFO] |  +- com.mikesamuel:json-sanitizer:jar:1.2.0:compile
[INFO] |  +- com.google.guava:guava:jar:19.0:compile
[INFO] |  - com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:jar:20181114.1:compile
[INFO] +- com.myotherproject:jar:0.0.20:compile
[INFO] +- com.myotherproject:0.0.17:compile
[INFO] |  +- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
[INFO] |  |  - junit:junit:jar:4.10:compile
[INFO] |  +- org.dom4j:dom4j:jar:2.1.3:compile
[INFO] |  +- org.modelmapper:modelmapper:jar:2.3.2:compile
[INFO] |  +- v:jar:1.0.0:compile
[INFO] |  - com.myotherproject:jar:1.0.4:compile
[INFO] +- com.myotherproject:jar:1.13:compile
[INFO] |  - com.myotherproject:jar:0.0.9:compile
[INFO] +- com.myotherproject:jar:1.8:compile
[INFO] - com.myotherproject:0.0.15:compile
[INFO]    +- javax.resource:connector-api:jar:1.5:compile
[INFO]    +- com.ibm.websphere:marshall:jar:7.0.0.19:compile
[INFO]    +- com.nordea.oss:copybook4java:jar:1.0.3:compile
[INFO]    - org.projectlombok:lombok:jar:1.18.10:provided

问题:如果有什么我可以尝试的,请帮忙,因为我已经被这个问题困扰了好几个星期了。

目前,我正在处理从WAS到Websphere liberty base的迁移,我遇到了这个问题。在我的案例中,我解决了这个问题,排除了javassist依赖项。

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<exclusions>
<exclusion>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
</exclusion>
</exclusions>
</dependency>

致以最良好的问候。

最新更新