问题是升级我的系统以使用Jetty 9和Apache CXF 3.0

时间:2015-12-11 19:58:38

标签: jetty cxf maven-jetty-plugin jetty-9

我正在尝试升级我的项目以使用以下版本:

<dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
            <version>3.0.4.redhat-620133</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-rs-client</artifactId>
            <version>3.0.4.redhat-620133</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-management</artifactId>
            <version>3.0.4.redhat-620133</version>
        </dependency>

        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http-jetty</artifactId>
            <version>3.0.4.redhat-620133</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-bindings-soap</artifactId>
            <version>3.0.4.redhat-620133</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http</artifactId>
            <version>3.0.4.redhat-620133</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>3.0.4.redhat-620133</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-rs-extension-providers</artifactId>
            <version>$3.0.4.redhat-620133</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-local</artifactId>
            <version>$3.0.4.redhat-620133</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-bundle</artifactId>
            <version>3.0.0-milestone1</version>
 <exclusions>
                    <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-expression</artifactId>
                    </exclusion>
                </exclusions>
        </dependency>

我还将更新码头依赖关系如下:

<dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-server</artifactId>
                <version>9.3.4.v20151007</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-util</artifactId>
                <version>9.3.4.v20151007</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-webapp</artifactId>
                <version>9.3.4.v20151007</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-jndi</artifactId>
                <version>9.3.4.v20151007</version>
                <scope>test</scope>
            </dependency>

进入插件:

<plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.3.5.v20151012</version>
                <configuration>
                    <httpConnector>
                        <port>8585</port>
                    </httpConnector>
                    <useTestClasspath>true</useTestClasspath>
                    <webAppConfig>
                        <contextPath>/</contextPath>
                    </webAppConfig>
                    <scanIntervalSeconds>0</scanIntervalSeconds>
                    <reload>manual</reload>
                    <systemProperties>
                        <systemProperty>
                            <name>spring.profiles.default</name>
                            <value>dev</value>
                        </systemProperty>
                        <!-- <systemProperty> <name>com.sun.management.jmxremote.port</name>
                            <value>9000</value> </systemProperty> <systemProperty> <name>com.sun.management.jmxremote.authenticate</name>
                            <value>false</value> </systemProperty> <systemProperty> <name>com.sun.management.jmxremote.ssl</name>
                            <value>false</value> </systemProperty> -->
                    </systemProperties>
                    <stopPort>8005</stopPort>
                    <stopKey>STOP</stopKey>
                </configuration>
                <executions>
                    <execution>
                        <id>stop-jetty</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

当我尝试运行mvn clean install时,我收到此错误:

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.006 sec <<< FAILURE! - in com.project.rs.OrderServiceCxfTest
testGetCcAndLikeDoco(com.project.rs.OrderServiceCxfTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
    at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:94)
    at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:72)
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
    at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:200)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:259)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:261)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:219)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:83)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:68)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:163)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'queryRs': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/eclipse/jetty/server/nio/SelectChannelConnector
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
    //More stacktrace in here... 
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.nio.SelectChannelConnector
    at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.getHTTPConnectorFactory(JettyHTTPServerEngine.java:651)
    at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.retrieveListenerFactory(JettyHTTPServerEngine.java:640)
    at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.finalizeConfig(JettyHTTPServerEngine.java:692)
    at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory.getOrCreate(JettyHTTPServerEngineFactory.java:121)
    at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory.createJettyHTTPServerEngine(JettyHTTPServerEngineFactory.java:268)
    at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.retrieveEngine(JettyHTTPDestination.java:121)
    at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.finalizeConfig(JettyHTTPDestination.java:154)
    at org.apache.cxf.transport.http.HTTPTransportFactory.getDestination(HTTPTransportFactory.java:281)
    at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:84)
    at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:63)
    at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:170)
    at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1702)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1641)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
    at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:125)
    at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
    at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:109)
    at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:261)
    at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:68)
    at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:86)
    at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:72)
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
    at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:200)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:259)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:261)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:219)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:83)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:68)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:163)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

在代码中没有任何SelectChannelConnector的引用。我们修改了我们的jetty插件,删除了这个:

