将 Jersey 1.8 更新到 1.10+ 导致 ClassNotFoundException:com.sun.jersey.server.impl.cdi.AnnotatedCallableImpl
Update Jersey 1.8 to 1.10+ causes ClassNotFoundException: com.sun.jersey.server.impl.cdi.AnnotatedCallableImpl
我不明白为什么我无法将 jersey-server 从 1.8 更改为 1.10 或更新版本,1.9 仍然可以正常工作但 1.10+ 只是在部署时崩溃。
使用 Glassfish 3.1.2 和一些库改进,如 weld-osgi-bundle 1.1.28,我猜这与此错误有关,mojarra 是 2.1.21。正在尝试遵循 JavaEE 6 规范。
查看包似乎日志中提到的 class 在那里,所以经过一些研究后我现在有点迷路了。
2015-07-15T15:26:18.168-0300|Severe: Exception while loading the app : com/sun/jersey/server/impl/cdi/AnnotatedCallableImpl
java.lang.NoClassDefFoundError: com/sun/jersey/server/impl/cdi/AnnotatedCallableImpl
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2615)
at java.lang.Class.getDeclaredMethod(Class.java:2007)
at org.jboss.weld.util.reflection.SecureReflections.work(SecureReflections.java:143)
at org.jboss.weld.util.reflection.SecureReflections.work(SecureReflections.java:140)
at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsMethodAccess(SecureReflectionAccess.java:102)
at org.jboss.weld.util.reflection.SecureReflections.getDeclaredMethod(SecureReflections.java:140)
at org.jboss.weld.util.reflection.SecureReflections.lookupMethod(SecureReflections.java:408)
at org.jboss.weld.util.reflection.SecureReflections.work(SecureReflections.java:418)
at org.jboss.weld.util.reflection.SecureReflections.work(SecureReflections.java:396)
at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsMethodAccess(SecureReflectionAccess.java:102)
at org.jboss.weld.util.reflection.SecureReflections.lookupMethod(SecureReflections.java:396)
at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:157)
at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:51)
at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:154)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:245)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:233)
at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:213)
at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:117)
at org.jboss.weld.event.TransactionalObserverNotifier.notifyObserver(TransactionalObserverNotifier.java:44)
at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:85)
at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:75)
at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:60)
at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:38)
at org.jboss.weld.bootstrap.events.AbstractProcessInjectionTarget.fire(AbstractProcessInjectionTarget.java:32)
at org.jboss.weld.bootstrap.AbstractBeanDeployer.deploy(AbstractBeanDeployer.java:122)
at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:217)
at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:357)
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:179)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:128)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:277)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.execute(CommandRunnerImpl.java:348)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1066)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access00(CommandRunnerImpl.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: com.sun.jersey.server.impl.cdi.AnnotatedCallableImpl
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1509)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
... 62 more
'mvn dependency:tree' 结果
[INFO] groupId:artifactId:war:version
[INFO] +- org.eclipse.persistence:javax.persistence:jar:2.0.0:provided
[INFO] +- javax.inject:javax.inject:jar:1:provided
[INFO] +- org.glassfish.main.ejb:javax.ejb:jar:3.1.2:provided
[INFO] +- org.glassfish:javax.faces:jar:2.1.21:provided
[INFO] +- javax.servlet:javax.servlet-api:jar:3.0.1:provided
[INFO] +- org.glassfish.web:javax.servlet.jsp:jar:2.2.5:provided
[INFO] | \- javax.servlet.jsp:javax.servlet.jsp-api:jar:2.2.1:provided
[INFO] +- javax.el:javax.el-api:jar:2.2.4:provided
[INFO] +- javax.enterprise:cdi-api:jar:1.0-SP4:provided
[INFO] | +- org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.1_spec:jar:1.0.0.Beta1:provided
[INFO] | \- javax.annotation:jsr250-api:jar:1.0:provided
[INFO] +- org.eclipse.persistence:org.eclipse.persistence.jpa:jar:2.4.2:provided
[INFO] | +- org.eclipse.persistence:org.eclipse.persistence.asm:jar:2.4.2:provided
[INFO] | +- org.eclipse.persistence:org.eclipse.persistence.antlr:jar:2.4.2:provided
[INFO] | +- org.eclipse.persistence:org.eclipse.persistence.jpa.jpql:jar:2.4.2:provided
[INFO] | \- org.eclipse.persistence:org.eclipse.persistence.core:jar:2.4.2:provided
[INFO] +- org.glassfish.main.javaee-api:javax.xml.rpc:jar:3.1.2.2:provided
[INFO] +- javax.persistence:persistence-api:jar:1.0.2:provided
[INFO] +- org.glassfish.main.transaction:javax.transaction:jar:3.1.2.2:provided
[INFO] +- javax.validation:validation-api:jar:1.1.0.Beta2:provided
[INFO] +- javax.activation:activation:jar:1.1:provided
[INFO] +- org.glassfish.main.javaee-api:javax.annotation:jar:3.1.2.2:provided
[INFO] +- org.jboss.weld:weld-osgi-bundle:jar:1.1.28.Final:provided
[INFO] | +- org.jboss.weld:weld-api:jar:1.1.Final:provided
[INFO] | +- org.jboss.weld:weld-core:jar:1.1.28.Final:provided
[INFO] | | +- org.slf4j:slf4j-ext:jar:1.7.2:provided
[INFO] | | \- ch.qos.cal10n:cal10n-api:jar:0.7.7:provided
[INFO] | +- org.jboss.weld:weld-spi:jar:1.1.Final:provided
[INFO] | +- org.javassist:javassist:jar:3.18.1-GA:provided
[INFO] | \- com.google.guava:guava:jar:13.0.1:provided
[INFO] +- org.apache.maven.plugins:maven-compiler-plugin:maven-plugin:3.1:test
[INFO] | +- org.apache.maven:maven-plugin-api:jar:2.0.9:test
[INFO] | +- org.apache.maven:maven-artifact:jar:2.0.9:test
[INFO] | +- org.apache.maven:maven-core:jar:2.0.9:test
[INFO] | | +- org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9:test
[INFO] | | +- org.apache.maven.wagon:wagon-webdav:jar:1.0-beta-2:test
[INFO] | | | \- slide:slide-webdavlib:jar:2.1:test
[INFO] | | | +- commons-httpclient:commons-httpclient:jar:2.0.2:test
[INFO] | | | +- jdom:jdom:jar:1.0:test
[INFO] | | | \- de.zeigermann.xml:xml-im-exporter:jar:1.1:test
[INFO] | | +- org.apache.maven:maven-profile:jar:2.0.9:test
[INFO] | | +- org.apache.maven:maven-error-diagnostics:jar:2.0.9:test
[INFO] | | +- org.apache.maven:maven-project:jar:2.0.9:test
[INFO] | | | \- org.apache.maven:maven-plugin-registry:jar:2.0.9:test
[INFO] | | +- org.apache.maven:maven-plugin-descriptor:jar:2.0.9:test
[INFO] | | +- org.apache.maven:maven-artifact-manager:jar:2.0.9:test
[INFO] | | \- org.apache.maven:maven-monitor:jar:2.0.9:test
[INFO] | +- org.apache.maven:maven-toolchain:jar:1.0:test
[INFO] | +- org.apache.maven.shared:maven-shared-utils:jar:0.1:test
[INFO] | | \- com.google.code.findbugs:jsr305:jar:2.0.1:test
[INFO] | +- org.apache.maven.shared:maven-shared-incremental:jar:1.1:test
[INFO] | | \- org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:test
[INFO] | +- org.codehaus.plexus:plexus-compiler-api:jar:2.2:test
[INFO] | +- org.codehaus.plexus:plexus-compiler-manager:jar:2.2:test
[INFO] | +- org.codehaus.plexus:plexus-compiler-javac:jar:2.2:test
[INFO] | \- org.codehaus.plexus:plexus-container-default:jar:1.5.5:test
[INFO] | +- org.codehaus.plexus:plexus-classworlds:jar:2.2.2:test
[INFO] | +- org.apache.xbean:xbean-reflect:jar:3.4:test
[INFO] | | +- log4j:log4j:jar:1.2.12:test
[INFO] | | \- commons-logging:commons-logging-api:jar:1.1:test
[INFO] | \- com.google.collections:google-collections:jar:1.0:test
[INFO] +- wsdl4j:wsdl4j:jar:1.6.2:provided
[INFO] +- javax.xml.soap:saaj-api:jar:1.3:provided
[INFO] +- javax.xml:jaxrpc-api:jar:1.1:provided
[INFO] +- commons-logging:commons-logging:jar:1.0.3:provided
[INFO] +- commons-io:commons-io:jar:2.4:provided
[INFO] +- commons-discovery:commons-discovery:jar:0.2:provided
[INFO] +- commons-codec:commons-codec:jar:1.7:provided
[INFO] +- commons-fileupload:commons-fileupload:jar:1.2.2:provided
[INFO] +- org.apache.commons:commons-lang3:jar:3.1:provided
[INFO] +- com.google.code.gson:gson:jar:2.2.4:provided
[INFO] +- org.primefaces.themes:bootstrap:jar:1.0.9:compile
[INFO] +- org.primefaces:primefaces:jar:5.1:compile
[INFO] +- org.apache.axis:axis:jar:1.4:compile
[INFO] +- org.postgresql:postgresql:jar:9.3-1103-jdbc41:provided
[INFO] +- org.eclipse.persistence:eclipselink:jar:2.4.2:provided
[INFO] | \- org.eclipse.persistence:commonj.sdo:jar:2.1.1:provided
[INFO] +- com.itextpdf:itextpdf:jar:5.3.2:provided
[INFO] +- org.apache.poi:poi:jar:3.10-FINAL:provided
[INFO] +- org.apache.pdfbox:pdfbox:jar:1.8.5:provided
[INFO] | +- org.apache.pdfbox:fontbox:jar:1.8.5:provided
[INFO] | \- org.apache.pdfbox:jempbox:jar:1.8.5:provided
[INFO] +- net.glxn:qrgen:jar:1.4:compile
[INFO] | \- com.google.zxing:javase:jar:3.0.0:compile
[INFO] | \- com.google.zxing:core:jar:3.0.0:compile
[INFO] +- org.flywaydb:flyway-core:jar:3.0:compile
[INFO] +- ch.qos.logback:logback-classic:jar:1.0.11:provided
[INFO] +- ch.qos.logback:logback-core:jar:1.0.11:provided
[INFO] +- org.slf4j:slf4j-api:jar:1.7.5:provided
[INFO] +- javax.mail:javax.mail-api:jar:1.5.2:provided
一位朋友分析了 jersey 库并发现 CDI 包在 1.9 之后从 jersey-server 移动到另一个名为 jersey-servlet 的依赖项。
强制 jersey-servlet 对 pom 的依赖解决了项目的问题,对于 Arquillian,还需要另一个 jersey-multipart 的依赖声明。
我不知道为什么依赖项管理器没有处理它,但将所有内容声明为依赖项工作得很好。
所以我可以升级 glassfish 上的库并按照提供的方式声明,它也能正常工作。从pom中省略jersey-servlet和jersey-multipart导致在部署时再次出错,找不到最优雅的解决方法。
我不明白为什么我无法将 jersey-server 从 1.8 更改为 1.10 或更新版本,1.9 仍然可以正常工作但 1.10+ 只是在部署时崩溃。
使用 Glassfish 3.1.2 和一些库改进,如 weld-osgi-bundle 1.1.28,我猜这与此错误有关,mojarra 是 2.1.21。正在尝试遵循 JavaEE 6 规范。
查看包似乎日志中提到的 class 在那里,所以经过一些研究后我现在有点迷路了。
2015-07-15T15:26:18.168-0300|Severe: Exception while loading the app : com/sun/jersey/server/impl/cdi/AnnotatedCallableImpl
java.lang.NoClassDefFoundError: com/sun/jersey/server/impl/cdi/AnnotatedCallableImpl
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2615)
at java.lang.Class.getDeclaredMethod(Class.java:2007)
at org.jboss.weld.util.reflection.SecureReflections.work(SecureReflections.java:143)
at org.jboss.weld.util.reflection.SecureReflections.work(SecureReflections.java:140)
at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsMethodAccess(SecureReflectionAccess.java:102)
at org.jboss.weld.util.reflection.SecureReflections.getDeclaredMethod(SecureReflections.java:140)
at org.jboss.weld.util.reflection.SecureReflections.lookupMethod(SecureReflections.java:408)
at org.jboss.weld.util.reflection.SecureReflections.work(SecureReflections.java:418)
at org.jboss.weld.util.reflection.SecureReflections.work(SecureReflections.java:396)
at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsMethodAccess(SecureReflectionAccess.java:102)
at org.jboss.weld.util.reflection.SecureReflections.lookupMethod(SecureReflections.java:396)
at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:157)
at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:51)
at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:154)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:245)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:233)
at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:213)
at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:117)
at org.jboss.weld.event.TransactionalObserverNotifier.notifyObserver(TransactionalObserverNotifier.java:44)
at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:85)
at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:75)
at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:60)
at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:38)
at org.jboss.weld.bootstrap.events.AbstractProcessInjectionTarget.fire(AbstractProcessInjectionTarget.java:32)
at org.jboss.weld.bootstrap.AbstractBeanDeployer.deploy(AbstractBeanDeployer.java:122)
at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:217)
at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:357)
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:179)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:128)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:277)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.execute(CommandRunnerImpl.java:348)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1066)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access00(CommandRunnerImpl.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: com.sun.jersey.server.impl.cdi.AnnotatedCallableImpl
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1509)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
... 62 more
'mvn dependency:tree' 结果
[INFO] groupId:artifactId:war:version
[INFO] +- org.eclipse.persistence:javax.persistence:jar:2.0.0:provided
[INFO] +- javax.inject:javax.inject:jar:1:provided
[INFO] +- org.glassfish.main.ejb:javax.ejb:jar:3.1.2:provided
[INFO] +- org.glassfish:javax.faces:jar:2.1.21:provided
[INFO] +- javax.servlet:javax.servlet-api:jar:3.0.1:provided
[INFO] +- org.glassfish.web:javax.servlet.jsp:jar:2.2.5:provided
[INFO] | \- javax.servlet.jsp:javax.servlet.jsp-api:jar:2.2.1:provided
[INFO] +- javax.el:javax.el-api:jar:2.2.4:provided
[INFO] +- javax.enterprise:cdi-api:jar:1.0-SP4:provided
[INFO] | +- org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.1_spec:jar:1.0.0.Beta1:provided
[INFO] | \- javax.annotation:jsr250-api:jar:1.0:provided
[INFO] +- org.eclipse.persistence:org.eclipse.persistence.jpa:jar:2.4.2:provided
[INFO] | +- org.eclipse.persistence:org.eclipse.persistence.asm:jar:2.4.2:provided
[INFO] | +- org.eclipse.persistence:org.eclipse.persistence.antlr:jar:2.4.2:provided
[INFO] | +- org.eclipse.persistence:org.eclipse.persistence.jpa.jpql:jar:2.4.2:provided
[INFO] | \- org.eclipse.persistence:org.eclipse.persistence.core:jar:2.4.2:provided
[INFO] +- org.glassfish.main.javaee-api:javax.xml.rpc:jar:3.1.2.2:provided
[INFO] +- javax.persistence:persistence-api:jar:1.0.2:provided
[INFO] +- org.glassfish.main.transaction:javax.transaction:jar:3.1.2.2:provided
[INFO] +- javax.validation:validation-api:jar:1.1.0.Beta2:provided
[INFO] +- javax.activation:activation:jar:1.1:provided
[INFO] +- org.glassfish.main.javaee-api:javax.annotation:jar:3.1.2.2:provided
[INFO] +- org.jboss.weld:weld-osgi-bundle:jar:1.1.28.Final:provided
[INFO] | +- org.jboss.weld:weld-api:jar:1.1.Final:provided
[INFO] | +- org.jboss.weld:weld-core:jar:1.1.28.Final:provided
[INFO] | | +- org.slf4j:slf4j-ext:jar:1.7.2:provided
[INFO] | | \- ch.qos.cal10n:cal10n-api:jar:0.7.7:provided
[INFO] | +- org.jboss.weld:weld-spi:jar:1.1.Final:provided
[INFO] | +- org.javassist:javassist:jar:3.18.1-GA:provided
[INFO] | \- com.google.guava:guava:jar:13.0.1:provided
[INFO] +- org.apache.maven.plugins:maven-compiler-plugin:maven-plugin:3.1:test
[INFO] | +- org.apache.maven:maven-plugin-api:jar:2.0.9:test
[INFO] | +- org.apache.maven:maven-artifact:jar:2.0.9:test
[INFO] | +- org.apache.maven:maven-core:jar:2.0.9:test
[INFO] | | +- org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9:test
[INFO] | | +- org.apache.maven.wagon:wagon-webdav:jar:1.0-beta-2:test
[INFO] | | | \- slide:slide-webdavlib:jar:2.1:test
[INFO] | | | +- commons-httpclient:commons-httpclient:jar:2.0.2:test
[INFO] | | | +- jdom:jdom:jar:1.0:test
[INFO] | | | \- de.zeigermann.xml:xml-im-exporter:jar:1.1:test
[INFO] | | +- org.apache.maven:maven-profile:jar:2.0.9:test
[INFO] | | +- org.apache.maven:maven-error-diagnostics:jar:2.0.9:test
[INFO] | | +- org.apache.maven:maven-project:jar:2.0.9:test
[INFO] | | | \- org.apache.maven:maven-plugin-registry:jar:2.0.9:test
[INFO] | | +- org.apache.maven:maven-plugin-descriptor:jar:2.0.9:test
[INFO] | | +- org.apache.maven:maven-artifact-manager:jar:2.0.9:test
[INFO] | | \- org.apache.maven:maven-monitor:jar:2.0.9:test
[INFO] | +- org.apache.maven:maven-toolchain:jar:1.0:test
[INFO] | +- org.apache.maven.shared:maven-shared-utils:jar:0.1:test
[INFO] | | \- com.google.code.findbugs:jsr305:jar:2.0.1:test
[INFO] | +- org.apache.maven.shared:maven-shared-incremental:jar:1.1:test
[INFO] | | \- org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:test
[INFO] | +- org.codehaus.plexus:plexus-compiler-api:jar:2.2:test
[INFO] | +- org.codehaus.plexus:plexus-compiler-manager:jar:2.2:test
[INFO] | +- org.codehaus.plexus:plexus-compiler-javac:jar:2.2:test
[INFO] | \- org.codehaus.plexus:plexus-container-default:jar:1.5.5:test
[INFO] | +- org.codehaus.plexus:plexus-classworlds:jar:2.2.2:test
[INFO] | +- org.apache.xbean:xbean-reflect:jar:3.4:test
[INFO] | | +- log4j:log4j:jar:1.2.12:test
[INFO] | | \- commons-logging:commons-logging-api:jar:1.1:test
[INFO] | \- com.google.collections:google-collections:jar:1.0:test
[INFO] +- wsdl4j:wsdl4j:jar:1.6.2:provided
[INFO] +- javax.xml.soap:saaj-api:jar:1.3:provided
[INFO] +- javax.xml:jaxrpc-api:jar:1.1:provided
[INFO] +- commons-logging:commons-logging:jar:1.0.3:provided
[INFO] +- commons-io:commons-io:jar:2.4:provided
[INFO] +- commons-discovery:commons-discovery:jar:0.2:provided
[INFO] +- commons-codec:commons-codec:jar:1.7:provided
[INFO] +- commons-fileupload:commons-fileupload:jar:1.2.2:provided
[INFO] +- org.apache.commons:commons-lang3:jar:3.1:provided
[INFO] +- com.google.code.gson:gson:jar:2.2.4:provided
[INFO] +- org.primefaces.themes:bootstrap:jar:1.0.9:compile
[INFO] +- org.primefaces:primefaces:jar:5.1:compile
[INFO] +- org.apache.axis:axis:jar:1.4:compile
[INFO] +- org.postgresql:postgresql:jar:9.3-1103-jdbc41:provided
[INFO] +- org.eclipse.persistence:eclipselink:jar:2.4.2:provided
[INFO] | \- org.eclipse.persistence:commonj.sdo:jar:2.1.1:provided
[INFO] +- com.itextpdf:itextpdf:jar:5.3.2:provided
[INFO] +- org.apache.poi:poi:jar:3.10-FINAL:provided
[INFO] +- org.apache.pdfbox:pdfbox:jar:1.8.5:provided
[INFO] | +- org.apache.pdfbox:fontbox:jar:1.8.5:provided
[INFO] | \- org.apache.pdfbox:jempbox:jar:1.8.5:provided
[INFO] +- net.glxn:qrgen:jar:1.4:compile
[INFO] | \- com.google.zxing:javase:jar:3.0.0:compile
[INFO] | \- com.google.zxing:core:jar:3.0.0:compile
[INFO] +- org.flywaydb:flyway-core:jar:3.0:compile
[INFO] +- ch.qos.logback:logback-classic:jar:1.0.11:provided
[INFO] +- ch.qos.logback:logback-core:jar:1.0.11:provided
[INFO] +- org.slf4j:slf4j-api:jar:1.7.5:provided
[INFO] +- javax.mail:javax.mail-api:jar:1.5.2:provided
一位朋友分析了 jersey 库并发现 CDI 包在 1.9 之后从 jersey-server 移动到另一个名为 jersey-servlet 的依赖项。
强制 jersey-servlet 对 pom 的依赖解决了项目的问题,对于 Arquillian,还需要另一个 jersey-multipart 的依赖声明。
我不知道为什么依赖项管理器没有处理它,但将所有内容声明为依赖项工作得很好。
所以我可以升级 glassfish 上的库并按照提供的方式声明,它也能正常工作。从pom中省略jersey-servlet和jersey-multipart导致在部署时再次出错,找不到最优雅的解决方法。