简体   繁体   中英

java.lang.AbstractMethodError: uri while deploying RESTful app in Weblogic

I have a spring MVC web application, to which we integrate a spring-jersy REST service for some utility functionality.The application we deployed in tomcat 7.x and it works fine. But when we deploy it in Weblogic server, the web application is working fine, but when this application contac the integrated REST service, the following exception happened


Root cause of ServletException.
java.lang.AbstractMethodError: uri
        at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:119)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:662)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

The WEB-INF/lib having:

aether-util-0.9.0.M2.jar
antlr-2.7.7.jar
aopalliance-1.0.jar
asm-3.3.1.jar
aspectjrt-1.6.10.jar
avalon-framework-4.1.3.jar
backport-util-concurrent-3.1.jar
bcprov-jdk14-140.jar
commons-beanutils-1.8.0.jar
commons-codec-1.7.jar
commons-collections-3.2.1.jar
commons-digester-2.0.jar
commons-lang-2.6.jar
commons-logging-1.1.jar
compActivationService.jar
compiler-0.8.4.jar
cxf-bundle-2.7.6.jar
dom4j-1.6.1.jar
ehcache-core-2.5.1.jar
eqmtAssociateService.jar
freemarker-2.3.15.jar
geronimo-javamail_1.4_spec-1.7.1.jar
geronimo-jaxws_2.2_spec-1.1.jar
geronimo-jms_1.1_spec-1.1.1.jar
gson-2.2.4.jar
guava-12.0.1.jar
hibernate-commons-annotations-4.0.2.Final.jar
hibernate-core-4.2.7.Final.jar
hibernate-jpa-2.0-api-1.0.1.Final.jar
httpasyncclient-4.0-beta3.jar
httpclient-4.2.5.jar
httpcore-4.2.4.jar
httpcore-nio-4.2.4.jar
i18nCommon-0.0.1-SNAPSHOT.jar
i18nProcessor-0.0.1-SNAPSHOT.jar
i18nService-0.0.1-SNAPSHOT.jar
icu4j-53.1.jar
jackson-core-asl-1.7.1.jar
jackson-jaxrs-1.7.1.jar
jackson-mapper-asl-1.7.1.jar
jackson-xc-1.7.1.jar
javassist-3.18.1-GA.jar
javassist-3.7.ga.jar
javax.inject-1.jar
javax.ws.rs-api-2.0-m10.jar
jaxb-impl-2.1.13.jar
jaxb-xjc-2.1.13.jar
jboss-logging-3.1.0.GA.jar
jboss-transaction-api_1.1_spec-1.0.1.Final.jar
jcl-over-slf4j-1.6.6.jar
jdom-b10.jar
jersey-client-1.8.jar
jersey-core-1.8.jar
jersey-json-1.8.jar
jersey-server-1.8.jar
jersey-spring-1.8.jar
jettison-1.1.jar
jetty-continuation-8.1.7.v20120910.jar
jetty-http-8.1.7.v20120910.jar
jetty-io-8.1.7.v20120910.jar
jetty-security-8.1.7.v20120910.jar
jetty-server-8.1.7.v20120910.jar
jetty-util-8.1.7.v20120910.jar
joda-time-2.3.jar
js-1.7R2.jar
jsr-275-0.0.1-SNAPSHOT.jar
jsr305-1.3.9.jar
jstl-1.2.jar
spring-aop-3.2.7.RELEASE.jar
spring-beans-3.2.7.RELEASE.jar
spring-context-3.2.7.RELEASE.jar
spring-core-3.2.7.RELEASE.jar
spring-expression-3.2.7.RELEASE.jar
spring-jdbc-3.2.7.RELEASE.jar
spring-jms-3.0.7.RELEASE.jar
spring-orm-3.2.1.RELEASE.jar
spring-tx-3.2.7.RELEASE.jar
spring-web-3.2.7.RELEASE.jar
spring-webmvc-3.2.7.RELEASE.jar
stax-api-1.0.1.jar
stax2-api-3.1.1.jar
tiles-api-3.0.3.jar
wagon-provider-api-1.0-beta-6.jar
woodstox-core-asl-4.2.0.jar
wsdl4j-1.6.3.jar
wss4j-1.5.6.jar
xalan-2.7.1.jar
xml-apis-1.3.04.jar
xml-resolver-1.2.jar
xmlbeans-2.6.0.jar
xmlschema-core-2.0.3.jar
xmlsec-1.4.2.jar
xmltooling-1.3.2-1.jar

We also tried to hit the integrated REST service from browser- same error! But it would work perfectly in tomcat. What might be the problem. Please help...

My success story :

we are migrating from weblogic 10.3.6(Application using using jersey 1.17) to weblogic 12C. When build of 10.3.6 is deployed on 12C, we were getting following stack trace.

Root cause of ServletException. java.lang.AbstractMethodError: uri at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:119) at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:662) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

After searching for a week in Google for possible solutions and suggestions, nothing worked for me. Following things helped me for sorting out the problem.

  1. Removed all jersey related jars from build. Since weblogic 12C has built in library.
  2. updated web.xml with Glassfish servlet instead of 1.7 jersey servlet.

OLD entry: com.sun.jersey.spi.container.servlet.ServletContainer

Replaced with entry : org.glassfish.jersey.servlet.ServletContainer

  1. Shutdown weblogic server, deleted tmp & cache directories of weblogic node ( this was Critical step)
  2. Deployed build latest
  3. restarted weblogic 12c servers.
  4. REST services started working fine.

FYI : NO other code changes done. we already had MyApplication.java file which has REST service implementation class like below.

 public class MyApplication extends Application { @Override public Set<Class<?>> getClasses() { final Set<Class<?>> classes = new HashSet<Class<?>>(); classes.add(com.sri.test.SriRestService.class); return classes; } }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM