2

using weblogic 12.2.1.0.0 with jdk1.8.0_60 in unix centos server: follow jersey tutorial i create a war with :

type:generate -DarchetypeArtifactId=jersey-quickstart-webapp -DarchetypeGroupId=org.glassfish.jersey.archetypes -DinteractiveMode=false -DgroupId=com.example -DartifactId=simple-service-webapp -Dpackage=com.example -DarchetypeVersion=2.22.2

Deploy on weblogic is ok, but when call http://host:port/simple-service-webapp/webapi/application.wadl

get the followin error

java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder;
at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:119)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:291)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:32)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3654)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3620)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:196)
at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2423)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2280)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2258)
at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1626)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1586)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:270)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:617)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:397)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:346)

using the same war, on another computer with windows so, weblogic 12.2.1.0.0 with jdk1.8.0_65 the problem is not present.

help me please!

Andrea
  • 77
  • 3
  • 13
  • Weblogic uses Jersey 1.x, and loads an olders version of the JAX-RS Application class. That is the reason for the error. I think there is a way to configure WebLogic to always load the project library classes, instead of the ones on the server, but I don't really use WebLogic so I am not really sure how to do that. I'm just saying this from experience of reading peoples' problems here on SO. – Paul Samsotha Apr 07 '16 at 23:42
  • @peeskillet Weblogic 12.2.1 is actually the first weblogic with Jersey 2.x support enabled by default. It might still be a classloading issues though... – Slettal Apr 08 '16 at 06:38
  • @Slettal you're probably right. Looking at it that way, I'm thinking maybe even the different Jersey 2 versions and JAX-RS versions pulled in may be conflicting. There are some differences between 2.0 and 2.0.1. Maybe the Jersey version in WebLogic uses the older 2.0 version, and the Jersey 2.22 the OP is using uses the newest version. If that's the case, I'm thinking all the OP needs to do is make the Jersey maven dependencies `provided` and just use the one provided by the server. – Paul Samsotha Apr 08 '16 at 06:55
  • I have solved. in one server i have two war in autodeploy folder, with two different version of jersey. I have reinstall the war in production mode, and now the works!Thank to all – Andrea Apr 12 '16 at 12:15
  • Does this answer your question? [java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.uri](https://stackoverflow.com/questions/23277429/java-lang-abstractmethoderror-javax-ws-rs-core-uribuilder-uri) – Cœur Nov 25 '19 at 08:11

0 Answers0