users@jersey.java.net

[Jersey] Re: Deploying on Jetty

From: Jakub Podlesak <jakub.podlesak_at_oracle.com>
Date: Wed, 25 May 2011 08:20:20 +0200

Hi Dario,

On 05/24/2011 06:36 PM, Dário Abdulrehman wrote:
> I added the maven-jetty-plugin to the pom as in your example but I get
> an error when running mvn jetty:run:
>
> java.lang.ClassNotFoundException:
> com.sun.jersey.spi.container.servlet.ServletContainer

This class is from the jersey-server module. Do you have
the following dependency defined in your pom?
The ${jersey.version} refers to the actual Jersey version
you want to use...

<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>${jersey.version}</version>
<scope>compile</scope>
</dependency>

?

The best would be if you could send out your pom file
to the list, so that others could review.

~Jakub

> Also I added the configuration manually to the pom. If I add the
> dependency through netbeans Libraries -> Add dependency it adds the
> plugin as a<dependency></dependency> and not as a<plugin></plugin>.
> I don't know if this is important.
>
> On Tue, May 24, 2011 at 4:01 PM, Pavel Bucek<pavel.bucek_at_oracle.com> wrote:
>> Hello,
>>
>> yes, it is possible, see helloworld-webapp sample [1] and execute mvn clean
>> package jetty:run.
>>
>> Jetty:run doesn't work out of the box, it must be configured, see pom file
>> of that sample.
>>
>> Regards,
>> Pavel
>>
>> [1]
>> http://download.java.net/maven/2/com/sun/jersey/samples/helloworld-webapp/1.7/helloworld-webapp-1.7-project.zip
>>
>> On 5/24/11 4:56 PM, Dário Abdulrehman wrote:
>>> I would include some services in a VM but glassfish is very big and I
>>> would like to keep the VM as small as possible.
>>> Is it possible to deploy the web services on the Jetty web server?
>>>
>>> I tried to add jetty to the project dependencies and then running mvn
>>> jetty:run but I get a
>>> [ERROR] No plugin found for prefix 'jetty' in the current project and
>>> in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] ...
>>>
>>>
>>> Is it possible to deploy a Jersey web services on Jetty?
>>>
>>> Thanks.
>>>
>>