Skip to main content

jersey examples on jetty?

2 replies [Last post]
Anonymous

I'm trying to get up to speed on jersey (0.5-ea). I use maven to build the
example SimpleServlet and then do mvn jetty:run to start up the example in
jetty 6.1.8.

I end up with a jetty stacktrace like so:
[INFO] Starting jetty 6.1.8 ...
2008-03-06 15:36:04.734::INFO: jetty-6.1.8
2008-03-06 15:36:04.906::INFO: No Transaction manager found - if your
webapp requires one, please configure one.
2008-03-06 15:36:04.219::WARN: EXCEPTION
java.lang.ClassNotFoundException:
com.sun.ws.rest.impl.container.servlet.ServletAdapter
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

I have both jsr311-api-0.5 and jersey-0.5-ea in my dependencies classpath.
Any ideas on the issue here? I know glassfish is the preferred container
for jersey deployment, but is jetty out of the question?

Jeff
--
View this message in context: http://www.nabble.com/jersey-examples-on-jetty--tp15885131p15885131.html
Sent from the Metro - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Paul Sandoz

Hi Jeff,

Some people are using Jetty with Jersey both with Maven and in embedded
mode. It is hard for me to tell what is going on without more
information from the exception.

What are the complete jars in your classpath? See here [1] for the 0.5
Jersey dependencies.

When using Jetty is it recommend you configure the web.xml to use the
PackagesResourceConfig (see [2] for an example).

See here [3] for an example of using Jetty in embedded mode.

To further help i recommend you send email to:

mailto:users@jersey.dev.java.net

as others with Jetty experience may also be able to help you with Jetty
issues and you may get a faster response.

Paul.

[1]
https://jersey.dev.java.net/source/browse/*checkout*/jersey/tags/jersey-...
[2] http://blogs.sun.com/sandoz/entry/jersey_0_5_is_released
[3] https://jersey.dev.java.net/servlets/ReadMsg?list=users&msgNo=751

jblack wrote:
> I'm trying to get up to speed on jersey (0.5-ea). I use maven to build the
> example SimpleServlet and then do mvn jetty:run to start up the example in
> jetty 6.1.8.
>
> I end up with a jetty stacktrace like so:
> [INFO] Starting jetty 6.1.8 ...
> 2008-03-06 15:36:04.734::INFO: jetty-6.1.8
> 2008-03-06 15:36:04.906::INFO: No Transaction manager found - if your
> webapp requires one, please configure one.
> 2008-03-06 15:36:04.219::WARN: EXCEPTION
> java.lang.ClassNotFoundException:
> com.sun.ws.rest.impl.container.servlet.ServletAdapter
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>
> I have both jsr311-api-0.5 and jersey-0.5-ea in my dependencies classpath.
> Any ideas on the issue here? I know glassfish is the preferred container
> for jersey deployment, but is jetty out of the question?
>
>
> Jeff

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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net

jblack

Paul,

Thank you for your reply. It set me straight, especially the second link
about the PackagesResourceConfig usage in web.xml. Turns out I was using
the wrong servlet class (ServletAdapter instead of ServletContainer) and had
the init-params wrong anyway.

The new 0.5 ASM resource scanner is fantastic and makes jersey resources
very easy to expose. Keep up the good work!

Jeff

Paul Sandoz wrote:
>
> Hi Jeff,
>
> Some people are using Jetty with Jersey both with Maven and in embedded
> mode. It is hard for me to tell what is going on without more
> information from the exception.
>
> What are the complete jars in your classpath? See here [1] for the 0.5
> Jersey dependencies.
>
> When using Jetty is it recommend you configure the web.xml to use the
> PackagesResourceConfig (see [2] for an example).
>
> See here [3] for an example of using Jetty in embedded mode.
>
> To further help i recommend you send email to:
>
> mailto:users@jersey.dev.java.net
>
> as others with Jetty experience may also be able to help you with Jetty
> issues and you may get a faster response.
>
> Paul.
>
> [1]
> https://jersey.dev.java.net/source/browse/*checkout*/jersey/tags/jersey-...
> [2] http://blogs.sun.com/sandoz/entry/jersey_0_5_is_released
> [3] https://jersey.dev.java.net/servlets/ReadMsg?list=users&msgNo=751
>
>
> jblack wrote:
>> I'm trying to get up to speed on jersey (0.5-ea). I use maven to build
>> the
>> example SimpleServlet and then do mvn jetty:run to start up the example
>> in
>> jetty 6.1.8.
>>
>> I end up with a jetty stacktrace like so:
>> [INFO] Starting jetty 6.1.8 ...
>> 2008-03-06 15:36:04.734::INFO: jetty-6.1.8
>> 2008-03-06 15:36:04.906::INFO: No Transaction manager found - if your
>> webapp requires one, please configure one.
>> 2008-03-06 15:36:04.219::WARN: EXCEPTION
>> java.lang.ClassNotFoundException:
>> com.sun.ws.rest.impl.container.servlet.ServletAdapter
>> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>>
>> I have both jsr311-api-0.5 and jersey-0.5-ea in my dependencies
>> classpath.
>> Any ideas on the issue here? I know glassfish is the preferred container
>> for jersey deployment, but is jetty out of the question?
>>
>>
>> Jeff
>
> --
> | ? + ? = To question
> ----------------\
> Paul Sandoz
> x38109
> +33-4-76188109
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
> For additional commands, e-mail: users-help@metro.dev.java.net
>
>
>

--
View this message in context: http://www.nabble.com/jersey-examples-on-jetty--tp15885131p15898858.html
Sent from the Metro - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net