This discussion is archived
5 Replies Latest reply: Oct 9, 2012 8:40 AM by 654886 RSS

RESTfu Tutorial-Error deploying REST service to the external WebLogicServer

654886 Newbie
Currently Being Moderated
Hi I am using Oracle JDeveloper 11g Release 2 11.1.2.2.0 J2EE Edition Version 11.1.2.2.0 and built in WebLogic
Integrated and external WLS versions are the same: WebLogic Server Version: 10.3.5.0
I followed the following tutorial: http://docs.oracle.com/cd/E18941_01/tutorials/jdtut_11r2_53/jdtut_11r2_53.html

When I deploy and test REST service on integrated server everything is fine. But when I try to deploy on the external server I get the error below... I tried following the instructions on: http://docs.oracle.com/cd/E24329_01/web.1211/e24983/configure.htm

but I seem to not be able go anywhere from here. It appears that test Web Service button in JDEV does lot more then just a deployment of the WAR file.


Error:
[09:06:58 AM] ---- Deployment started. ----
[09:06:58 AM] Target platform is (Weblogic 10.3).
[09:06:59 AM] Retrieving existing application information
[09:06:59 AM] Running dependency analysis...
[09:07:00 AM] Building...
[09:07:01 AM] Deploying profile...
[09:07:02 AM] Wrote Web Application Module to E:\JDEV-Rest Example\Rest\RestServiceProject\deploy\webapp.war
[09:07:12 AM] Deploying Application...
[09:07:15 AM] [Deployer:149193]Operation 'deploy' on application 'webapp' has failed on 'AdminServer'
[09:07:15 AM] [Deployer:149034]An exception occurred for task [Deployer:149026]deploy application webapp on AdminServer.: Failed to load webapp: 'webapp.war'.
[09:07:15 AM] Weblogic Server Exception: weblogic.application.ModuleException: Failed to load webapp: 'webapp.war'
[09:07:15 AM] Caused by: weblogic.management.DeploymentException: Error: Unresolved Webapp Library references for "ServletContext@28689374[app:webapp module:webapp.war path:/Rest_lab-RestServiceProject-context-root spec-version:2.5]", defined in weblogic.xml [Extension-Name: jsr311-api, exact-match: false], [Extension-Name: jersey-bundle, exact-match: false]
[09:07:15 AM] See server logs or server console for more details.
[09:07:15 AM] weblogic.application.ModuleException: Failed to load webapp: 'webapp.war'
[09:07:15 AM] Deployment cancelled.
[09:07:15 AM] ---- Deployment incomplete ----.
[09:07:15 AM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)
  • 1. Re: RESTfu Tutorial-Error deploying REST service to the external WebLogicServer
    user696 Explorer
    Currently Being Moderated
    Caused by: weblogic.management.DeploymentException: Error: Unresolved Webapp Library references for "ServletContext@28689374[app:webapp module:webapp.war path:/Rest_lab-RestServiceProject-context-root spec-version:2.5]", defined in weblogic.xml [Extension-Name: jsr311-api, exact-match: false], [Extension-Name: jersey-bundle, exact-match: false]

    Make sure you have deployed jsr311-api and jersey-bundle as shared library are deployed into weblogic server.
    The shared libraries are located in the following directory: WL_HOME/common/deployable-libraries.
    http://docs.oracle.com/cd/E23943_01/web.1111/e13734/rest.htm#CHDFGIII


    Regards,
    Sunil P
  • 2. Re: RESTfu Tutorial-Error deploying REST service to the external WebLogicServer
    654886 Newbie
    Currently Being Moderated
    Thanks for the response. Is this step optional or mandatory. My understanding was that the library comes and it is already installed.
  • 3. Re: RESTfu Tutorial-Error deploying REST service to the external WebLogicServer
    user696 Explorer
    Currently Being Moderated
    The problem over here is you had defined following shared libraries inside weblogic.xml under your WEB-INF/
    1.) jsr311-api
    2.) jersey-bundle

    when you deploy this application it will check for those libraries if they are not deployed you might run into exception. No they are not deployed by default. They are only shipped and they are located at below location WL_HOME/common/deployable-libraries.



    Shared Java EE libraries are registered with one or more WebLogic Server instances by deploying them to the target servers and indicating that the deployments are to be shared. Shared Java EE libraries must be targeted to the same WebLogic Server instances you want to deploy applications that reference the libraries.

    for more info please refer to http://docs.oracle.com/cd/E21764_01/web.1111/e13734/rest.htm#CHDIAIBF

    Regards,
    Sunil P
  • 4. Re: RESTfu Tutorial-Error deploying REST service to the external WebLogicServer
    654886 Newbie
    Currently Being Moderated
    Thanks Sunil.

    I created a new linux installation and new domain and I got an error earlier this time. Is this bellow the same error (and I just missed it) or this is different one?


    [HTTP:101216]Servlet: "jersey" failed to preload on startup in Web application: "RESTWebService.war". java.lang.ClassCastException at java.lang.Class.cast(Class.java:2990) at com.sun.jersey.core.spi.component.ProviderServices.getProvidersAndServices(ProviderServices.java:183) at com.sun.jersey.core.spi.factory.InjectableProviderFactory.configure(InjectableProviderFactory.java:104) at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:774) at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:589) at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:403) at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:252) at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:550) at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:201) at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:307) at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:470) at javax.servlet.GenericServlet.init(GenericServlet.java:240) at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:299) at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:250) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57) at weblogic.servlet.internal.StubSecurityHelper.initServletInstance(StubSecurityHelper.java:94) at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:82) at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:74) at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:60) at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:34) at weblogic.servlet.internal.ServletStubImpl.initStubLifecycleHelper(ServletStubImpl.java:624) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:565) at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1874) at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1848) at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1738) at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2740) at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1704) at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:781) at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:213) at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:208) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35) at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:70) at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:212) at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:111) at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124) at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:213) at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:208) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35) at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:70) at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:24) at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:729) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35) at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:258) at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:48) at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:165) at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79) at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:582) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:148) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:114) at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:335) at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844) at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253) at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440) at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68) at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256) at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
  • 5. Re: RESTfu Tutorial-Error deploying REST service to the external WebLogicServer
    654886 Newbie
    Currently Being Moderated
    Hi Sunil,

    Any luck with:

    <9-Oct-2012 11:30:57 o'clock AM EDT> <Error> <HTTP> <BEA-101216> <Servlet: "jersey" failed to preload on startup in Web application: "RESTWebService.w
    ar".
    java.lang.ClassCastException
    at java.lang.Class.cast(Class.java:2990)
    at com.sun.jersey.core.spi.component.ProviderServices.getProvidersAndServices(ProviderServices.java:183)
    at com.sun.jersey.core.spi.factory.InjectableProviderFactory.configure(InjectableProviderFactory.java:104)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:774)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:589)
    Truncated. see log file for complete stacktrace
    >
    <9-Oct-2012 11:30:57 o'clock AM EDT> <Error> <Deployer> <BEA-149231> <Unable to set the activation state to true for the application "RESTWebService".

    weblogic.application.ModuleException: [HTTP:101216]Servlet: "jersey" failed to preload on startup in Web application: "RESTWebService.war".
    java.lang.ClassCastException
    at java.lang.Class.cast(Class.java:2990)
    at com.sun.jersey.core.spi.component.ProviderServices.getProvidersAndServices(ProviderServices.java:183)
    at com.sun.jersey.core.spi.factory.InjectableProviderFactory.configure(InjectableProviderFactory.java:104)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:774)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:589)
    at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:403)
    at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:252)
    at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:550)
    at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:201)
    at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:307)
    at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:470)
    at javax.servlet.GenericServlet.init(GenericServlet.java:240)
    at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:299)
    at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:250)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
    at weblogic.servlet.internal.StubSecurityHelper.initServletInstance(StubSecurityHelper.java:94)
    at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:82)
    at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:74)
    at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:60)
    at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:34)
    at weblogic.servlet.internal.ServletStubImpl.initStubLifecycleHelper(ServletStubImpl.java:624)
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:565)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1874)
    at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1848)
    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1738)
    at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2740)
    at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1704)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:781)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:213)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:208)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:70)
    at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:212)
    at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:111)
    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:213)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:208)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:70)
    at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:24)
    at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:729)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
    at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:258)
    at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:48)
    at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:165)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:192)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:369)
    at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
    at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)
    at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
    at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
    at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
    at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
    at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:186)
    at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:94)
    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)

    at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1706)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:781)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:213)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:208)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
    Truncated. see log file for complete stacktrace
    Caused By: java.lang.ClassCastException
    at java.lang.Class.cast(Class.java:2990)
    at com.sun.jersey.core.spi.component.ProviderServices.getProvidersAndServices(ProviderServices.java:183)
    at com.sun.jersey.core.spi.factory.InjectableProviderFactory.configure(InjectableProviderFactory.java:104)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:774)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:589)
    Truncated. see log file for complete stacktrace
    >
    <9-Oct-2012 11:30:58 o'clock AM EDT> <Notice> <LoggingService> <BEA-320400> <The log file E:\bea12c\user_projects\domains\rest_domain\servers\AdminSer

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points