users@jersey.java.net

Re: [Jersey] Re: Jersey, Jetty and web.xml

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 20 May 2008 15:24:16 +0200

Hi Lars,

Lars Tackmann wrote:
> On Wed, Apr 23, 2008 at 12:11 PM, Paul Sandoz <Paul.Sandoz_at_sun.com> wrote:
>> Hi Lars,
>>
>> The main issue is that the default configuration (nothing in the web.xml)
>> assumes a standard Web deployment configuration where jars and classes
>> reside in resolved directories "/WEB-INF/lib" and "/WEB-INF/classes"
>> respectively.
>
> Hi Paul and sorry for the late answer.
>
> None of these approaches did work. Setting the initparameters on the
> WebApp (like below) does not work since they are ignored when the
> web.xml is scanned:
>

Havw you tried adding the following to your web.xml:

   <init-param>
        <param-name>
               com.sun.ws.rest.config.property.resourceConfigClass
        </param-name>
        <param-value>
                com.sun.ws.rest.api.core.PackagesResourceConfig
         </param-value>
        <param-name>
               com.sun.ws.rest.config.property.packages
        </param-name>
        <param-value>
                org.randompage.samples.jaxrs.bookmarking.resources
         </param-value>
   </init-param>

(note if using the latest bits change "com.sun.ws.rest" to
"com.sun.jersey").


> and adding the following:
>
> --
> <init-param>
> <param-name>
> com.sun.ws.rest.config.property.classpath
> </param-name>
> <param-value>/</param-value>
> </init-param>
> --
>
> to web.xml only resolved in the maven java (src/main/java) folder
> getting used for classpath, instead its target folder (which contains
> the .class files).

Grrr... you could try something like "/../../../classes" :-)

Do you have any idea how Seam and Struts work in such cases locating the
classes? is there some extra config information in the web.xml for Struts?


> So for now the only working solution is to wire the
> servlet by hand (or somehow figure out how to pass init paramters to
> WebAppContext that overrides/extends those already in web.xml).
>
> Anyway thanks for the hints.
>

Sorry :-( i am out of further suggestions at the moment...

Paul.

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109