0
votes

Not able to deploy jersey REST on weblogic server, is there any REST service configuration specific to weblogic ?

Complete stacktrace -

25 Apr, 2018 7:01:53 PM com.sun.jersey.server.impl.application.WebApplicationImpl initiate INFO: Initiating Jersey application, version 'Jersey: 1.2 05/07/2010 02:11 PM' 25 Apr, 2018 7:01:53 PM com.sun.jersey.server.impl.application.WebApplicationImpl processRootResources SEVERE: The ResourceConfig instance does not contain any root resource classes. <25 Apr, 2018 7:01:53 PM IST> (StubLifecycleHelper.java:48) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:539) at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1981) at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1955) at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1874) at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3155) at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1518) at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:484) at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:427) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:54) at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119) at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:201) at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:249) at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:427) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:54) at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119) at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:28) at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:672) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:54) at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212) at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:59) at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161) at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79) at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184) at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361) at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:52) at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200) at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:31) at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240) at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:170) at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:124) at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:181) at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:97) at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256) at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

web.xml -

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
                         "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
 <servlet>
  <servlet-name>FrontController</servlet-name>
  <display-name>FrontController</display-name>
  <description>Front Controller for handling requests</description>
  <servlet-class>com.obopay.icici.FrontController</servlet-class>
 </servlet>
 <servlet>
  <servlet-name>RestServlet</servlet-name>
  <display-name>RestServlet</display-name>
  <description>Rest Controller for handling http rest requests</description>
  <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
  <init-param>
   <param-name>com.sun.jersey.config.property.packages</param-name>
   <param-value>com.obopay.ebp.auth.resources</param-value>
  </init-param>
  <load-on-startup>1</load-on-startup>
 </servlet>
 <servlet-mapping>
  <servlet-name>FrontController</servlet-name>
  <url-pattern>/siAuth</url-pattern>
 </servlet-mapping>
 <servlet-mapping>
  <servlet-name>FrontController</servlet-name>
  <url-pattern>*.do</url-pattern>
 </servlet-mapping>
 <servlet-mapping>
  <servlet-name>FrontController</servlet-name>
  <url-pattern>/failureResponse</url-pattern>
 </servlet-mapping>
 <servlet-mapping>
  <servlet-name>FrontController</servlet-name>
  <url-pattern>/successResponse</url-pattern>
 </servlet-mapping>
 <servlet-mapping>
  <servlet-name>RestServlet</servlet-name>
  <url-pattern>/*</url-pattern>
 </servlet-mapping>
 <session-config>
  <session-timeout>5</session-timeout>
 </session-config>
 <!-- Define an error handler for 404 pages -->
 <error-page>
  <error-code>404</error-code>
  <location>/jsp/error.jsp</location>
 </error-page>
 <!-- Define an error handler for java.lang.Throwable -->
 <error-page>
  <exception-type>java.lang.Throwable</exception-type>
  <location>/jsp/error.jsp</location>
 </error-page>
 <login-config>
  <auth-method>BASIC</auth-method>
 </login-config>
</web-app>

i am using the below jars -

jersey-bundle-1.2.jar
jsr311-api-1.1.1.jar
asm-3.1.jar
wlthint3client.jar
log4j-1.2.15.jar
1

1 Answers

0
votes

Resolved!

Problem was not with the weblogic server, the problem was i had my source code in separate folder instead of src, so weblogic was not able to find package to scan in src folder, so after adding below plugin in pom.xml, deployment was successful -

<plugin>
   <artifactId>maven-resources-plugin</artifactId>
   <version>3.0.2</version>
   <executions>
      <execution>
         <id>copy-source</id>
         <phase>generate-sources</phase>
         <goals>
            <goal>copy-resources</goal>
         </goals>
         <configuration>
            <outputDirectory>co/src</outputDirectory>
            <overwrite>true</overwrite>
            <resources>
               <resource>
                  <directory>${basedir}/co/EBP</directory>
               </resource>
            </resources>
         </configuration>
      </execution>
   </executions>
</plugin>

By using this plugin i copied my saperate folder source code to src folder with overwrite as true. Hence made source code available in src folder.

This problem could also be resolved by mentioning source folder in .classpath file.