users@jersey.java.net

RE: [Jersey] Building web apps, what goes in the web.xml

From: Alex Sherwin <alex.sherwin_at_acadiasoft.com>
Date: Thu, 2 Oct 2008 12:01:53 -0400

I'm trying to switch from 0.8ea to 1.0ea... I've grabbed the 1.0 helloworld
web-app and looked at the web.xml.

Keep in mind, I'm not using NetBeans or maven (nor am I going to in this
project), and I'm finding it pretty difficult to figure out exactly what
dependencies and what Servlet and what init params I need to make it work.
Previously in 0.8ea I had this exception during deployment:

LifecycleException: java.lang.NoClassDefFoundError:
javax/ws/rs/core/Application

Which I ended up "fixing" in 0.8ea with the following Servlet init params:

    <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>com.acadiasoft.conduit.client.jaxrs.resource</param-value>
    </init-param>

However, now I am getting the exact same exception with 1.0ea, but using the
same init params (basically the exact same web.xml as helloworld web-app.
Same Servlet class, same init params, same url mapping).

The EAR I'm building (which contains a WAR with this web.xml) has the
following:

Still using from the 0.8 dist (removed jersey.jar when switching to 1.0):

activation.jar
asm-3.1.jar
jaxb-api.jar
jaxb-impl.jar
jsr173_api.jar
jsr311-api.jar

Using from new 1.0 dist:

jersey-bundle-1.0-ea-SNAPSHOT.jar


Also, I've removed the jersey files I installed into Glassfish with the
0.8ea dist (basically just deleted the jersey folder in the glassfish
installation. I did a full text and file search for other occurrences of
jersey, but I couldn't find anything else that the jersey "install" put into
glassfish)

The docs don't seem to say that you have to "install" the 1.0ea dist into
glassfish

Stack trace:

java.lang.IllegalStateException: ContainerBase.addChild: start:
LifecycleException: java.lang.NoClassDefFoundError:
javax/ws/rs/core/Application
 at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:9
76)
 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:1584)
 at
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1222)
 at
com.sun.enterprise.web.WebContainer.loadJ2EEApplicationWebModules(WebContain
er.java:1147)
 at
com.sun.enterprise.server.TomcatApplicationLoader.doLoad(TomcatApplicationLo
ader.java:141)
 at com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:244)
 at
com.sun.enterprise.server.ApplicationManager.applicationDeployed(Application
Manager.java:336)
 at
com.sun.enterprise.server.ApplicationManager.applicationDeployed(Application
Manager.java:210)
 at
com.sun.enterprise.server.ApplicationManager.applicationDeployed(Application
Manager.java:645)
 at
com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeploy
EventListener(AdminEventMulticaster.java:928)
 at
com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDeploy
Event(AdminEventMulticaster.java:912)
 at
com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEvent
Multicaster.java:461)
 at
com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEve
ntMulticaster.java:176)
 at
com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastE
vent(DeploymentNotificationHelper.java:308)
 at
com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(
DeploymentServiceUtils.java:226)
 at
com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(
ServerDeploymentTarget.java:298)
 at
com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(Applica
tionStartPhase.java:132)
 at
com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(Deploymen
tPhase.java:108)
 at
com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDe
ploymentService.java:919)
 at
com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeployment
Service.java:591)
 at
com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeployment
Service.java:635)
 at
com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(ApplicationsCo
nfigMBean.java:744)
 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:585)
 at
com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:
375)
 at
com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:
358)
 at
com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:
464)
 at
com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:
213)
 at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
 at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanSer
verInterceptor.java:815)
 at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
 at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at
com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
 at $Proxy1.invoke(Unknown Source)
 at
com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInte
rceptor.java:304)
 at
com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.
java:174)
 at
com.sun.enterprise.deployment.client.DeploymentClientUtils.startApplication(
DeploymentClientUtils.java:145)
 at
com.sun.enterprise.deployment.client.DeployAction.run(DeployAction.java:537)
 at java.lang.Thread.run(Thread.java:595)


Alex Sherwin
alex.sherwin_at_acadiasoft.com


-----Original Message-----
From: Paul.Sandoz_at_Sun.COM [mailto:Paul.Sandoz_at_Sun.COM]
Sent: Thursday, October 02, 2008 5:04 AM
To: users_at_jersey.dev.java.net
Subject: [Jersey] Building web apps, what goes in the web.xml

Hi Alex,

I presume you are the same Alex that commented on the wiki and send an
email about JAXB interfaces. I replied to your comment but thought
that it may be of interest to people on this list:

http://wikis.sun.com/display/Jersey/Main?focusedCommentId=47897145#comment-4
7897145

Paul.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
For additional commands, e-mail: users-help_at_jersey.dev.java.net