users@jersey.java.net

Re: [Jersey] Problem deploying to Weblogic 9.2

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 09 Jun 2008 17:09:26 +0200

Hi Chad,

This is a problem with the default class scanning technique not being
portable across servlet implementations.

Try adding the following after the <servlet-class> element of your web.xml:

<init-param>
<param-name>com.sun.jersey.config.property.resourceConfigClass</param-name>
<param-value>com.sun.jersey.api.core.PackagesResourceConfig</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>*';' separated package names*</param-value>
</init-param>


This switches to using the package scanning technique rather than the
class path scanning technique, which is more portable.

So if the package of your AuthorizedApplicationsResource class was say
"com.foo", you can replace "*';' separated package names*" as above with
"com.foo".

We are slowly converting over the examples to use maven and as part of
that they will use the above style configuration and should be more
portable. Plus i would like to make this easier and not require the
first init-param.

Hope this helps,
Paul.


chad.gallemore_at_accenture.com wrote:
> Hi all,
>
>
>
> I’m having trouble deploying my war to Weblogic 9.2. I basically have
> the Hello World example that came as part of the Jersey 0.8
> distribution. I can deploy this to Tomcat, and JBoss and it works just
> fine, but when I deploy it to Weblogic I get the following error:
>
>
>
> java.lang.IllegalArgumentException:
> com.sun.jersey.config.property.classpath contains no paths
>
>
>
> My web.xml looks like the following:
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
>
> <servlet>
>
> <servlet-name>Jersey Web Application</servlet-name>
>
>
> <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
>
> <load-on-startup>1</load-on-startup>
>
> </servlet>
>
> <servlet-mapping>
>
> <servlet-name>Jersey Web Application</servlet-name>
>
> <url-pattern>/resources/*</url-pattern>
>
> </servlet-mapping>
>
> </web-app>
>
>
>
> My source code looks like the following:
>
>
>
> public class AuthorizedApplicationsResource {
>
> String json = "{" +
>
> "netusr:{" +
>
> "apps:{" +
>
> "app:[" +
>
> "{" +
>
> "name:foo," +
>
> "link:'http://foo.com'," +
>
> "authorized:'true'" +
>
> "}," +
>
> "{" +
>
> "name:'bar," +
>
> "link:'http://bar.com'," +
>
> "authorized:'false'" +
>
> "}" +
>
> "]" +
>
> "}" +
>
> "}" +
>
> "}";
>
>
>
> @GET
>
> @ProduceMime("text/javascript")
>
> public String getClichedMessage() {
>
> // Return some cliched textual content
>
> return json;
>
> }
>
> }
>
>
>
> I’m stumped on this, anyone got any ideas?
>
>
>
> Chad Gallemore
>
> Accenture
>
> Associate Consultant
>
> 407 Pennslyvannia Ave Suite 201
>
> Joplin, MO 64801
>
> chad.gallemore_at_accenture.com <mailto:chad.gallemore_at_accenture.com>
>
>
>
> This message is for the designated recipient only and may contain
> privileged, proprietary, or otherwise private information. If you have
> received it in error, please notify the sender immediately and delete
> the original. Any other use of the email by you is prohibited.
>

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