Quantcast

Problems with Deploying Jersey App on Weblogic 10.3

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problems with Deploying Jersey App on Weblogic 10.3

Tim Clotworthy

Hi. I am getting the following exception when deploying my jersey-based web app to WL10.3:

 

SEVERE: failed to localize no.root.res.in.res.cfg()
<Aug 13, 2009 4:02:10 PM EDT> <Error> <HTTP> <BEA-101216> <Servlet: "JAX-RS REST Servlet" failed to preload on startup in Web application: "NTM_REST".
com.sun.jersey.api.container.ContainerException: failed to localize no.root.res.in.res.cfg()
at com.sun.jersey.server.impl.application.WebApplicationImpl.processRootResources(WebApplicationImpl.java:718)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:590)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:383)
at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:377)
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:242)
Truncated. see log file for complete stacktrace

 

I am uncertain how to proceed at this point. Any help would be greatly appreciated. Thanks

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problems with Deploying Jersey App on Weblogic 10.3

Paul Sandoz
Administrator
Hi,

Can you send your web.xml?

Does your web.xml contain any initialization parameters to configure Jersey?

I want to ascertain if you are configuring class scanning or package scanning to find root resource classes, the INFO logging should tell if you classes or packages are being scanned.

If you are using the former then there should not be any Jersey related initialization parameters related to root resource configuration in the web.xml.

The former does not currently work on WebLogic. There is a way, thanks to investigations by Gerard, see issue 32:


but we need to implement the fix in a way that abstracts servlet details from the scanning details.

So if you are using class scanning i recommend switching to package scanning:


Paul.

On Aug 14, 2009, at 12:51 AM, Tim Clotworthy wrote:

Hi. I am getting the following exception when deploying my jersey-based web app to WL10.3:
 
SEVERE: failed to localize no.root.res.in.res.cfg()
<Aug 13, 2009 4:02:10 PM EDT> <Error> <HTTP> <BEA-101216> <Servlet: "JAX-RS REST Servlet" failed to preload on startup in Web application: "NTM_REST".
com.sun.jersey.api.container.ContainerException: failed to localize no.root.res.in.res.cfg()
at com.sun.jersey.server.impl.application.WebApplicationImpl.processRootResources(WebApplicationImpl.java:718)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:590)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:383)
at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:377)
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:242)
Truncated. see log file for complete stacktrace
 
I am uncertain how to proceed at this point. Any help would be greatly appreciated. Thanks

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problems with Deploying Jersey App on Weblogic 10.3

vaidyaatdst@gmail.com
I agree. i am running on weblogic 10.3 and i had to do a couple of things to make it work(from tomcat)
1. make sure that the web.xml was correct by checking it with altova xml spy. I had package scanning itself so didnt have to do it . When you bring up the server you should see something like this

INFO: Scanning for root resource and provider classes in the packages:
 <<Your package that you have specified in web.xml>>
Aug 17, 2009 5:12:27 PM com.sun.jersey.api.core.PackagesResourceConfig init
INFO: Root resource classes found:
  <<Resources that it has found>>
2. for some reason i couldnt get the eclipse publishing to work , so i had to export my war file onto the weblogic poll directory which is at $domain/autodeploy .

Here are  some parts of my web.xml which i had to change a little from when it was deployed to Tomcat(apparently tomcat is not so strict )

Header
======
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.5"
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

Servlet config
===========

    <servlet>
        <servlet-name>REST Services</servlet-name>
        <servlet-class>
            com.sun.jersey.server.impl.container.servlet.ServletAdaptor</servlet-class>
        <init-param>
            <param-name>com.sun.jersey.config.property.packages</param-name>
            <param-value>$Your Package for the resources  something like com.blah.blah</param-value>
        </init-param>

        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>REST Services</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>


Regards

On Fri, Aug 14, 2009 at 1:33 AM, Paul Sandoz <[hidden email]> wrote:
Hi,

Can you send your web.xml?

Does your web.xml contain any initialization parameters to configure Jersey?

I want to ascertain if you are configuring class scanning or package scanning to find root resource classes, the INFO logging should tell if you classes or packages are being scanned.

If you are using the former then there should not be any Jersey related initialization parameters related to root resource configuration in the web.xml.

The former does not currently work on WebLogic. There is a way, thanks to investigations by Gerard, see issue 32:


but we need to implement the fix in a way that abstracts servlet details from the scanning details.

So if you are using class scanning i recommend switching to package scanning:


Paul.

On Aug 14, 2009, at 12:51 AM, Tim Clotworthy wrote:

Hi. I am getting the following exception when deploying my jersey-based web app to WL10.3:
 
SEVERE: failed to localize no.root.res.in.res.cfg()
<Aug 13, 2009 4:02:10 PM EDT> <Error> <HTTP> <BEA-101216> <Servlet: "JAX-RS REST Servlet" failed to preload on startup in Web application: "NTM_REST".
com.sun.jersey.api.container.ContainerException: failed to localize no.root.res.in.res.cfg()
at com.sun.jersey.server.impl.application.WebApplicationImpl.processRootResources(WebApplicationImpl.java:718)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:590)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:383)
at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:377)
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:242)
Truncated. see log file for complete stacktrace
 
I am uncertain how to proceed at this point. Any help would be greatly appreciated. Thanks


Loading...