users@jersey.java.net

Re: [Jersey] CNFE ServletContainer with helloworld-webapp

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 24 Nov 2008 11:19:32 +0100

On Nov 24, 2008, at 5:49 AM, Srinivas Naresh Bhimisetty wrote:

> Its because of the dependency on the "jersey-server" module. The
> scope is set to "provided", things work fine when this is removed.
> May be this should be corrected.
>

Changing the scope will result in jars being included in the war,
which we do not want, as they are already supplied with GF. Note that:

1) The tests using embedded GF work fine;

2) I think the GF maven plugin is not correctly taking into account
the dependences; and

3) We are using a very old version of the plugin because it is the
only one that works with maven, perhaps when we can correctly use the
latest embedded GF plugin it will work?

For the samples shipped with GF i would be inclined to remove the
functionality for mvn glassfish:run so as not to cause confusion.

Paul.


> Thanks,
> Naresh
>
> Arun Gupta wrote:
>>
>> Downloaded Jersey from UC on GF v2, tried running helloworld-webapp
>> as mvn glassfish:run, got the following error:
>>
>> INFO: Application Loader startup done in 469 ms
>> Nov 21, 2008 5:20:15 PM
>> com.sun.enterprise.v3.server.AppServerStartup run
>> INFO: Glassfish v3 started in 470 ms
>> Nov 21, 2008 5:20:16 PM
>> com.sun.enterprise.web.WebModuleContextConfig authenticatorConfig
>> SEVERE: webModuleContextConfig.missingRealm
>> Nov 21, 2008 5:20:16 PM org.apache.catalina.core.ApplicationContext
>> log
>> SEVERE: WebModule[/helloworld-webapp]Error loading WebappClassLoader
>> delegate: true
>> repositories:
>> ----------> Parent Classloader:
>> ,URls[]=)
>> com.sun.jersey.spi.container.servlet.ServletContainer
>> java.lang.ClassNotFoundException:
>> com.sun.jersey.spi.container.servlet.ServletContainer
>> at
>> org
>> .apache
>> .catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
>> 1477)
>> at
>> org
>> .apache
>> .catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1111)
>> at
>> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:
>> 1009)
>> at
>> org
>> .apache
>> .catalina.core.StandardContext.loadOnStartup(StandardContext.java:
>> 4800)
>> at
>> org.apache.catalina.core.StandardContext.start(StandardContext.java:
>> 5188)
>> at com.sun.enterprise.web.WebModule.start(WebModule.java:339)
>> at
>> org
>> .apache
>> .catalina.core.ContainerBase.addChildInternal(ContainerBase.java:973)
>> at
>> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:
>> 957)
>> at
>> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:688)
>> at
>> com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:
>> 3020)
>> at
>> com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:
>> 2646)
>> at
>> com.sun.enterprise.web.WebApplication.start(WebApplication.java:72)
>> at
>> com.sun.enterprise.web.WebApplication.start(WebApplication.java:63)
>> at
>> com
>> .sun
>> .enterprise
>> .v3
>> .server.ApplicationLifecycle.startModules(ApplicationLifecycle.java:
>> 609)
>> at
>> com
>> .sun
>> .enterprise
>> .v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:257)
>> at org.glassfish.embed.GlassFish.deploy(GlassFish.java:422)
>> at org.glassfish.maven.RunMojo.execute(RunMojo.java:132)
>> at
>> org
>> .apache
>> .maven
>> .plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:
>> 451)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor
>> .executeGoals(DefaultLifecycleExecutor.java:558)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor
>> .executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:
>> 482)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor
>> .executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor
>> .executeTaskSegments(DefaultLifecycleExecutor.java:291)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
>> at
>> org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:
>> 129)
>> at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)
>> at
>> sun
>> .reflect
>> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> at
>> sun
>> .reflect
>> .DelegatingMethodAccessorImpl
>> .invoke(DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>> at org.codehaus.classworlds.Launcher.launch(Launcher.java:
>> 255)
>> at
>> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>>
>> Nov 21, 2008 5:20:16 PM org.apache.catalina.core.ApplicationContext
>> log
>> SEVERE: WebModule[/helloworld-webapp]PWC1396: Servlet /helloworld-
>> webapp threw load() exception
>> java.lang.ClassNotFoundException:
>> com.sun.jersey.spi.container.servlet.ServletContainer
>> at
>> org
>> .apache
>> .catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
>> 1477)
>> at
>> org
>> .apache
>> .catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1111)
>> at
>> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:
>> 1009)
>> at
>> org
>> .apache
>> .catalina.core.StandardContext.loadOnStartup(StandardContext.java:
>> 4800)
>> at
>> org.apache.catalina.core.StandardContext.start(StandardContext.java:
>> 5188)
>> at com.sun.enterprise.web.WebModule.start(WebModule.java:339)
>> at
>> org
>> .apache
>> .catalina.core.ContainerBase.addChildInternal(ContainerBase.java:973)
>> at
>> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:
>> 957)
>> at
>> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:688)
>> at
>> com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:
>> 3020)
>> at
>> com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:
>> 2646)
>> at
>> com.sun.enterprise.web.WebApplication.start(WebApplication.java:72)
>> at
>> com.sun.enterprise.web.WebApplication.start(WebApplication.java:63)
>> at
>> com
>> .sun
>> .enterprise
>> .v3
>> .server.ApplicationLifecycle.startModules(ApplicationLifecycle.java:
>> 609)
>> at
>> com
>> .sun
>> .enterprise
>> .v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:257)
>> at org.glassfish.embed.GlassFish.deploy(GlassFish.java:422)
>> at org.glassfish.maven.RunMojo.execute(RunMojo.java:132)
>> at
>> org
>> .apache
>> .maven
>> .plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:
>> 451)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor
>> .executeGoals(DefaultLifecycleExecutor.java:558)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor
>> .executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:
>> 482)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor
>> .executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor
>> .executeTaskSegments(DefaultLifecycleExecutor.java:291)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
>> at
>> org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:
>> 129)
>> at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)
>> at
>> sun
>> .reflect
>> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> at
>> sun
>> .reflect
>> .DelegatingMethodAccessorImpl
>> .invoke(DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>> at org.codehaus.classworlds.Launcher.launch(Launcher.java:
>> 255)
>> at
>> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>>
>> Nov 21, 2008 5:20:16 PM org.apache.catalina.core.ContainerBase
>> addChildInternal
>> SEVERE: ContainerBase.addChild: start:
>> LifecycleException: java.lang.ClassNotFoundException:
>> com.sun.jersey.spi.container.servlet.ServletContainer
>> at
>> org
>> .apache
>> .catalina.core.StandardContext.loadOnStartup(StandardContext.java:
>> 4810)
>> at
>> org.apache.catalina.core.StandardContext.start(StandardContext.java:
>> 5188)
>> at com.sun.enterprise.web.WebModule.start(WebModule.java:339)
>> at
>> org
>> .apache
>> .catalina.core.ContainerBase.addChildInternal(ContainerBase.java:973)
>> at
>> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:
>> 957)
>> at
>> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:688)
>> at
>> com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:
>> 3020)
>> at
>> com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:
>> 2646)
>> at
>> com.sun.enterprise.web.WebApplication.start(WebApplication.java:72)
>> at
>> com.sun.enterprise.web.WebApplication.start(WebApplication.java:63)
>> at
>> com
>> .sun
>> .enterprise
>> .v3
>> .server.ApplicationLifecycle.startModules(ApplicationLifecycle.java:
>> 609)
>> at
>> com
>> .sun
>> .enterprise
>> .v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:257)
>> at org.glassfish.embed.GlassFish.deploy(GlassFish.java:422)
>> at org.glassfish.maven.RunMojo.execute(RunMojo.java:132)
>> at
>> org
>> .apache
>> .maven
>> .plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:
>> 451)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor
>> .executeGoals(DefaultLifecycleExecutor.java:558)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor
>> .executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:
>> 482)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor
>> .executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor
>> .executeTaskSegments(DefaultLifecycleExecutor.java:291)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
>> at
>> org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:
>> 129)
>> at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)
>> at
>> sun
>> .reflect
>> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> at
>> sun
>> .reflect
>> .DelegatingMethodAccessorImpl
>> .invoke(DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>> at org.codehaus.classworlds.Launcher.launch(Launcher.java:
>> 255)
>> at
>> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>> Nov 21, 2008 5:20:16 PM com.sun.enterprise.web.WebContainer
>> loadWebModule
>> SEVERE: webcontainer.webModuleDisabled
>> java.lang.IllegalStateException: ContainerBase.addChild: start:
>> LifecycleException: java.lang.ClassNotFoundException:
>> com.sun.jersey.spi.container.servlet.ServletContainer
>> at
>> org
>> .apache
>> .catalina.core.ContainerBase.addChildInternal(ContainerBase.java:976)
>> at
>> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:
>> 957)
>> at
>> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:688)
>> at
>> com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:
>> 3020)
>> at
>> com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:
>> 2646)
>> at
>> com.sun.enterprise.web.WebApplication.start(WebApplication.java:72)
>> at
>> com.sun.enterprise.web.WebApplication.start(WebApplication.java:63)
>> at
>> com
>> .sun
>> .enterprise
>> .v3
>> .server.ApplicationLifecycle.startModules(ApplicationLifecycle.java:
>> 609)
>> at
>> com
>> .sun
>> .enterprise
>> .v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:257)
>> at org.glassfish.embed.GlassFish.deploy(GlassFish.java:422)
>> at org.glassfish.maven.RunMojo.execute(RunMojo.java:132)
>> at
>> org
>> .apache
>> .maven
>> .plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:
>> 451)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor
>> .executeGoals(DefaultLifecycleExecutor.java:558)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor
>> .executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:
>> 482)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor
>> .executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor
>> .executeTaskSegments(DefaultLifecycleExecutor.java:291)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
>> at
>> org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:
>> 129)
>> at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)
>> at
>> sun
>> .reflect
>> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> at
>> sun
>> .reflect
>> .DelegatingMethodAccessorImpl
>> .invoke(DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>> at org.codehaus.classworlds.Launcher.launch(Launcher.java:
>> 255)
>> at
>> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>> Nov 21, 2008 5:20:16 PM com.sun.enterprise.web.WebApplication start
>> SEVERE: Error while deploying
>> java.lang.IllegalStateException: ContainerBase.addChild: start:
>> LifecycleException: java.lang.ClassNotFoundException:
>> com.sun.jersey.spi.container.servlet.ServletContainer
>> at
>> org
>> .apache
>> .catalina.core.ContainerBase.addChildInternal(ContainerBase.java:976)
>> at
>> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:
>> 957)
>> at
>> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:688)
>> at
>> com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:
>> 3020)
>> at
>> com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:
>> 2646)
>> at
>> com.sun.enterprise.web.WebApplication.start(WebApplication.java:72)
>> at
>> com.sun.enterprise.web.WebApplication.start(WebApplication.java:63)
>> at
>> com
>> .sun
>> .enterprise
>> .v3
>> .server.ApplicationLifecycle.startModules(ApplicationLifecycle.java:
>> 609)
>> at
>> com
>> .sun
>> .enterprise
>> .v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:257)
>> at org.glassfish.embed.GlassFish.deploy(GlassFish.java:422)
>> at org.glassfish.maven.RunMojo.execute(RunMojo.java:132)
>> at
>> org
>> .apache
>> .maven
>> .plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:
>> 451)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor
>> .executeGoals(DefaultLifecycleExecutor.java:558)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor
>> .executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:
>> 482)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor
>> .executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor
>> .executeTaskSegments(DefaultLifecycleExecutor.java:291)
>> at
>> org
>> .apache
>> .maven
>> .lifecycle
>> .DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
>> at
>> org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:
>> 129)
>> at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)
>> at
>> sun
>> .reflect
>> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> at
>> sun
>> .reflect
>> .DelegatingMethodAccessorImpl
>> .invoke(DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>> at org.codehaus.classworlds.Launcher.launch(Launcher.java:
>> 255)
>> at
>> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>> Hit ENTER for redeploy
>>
>> What's missing ?
>>
>> -Arun
>>
>