2015-08-16 98 views
0

我有gradle應用程序。我對錯誤進行部署爲每個API調用後收到錯誤:在碼頭上部署時出錯

java.lang.LinkageError: loader constraint violation: loader (instance of org/mortbay/jetty/webapp/WebAppClassLoader) previously initiated loading for a different type with name  "com/fasterxml/jackson/core/JsonFactory" 
    at java.lang.ClassLoader.defineClass1(Native Method) 
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800) 
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) 
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) 
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71) 
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361) 
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354) 
    at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:392) 
    at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:363) 
    at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:217) 
    at org.springframework.http.converter.AbstractHttpMessageConverter.write(AbstractHttpMessageConverter.java:208) 
    at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:161) 
    at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:101) 
    at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:167) 
    at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:71) 
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:126) 
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776) 
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705) 
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) 
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) 
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) 
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966) 
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) 
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842) 

我gradle這個depencies:

compile 'org.springframework:spring-webmvc:4.1.6.RELEASE' 
compile 'org.springframework:spring-core:3.2.3.RELEASE' 
compile 'org.springframework:spring-jdbc:4.1.6.RELEASE' 

compile 'javax.servlet:jstl:1.2' 
compile 'com.sun.jersey:jersey-client:1.18.1' 
compile 'javax.servlet:javax.servlet-api:3.0.1' 
compile 'mysql:mysql-connector-java:5.1.35' 
compile 'com.nimbusds:nimbus-jose-jwt:3.10' 
compile 'joda-time:joda-time:2.8.2' 
compile 'com.google.oauth-client:google-oauth-client:1.20.0' 
compile 'com.google.api-client:google-api-client:1.20.0' 
compile 'com.google.http-client:google-http-client:1.20.0' 
compile 'com.google.http-client:google-http-client-jackson:1.20.0' 
compile 'com.google.apis:google-api-services-plus:v1-rev217-1.20.0' 

compile 'org.apache.httpcomponents:httpclient:4.5' 
compile 'org.apache.httpcomponents:httpcomponents-core:4.4.1' 

compile 'org.glassfish.jersey.core:jersey-common:2.4.1' 

providedCompile 'javax.servlet:servlet-api:2.5' 
providedCompile 'javax.servlet.jsp:jsp-api:2.1' 
//providedCompile 'javax:javaee-api:7.0' 
runtime 'javax.servlet:jstl:1.2' 
testCompile 'junit:junit:4.11' 
testCompile 'org.mockito:mockito-all:1.9.5' 
compile 'org.slf4j:slf4j-api:1.7.5' 
compile 'org.slf4j:slf4j-log4j12:1.7.5' 
compile 'org.slf4j:jcl-over-slf4j:1.7.5' 
compile 'log4j:log4j:1.2.17' 
compile 'org.codehaus.jackson:jackson-jaxrs:1.9.2' 
compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.12' 
providedCompile 'javax.servlet:servlet-api:2.5' 
providedCompile 'javax.servlet.jsp:jsp-api:2.1' 
runtime 'javax.servlet:jstl:1.2' 
testCompile 'junit:junit:4.11' 

testCompile 'org.mockito:mockito-all:1.9.5' 

我覺得我有一些依賴性衝突。但我無法猜測哪些是那些。

回答

0

你的傑克遜庫與其他一些傑克遜庫衝突。這可能是一些依賴項的依賴 - 或者傑克遜庫已經存在於Jetty中的共享庫中

+0

刪除了幾乎所有的庫都無法找到哪一個。 – user2696466