<connectors>
                <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                    <port>8585</port>
                </connector>
            </connectors>

Jetty 9和某些apache cxf依赖项之间是否存在任何兼容性问题?

运行mvn依赖:tree我有这个:

[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ fief-jde-svcs-db ---
    [INFO] com.project.jde:fief-jde-svcs-db:jar:16.02.RC1-SNAPSHOT
    [INFO] +- com.project.fief:fief-specs:jar:16.02.RC1-SNAPSHOT:compile
    [INFO] +- com.project.fief:fief-resources:jar:16.02.RC1-SNAPSHOT:compile
    [INFO] +- com.project.fief.jde:fief-extension-jde:jar:16.02.RC1-SNAPSHOT:compile
    [INFO] |  +- com.project2.jde:jde-ext-client:jar:2.0.10-SNAPSHOT:compile
    [INFO] |  +- com.project2:project2-core:jar:2.0.10-SNAPSHOT:compile
    [INFO] |  \- org.springframework:spring-beans:jar:4.1.6.RELEASE:compile
    [INFO] +- org.apache.cxf:cxf-rt-frontend-jaxrs:jar:3.0.4.redhat-620133:compile
    [INFO] |  +- org.apache.cxf:cxf-core:jar:3.0.4.redhat-620133:compile
    [INFO] |  +- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile
    [INFO] |  +- javax.annotation:javax.annotation-api:jar:1.2:compile
    [INFO] |  \- org.apache.cxf:cxf-rt-transports-http:jar:3.0.4.redhat-620133:compile
    [INFO] +- org.eclipse.jetty:jetty-server:jar:9.3.4.v20151007:test
    [INFO] |  +- javax.servlet:javax.servlet-api:jar:3.1.0:test
    [INFO] |  +- org.eclipse.jetty:jetty-http:jar:9.3.4.v20151007:compile
    [INFO] |  \- org.eclipse.jetty:jetty-io:jar:9.3.4.v20151007:compile
    [INFO] +- org.apache.cxf:cxf-rt-rs-client:jar:3.0.4.redhat-620133:compile
    [INFO] +- org.apache.cxf:cxf-rt-management:jar:3.0.4.redhat-620133:compile
    [INFO] +- org.apache.cxf:cxf-rt-transports-http-jetty:jar:3.0.4.redhat-620133:test
    [INFO] |  +- org.eclipse.jetty:jetty-security:jar:8.1.15.v20140411:compile
    [INFO] |  \- org.apache.geronimo.specs:geronimo-servlet_3.0_spec:jar:1.0:compile
    [INFO] +- org.apache.cxf:cxf-bundle:jar:3.0.0-milestone1:compile
    [INFO] |  +- org.apache.velocity:velocity:jar:1.7:compile
    [INFO] |  +- commons-collections:commons-collections:jar:3.2.1:compile
    [INFO] |  +- wsdl4j:wsdl4j:jar:1.6.3:compile
    [INFO] |  +- com.sun.xml.bind:jaxb-xjc:jar:2.1.13:compile
    [INFO] |  +- com.sun.xml.bind:jaxb-impl:jar:2.1.13:compile
    [INFO] |  +- org.apache.ws.xmlschema:xmlschema-core:jar:2.0.3:compile
    [INFO] |  +- antlr:antlr:jar:2.7.7:compile
    [INFO] |  +- org.apache.xmlbeans:xmlbeans:jar:2.6.0:compile
    [INFO] |  +- xml-resolver:xml-resolver:jar:1.2:compile
    [INFO] |  +- org.apache.geronimo.specs:geronimo-jaxws_2.2_spec:jar:1.1:compile
    [INFO] |  +- org.codehaus.woodstox:woodstox-core-asl:jar:4.2.0:compile
    [INFO] |  +- org.codehaus.woodstox:stax2-api:jar:3.1.1:compile
    [INFO] |  +- org.eclipse.jetty:jetty-continuation:jar:8.1.14.v20131031:compile
    [INFO] |  +- org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1.1:compile
    [INFO] |  +- org.springframework:spring-jms:jar:4.1.6.RELEASE:compile
    [INFO] |  |  \- org.springframework:spring-messaging:jar:4.1.6.RELEASE:compile
    [INFO] |  +- aopalliance:aopalliance:jar:1.0:compile
    [INFO] |  +- org.springframework:spring-aop:jar:4.1.6.RELEASE:compile
    [INFO] |  +- commons-lang:commons-lang:jar:2.6:compile
    [INFO] |  +- org.apache.httpcomponents:httpcore-nio:jar:4.3:compile
    [INFO] |  +- org.apache.httpcomponents:httpcore:jar:4.3:compile
    [INFO] |  +- org.apache.httpcomponents:httpasyncclient:jar:4.0:compile
    [INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.3.1:compile
    [INFO] |  +- commons-codec:commons-codec:jar:1.8:compile
    [INFO] |  +- org.apache.mina:mina-core:jar:2.0.7:compile
    [INFO] |  +- asm:asm:jar:3.3.1:compile
    [INFO] |  +- rhino:js:jar:1.7R2:compile
    [INFO] |  +- net.oauth.core:oauth-provider:jar:20100527:compile
    [INFO] |  +- net.oauth.core:oauth:jar:20100527:compile
    [INFO] |  +- net.sf.ehcache:ehcache:jar:2.7.4:compile
    [INFO] |  +- org.apache.wss4j:wss4j-ws-security-dom:jar:2.0-beta:compile
    [INFO] |  +- org.apache.wss4j:wss4j-ws-security-common:jar:2.0-beta:compile
    [INFO] |  +- org.jasypt:jasypt:jar:1.9.0:compile
    [INFO] |  +- org.apache.santuario:xmlsec:jar:2.0.0-beta:compile
    [INFO] |  +- org.opensaml:opensaml:jar:2.6.0:compile
    [INFO] |  +- org.opensaml:openws:jar:1.5.0:compile
    [INFO] |  +- org.opensaml:xmltooling:jar:1.4.0:compile
    [INFO] |  +- xalan:serializer:jar:2.7.1:compile
    [INFO] |  +- org.apache.wss4j:wss4j-policy:jar:2.0-beta:compile
    [INFO] |  +- org.apache.wss4j:wss4j-ws-security-stax:jar:2.0-beta:compile
    [INFO] |  +- org.apache.wss4j:wss4j-bindings-wss10:jar:2.0-beta:compile
    [INFO] |  +- org.apache.wss4j:wss4j-bindings-wsu10:jar:2.0-beta:compile
    [INFO] |  +- org.apache.wss4j:wss4j-bindings-wss11:jar:2.0-beta:compile
    [INFO] |  +- org.apache.wss4j:wss4j-bindings-wssc:jar:2.0-beta:compile
    [INFO] |  +- org.apache.wss4j:wss4j-ws-security-dom:jar:tests:2.0-beta:compile
    [INFO] |  +- org.apache.wss4j:wss4j-ws-security-policy-stax:jar:2.0-beta:compile
    [INFO] |  \- org.apache.neethi:neethi:jar:3.0.2:compile
    [INFO] +- org.eclipse.jetty:jetty-util:jar:9.3.4.v20151007:test
    [INFO] +- org.apache.geronimo.specs:geronimo-servlet_2.5_spec:jar:1.2:compile
    [INFO] +- org.mybatis:mybatis-spring:jar:1.1.1:compile
    [INFO] |  \- org.mybatis:mybatis:jar:3.1.1:compile
    [INFO] +- org.codehaus.jackson:jackson-jaxrs:jar:1.9.13:compile
    [INFO] |  +- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
    [INFO] |  \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
    [INFO] +- org.codehaus.jackson:jackson-xc:jar:1.9.13:compile
    [INFO] +- org.springframework:spring-web:jar:4.1.6.RELEASE:compile
    [INFO] +- org.springframework:spring-core:jar:4.1.6.RELEASE:compile
    [INFO] +- org.springframework:spring-context:jar:4.1.6.RELEASE:compile
    [INFO] |  \- org.springframework:spring-expression:jar:4.1.6.RELEASE:compile
    [INFO] +- org.springframework:spring-jdbc:jar:4.1.6.RELEASE:compile
    [INFO] +- org.springframework:spring-tx:jar:4.1.6.RELEASE:compile
    [INFO] +- com.project2:project2-spring:jar:2.0.10-SNAPSHOT:compile
    [INFO] |  \- org.springframework:spring-oxm:jar:4.1.6.RELEASE:compile
    [INFO] +- commons-pool:commons-pool:jar:1.6:compile
    [INFO] +- commons-dbcp:commons-dbcp:jar:1.4:compile
    [INFO] +- com.ibm.as400:jt400:jar:7.4:compile
    [INFO] +- org.beanio:beanio:jar:2.0.3:compile
    [INFO] +- cglib:cglib:jar:2.2.2:compile
    [INFO] +- com.project2:project2-test:jar:2.0.10-SNAPSHOT:test
    [INFO] |  +- com.google.guava:guava:jar:13.0.1:compile
    [INFO] |  +- org.hamcrest:hamcrest-library:jar:1.1:test
    [INFO] |  \- org.eclipse.jetty:jetty-webapp:jar:9.3.4.v20151007:test
    [INFO] |     +- org.eclipse.jetty:jetty-xml:jar:9.3.4.v20151007:test
    [INFO] |     \- org.eclipse.jetty:jetty-servlet:jar:9.3.4.v20151007:test
    [INFO] +- com.flintenergy.fief:fief-test-resources:jar:16.02.RC1-SNAPSHOT:test
    [INFO] +- org.springframework:spring-test:jar:4.1.6.RELEASE:test
    [INFO] +- com.h2database:h2:jar:1.3.160:test
    [INFO] +- joda-time:joda-time:jar:2.3:compile
    [INFO] +- org.slf4j:slf4j-api:jar:1.7.6:compile
    [INFO] +- org.slf4j:log4j-over-slf4j:jar:1.7.6:compile
    [INFO] +- org.slf4j:jcl-over-slf4j:jar:1.7.6:compile
    [INFO] +- ch.qos.logback:logback-classic:jar:1.0.9:compile
    [INFO] +- ch.qos.logback:logback-core:jar:1.0.9:compile
    [INFO] +- junit:junit:jar:4.10:test
    [INFO] |  \- org.hamcrest:hamcrest-core:jar:1.1:test
    [INFO] +- org.easytesting:fest-assert-core:jar:2.0M10:test
    [INFO] |  \- org.easytesting:fest-util:jar:1.2.5:test
    [INFO] +- org.easytesting:fest-guava-assert:jar:1.1:test
    [INFO] +- ru.yandex.qatools.allure:allure-junit-adaptor:jar:1.4.14:compile
    [INFO] |  \- ru.yandex.qatools.allure:allure-java-aspects:jar:1.4.14:compile
    [INFO] |     +- ru.yandex.qatools.allure:allure-java-adaptor-api:jar:1.4.14:compile
    [INFO] |     |  +- ru.yandex.qatools.allure:allure-java-annotations:jar:1.4.14:compile
    [INFO] |     |  |  \- ru.yandex.qatools.allure:allure-model:jar:1.4.14:compile
    [INFO] |     |  |     +- org.jvnet.jaxb2_commons:jaxb2-basics-runtime:jar:0.9.3:compile
    [INFO] |     |  |     \- ru.yandex.qatools.properties:properties-loader:jar:1.5:compile
    [INFO] |     |  |        \- commons-beanutils:commons-beanutils-core:jar:1.8.3:compile
    [INFO] |     |  \- org.apache.tika:tika-core:jar:1.7:compile
    [INFO] |     \- org.aspectj:aspectjrt:jar:1.7.1:compile
    [INFO] \- com.github.detro.ghostdriver:phantomjsdriver:jar:1.0.4:compile
    [INFO]    +- org.seleniumhq.selenium:selenium-remote-driver:jar:2.33.0:compile
    [INFO]    |  +- cglib:cglib-nodep:jar:2.1_3:compile
    [INFO]    |  +- org.json:json:jar:20080701:compile
    [INFO]    |  +- org.seleniumhq.selenium:selenium-api:jar:2.33.0:compile
    [INFO]    |  +- org.apache.commons:commons-exec:jar:1.1:compile
    [INFO]    |  +- net.java.dev.jna:jna:jar:3.4.0:compile
    [INFO]    |  \- net.java.dev.jna:platform:jar:3.4.0:compile
    [INFO]    +- org.seleniumhq.selenium:selenium-java:jar:2.33.0:compile
    [INFO]    |  +- org.seleniumhq.selenium:selenium-android-driver:jar:2.33.0:compile
    [INFO]    |  +- org.seleniumhq.selenium:selenium-chrome-driver:jar:2.33.0:compile
    [INFO]    |  +- org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.33.0:compile
    [INFO]    |  |  \- net.sourceforge.htmlunit:htmlunit:jar:2.12:compile
    [INFO]    |  |     +- xalan:xalan:jar:2.7.1:compile
    [INFO]    |  |     +- org.apache.commons:commons-lang3:jar:3.1:compile
    [INFO]    |  |     +- org.apache.httpcomponents:httpmime:jar:4.2.3:compile
    [INFO]    |  |     +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.12:compile
    [INFO]    |  |     +- xerces:xercesImpl:jar:2.10.0:compile
    [INFO]    |  |     |  \- xml-apis:xml-apis:jar:1.4.01:compile
    [INFO]    |  |     +- net.sourceforge.nekohtml:nekohtml:jar:1.9.18:compile
    [INFO]    |  |     +- net.sourceforge.cssparser:cssparser:jar:0.9.9:compile
    [INFO]    |  |     |  \- org.w3c.css:sac:jar:1.3:compile
    [INFO]    |  |     \- org.eclipse.jetty:jetty-websocket:jar:8.1.9.v20130131:compile
    [INFO]    |  +- org.seleniumhq.selenium:selenium-firefox-driver:jar:2.33.0:compile
    [INFO]    |  |  \- commons-io:commons-io:jar:2.2:compile
    [INFO]    |  +- org.seleniumhq.selenium:selenium-ie-driver:jar:2.33.0:compile
    [INFO]    |  +- org.seleniumhq.selenium:selenium-iphone-driver:jar:2.33.0:compile
    [INFO]    |  +- org.seleniumhq.selenium:selenium-safari-driver:jar:2.33.0:compile
    [INFO]    |  +- org.seleniumhq.selenium:selenium-support:jar:2.33.0:compile
    [INFO]    |  \- org.webbitserver:webbit:jar:0.4.14:compile
    [INFO]    |     \- io.netty:netty:jar:3.5.2.Final:compile
    [INFO]    \- org.seleniumhq.selenium:selenium-server:jar:2.33.0:compile
    [INFO]       +- org.bouncycastle:bcprov-jdk15on:jar:1.48:compile
    [INFO]       +- org.bouncycastle:bcpkix-jdk15on:jar:1.48:compile
    [INFO]       +- mx4j:mx4j-tools:jar:3.0.1:compile
    [INFO]       +- org.mortbay.jetty:servlet-api-2.5:jar:6.1.9:compile
    [INFO]       +- org.seleniumhq.selenium:jetty-repacked:jar:7.6.1:compile
    [INFO]       +- net.jcip:jcip-annotations:jar:1.0:compile
    [INFO]       \- org.yaml:snakeyaml:jar:1.8:compile

有人可以帮我指点方向吗?我错过了一些依赖吗?有任何复杂性问题吗?已经尝试排除对版本8的一些jetty引用并为jetty 9添加依赖项,但总是出现相同的错误......

1 个答案:

答案 0 :(得分:2)

不要混合Jetty版本。

保持您的依赖项版本和jetty-maven-plugin相同。

使用$ mvn dependency:tree

仔细检查您的依赖项

从连接器的角度来看,Jetty 9和Jetty 8不兼容。

也许您可以使用Apache CXF 3.1.4, seems to support Jetty 9.2.11

Jetty 9.0.0初始版本的准备课程org.eclipse.jetty.server.nio.SelectChannelConnector was removed September 2012

删除了所有BIO(阻塞I / O)连接器,只留下了NIO,其中,它们被整合以准备即将发布的HTTP / 2规范以及ALPN / TLS为连接协商带来的变化。然后将NIO用法更新为NIO.2以利用Java本身的更新。