title: Error while deploying Jersey REST on weblogic (<BEA-101216> <Servlet: "RestServlet" failed to preload on startup in Web application: "gateway".)
body: <p>Not able to deploy jersey REST on weblogic server, is there any REST service configuration specific to weblogic ?</p>
  
  <p><strong>Complete stacktrace -</strong> </p>
  
  <blockquote>
    <p>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. &lt;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)</p>
  </blockquote>
  
  <p><strong>web.xml -</strong> </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
                           "http://java.sun.com/dtd/web-app_2_3.dtd"&gt;
  &lt;web-app&gt;
   &lt;servlet&gt;
    &lt;servlet-name&gt;FrontController&lt;/servlet-name&gt;
    &lt;display-name&gt;FrontController&lt;/display-name&gt;
    &lt;description&gt;Front Controller for handling requests&lt;/description&gt;
    &lt;servlet-class&gt;com.obopay.icici.FrontController&lt;/servlet-class&gt;
   &lt;/servlet&gt;
   &lt;servlet&gt;
    &lt;servlet-name&gt;RestServlet&lt;/servlet-name&gt;
    &lt;display-name&gt;RestServlet&lt;/display-name&gt;
    &lt;description&gt;Rest Controller for handling http rest requests&lt;/description&gt;
    &lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&lt;/servlet-class&gt;
    &lt;init-param&gt;
     &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt;
     &lt;param-value&gt;com.obopay.ebp.auth.resources&lt;/param-value&gt;
    &lt;/init-param&gt;
    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
   &lt;/servlet&gt;
   &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;FrontController&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/siAuth&lt;/url-pattern&gt;
   &lt;/servlet-mapping&gt;
   &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;FrontController&lt;/servlet-name&gt;
    &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;
   &lt;/servlet-mapping&gt;
   &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;FrontController&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/failureResponse&lt;/url-pattern&gt;
   &lt;/servlet-mapping&gt;
   &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;FrontController&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/successResponse&lt;/url-pattern&gt;
   &lt;/servlet-mapping&gt;
   &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;RestServlet&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
   &lt;/servlet-mapping&gt;
   &lt;session-config&gt;
    &lt;session-timeout&gt;5&lt;/session-timeout&gt;
   &lt;/session-config&gt;
   &lt;!-- Define an error handler for 404 pages --&gt;
   &lt;error-page&gt;
    &lt;error-code&gt;404&lt;/error-code&gt;
    &lt;location&gt;/jsp/error.jsp&lt;/location&gt;
   &lt;/error-page&gt;
   &lt;!-- Define an error handler for java.lang.Throwable --&gt;
   &lt;error-page&gt;
    &lt;exception-type&gt;java.lang.Throwable&lt;/exception-type&gt;
    &lt;location&gt;/jsp/error.jsp&lt;/location&gt;
   &lt;/error-page&gt;
   &lt;login-config&gt;
    &lt;auth-method&gt;BASIC&lt;/auth-method&gt;
   &lt;/login-config&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>i am using the below <strong>jars</strong> - </p>
  
  <pre><code>jersey-bundle-1.2.jar
  jsr311-api-1.1.1.jar
  asm-3.1.jar
  wlthint3client.jar
  log4j-1.2.15.jar
  </code></pre>