[GLASSFISH-20308] Unable to Deploy JAX-RS Restful Application Class Not Found JsonStructureBodyReader Created: 14/Apr/13  Updated: 03/May/13  Resolved: 03/May/13

Status: Resolved
Project: glassfish
Component/s: json
Affects Version/s: 4.0_b84_RC1
Fix Version/s: 4.0_b88_RC4, 4.0

Type: Bug Priority: Major
Reporter: peter_pilgrim Assignee: Michal Gajdos
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Embedded Container


Tags: 4_0-approved

 Description   

This should not be happening in the GlassFish

Surely application code does not need to refer or import an internal Glassfish class:

org/glassfish/json/jaxrs/JsonStructureBodyReader

Apr 14, 2013 1:58:11 PM org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer addServletWithDefaultConfiguration
INFO: Registering the Jersey servlet application, named javax.ws.rs.core.Application, with the following root resource and provider classes: [class je7hb.jaxrs.basic.RestfulBookService]
Apr 14, 2013 1:58:11 PM org.glassfish.jersey.server.ApplicationHandler initialize
INFO: Initiating Jersey application, version Jersey: 2.0-rc1 2013-03-26 02:00:32...
Apr 14, 2013 1:58:11 PM org.apache.catalina.core.StandardContext log
SEVERE: WebModule[/mywebapp]StandardWrapper.Throwable
java.lang.NoClassDefFoundError: org/glassfish/json/jaxrs/JsonStructureBodyReader
at org.glassfish.jersey.jsonp.JsonProcessingFeature.configure(JsonProcessingFeature.java:66)
at org.glassfish.jersey.model.internal.CommonConfig.configureFeatures(CommonConfig.java:617)
at org.glassfish.jersey.model.internal.CommonConfig.configureMetaProviders(CommonConfig.java:558)
at org.glassfish.jersey.server.ResourceConfig.configureMetaProviders(ResourceConfig.java:768)
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:313)
at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:146)
at org.glassfish.jersey.server.ApplicationHandler$3.run(ApplicationHandler.java:269)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:249)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:246)
at org.glassfish.jersey.internal.Errors.process(Errors.java:275)
at org.glassfish.jersey.internal.Errors.process(Errors.java:257)
at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:246)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:266)
at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:256)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:167)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:349)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1583)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1382)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5670)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5912)
at com.sun.enterprise.web.WebModule.start(WebModule.java:691)
at org.apache.catalina.core.ContainerBase.addChildInternal(Containeava:1041)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:747)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2278)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
at je7hb.common.webcontainer.embedded.glassfish.AbstractEmbeddedRunner.deployWithRename(AbstractEmbeddedRunner.java:86)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFileAndWait(SimpleEmbeddedRun ner.java:36)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFileAndWait(SimpleEmbeddedRunner.java:31)
at je7hb.jaxrs.basic.EmbeddedRunner.main(EmbeddedRunner.java:7)

Apr 14, 2013 1:58:11 PM org.apache.catalina.core.StandardContext log
SEVERE: WebModule[/mywebapp]Servlet /mywebapp threw load() exception
java.lang.NoClassDefFoundError: org/glassfish/json/jaxrs/JsonStructureBodyReader
at org.glassfish.jersey.jsonp.JsonProcessingFeature.configure(JsonProcessingFeature.java:66)
at org.glassfish.jersey.model.internal.CommonConfig.configureFeatures(CommonConfig.java:617)
at org.glassfish.jersey.model.internal.CommonConfig.configureMetaProviders(CommonConfig.java:558)
at org.glassfish.jersey.server.ResourceConfig.configureMetaProviders(ResourceConfig.java:768)
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:313)
at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:146)
at org.glassfish.jersey.server.ApplicationHandler$3.run(ApplicationHandler.java:269)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:249)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:246)
at org.glassfish.jersey.internal.Errors.process(Errors.java:275)
at org.glassfish.jersey.internal.Errors.process(Errors.java:257)
at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:246)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:266)
at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:256)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:167)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:349)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1583)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1382)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext670)a:5
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5912)
at com.sun.enterprise.web.WebModule.start(WebModule.java:691)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1041)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:747)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2278)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
at je7on.webcontainer.embedded.glassfish.AbstractEmbeddedRunner.deployWithRename(AbstractEmbeddedRunner.java:86)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFileAndWait(SimpleEmbeddedRunner.java:36)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFileAndWait(SimpleEmbeddedRunner.java:31)
at je7hb.jaxrs.basic.EmbeddedRunner.main(EmbeddedRunner.java:7)

Apr 14, 2013 1:58:11 PM org.apache.catalina.core.StandardContext start
SEVERE: Startup of context /mywebapp failed due to previous errors
Apr 14, 2013 1:58:11 PM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/glassfish/json/jaxrs/JsonStructureBodyReader
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5920)
at com.sun.enterprise.web.WebModule.start(WebModule.java:691)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1041)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:747)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2278)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterpridmin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
at je7hb.common.webcontainer.embedded.glassfish.AbstractEmbeddedRunner.deployWithRename(AbstractEmbeddedRunner.java:86)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFileAndWait(SimpleEmbeddedRunner.java:36)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFileAndWait(SimpleEmbeddedRunner.java:31)
at je7hb.jaxrs.basic.EmbeddedRunner.main(EmbeddedRunner.java:7)
Caused by: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/glassfish/json/jaxrs/JsonStructureBodyReader
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5678)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5912)
... 28 more
Caused by: java.lang.NoClassDefFoundError: org/glassfish/json/jaxrs/JsonStructureBodyReader
at org.glassfish.jersey.jsonp.JsonProcessingFeature.configure(JsonProcessingFeature.java:66)
at org.glassfish.jersey.model.internal.CommonConfig.configureFeatures(CommonConfig.java:617)
at org.glassfish.jersey.model.internal.CommonConfig.configureMetaProviders(CommonConfig.java:558)
at org.glassfish.jersey.server.ResourceConfig.configureMetaProviders(ResourceConfig.j)va:768
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:313)
at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:146)
at org.glassfish.jersey.server.ApplicationHandler$3.run(ApplicationHandler.java:269)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:249)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:246)
at org.glassfish.jersey.internal.Errors.process(Errors.java:275)
at org.glassfish.jersey.internal.Errors.process(Errors.java:257)
at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:246)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:266)
at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:256)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:167)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:349)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1583)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1382)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5670)
... 29 more

Apr 14, 2013 1:58:11 PM com.sun.enterprise.web.WebApplication start
WARNING: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/glassfish/json/jaxrs/JsonStructureBodyReader
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/glassfish/json/jaxrs/JsonStructureBodyReader
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1044)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:747)
at com.sun.enteweb.WebContainer.loadWebModule(WebContainer.java:2278)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
at je7hb.common.webcontainer.embedded.glassfish.AbstractEmbeddedRunner.deployWithRename(AbstractEmbeddedRunner.java:86)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFileAndWait(SimpleEmbeddedRunner.java:36)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFileAndWait(SimpleEmbeddedRunner.java:31)
at je7hb.jaxrs.basic.EmbeddedRunner.beddedRunner.java:7)

Apr 14, 2013 1:58:11 PM org.glassfish.internal.data.ModuleInfo start
SEVERE: Exception while invoking class com.sun.enterprise.web.WebApplication start method
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/glassfish/json/jaxrs/JsonStructureBodyReader
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
at je7hb.common.webcontainer.embedded.glassfish.AbstractEmbeddedRunner.deployWithRename(AbstractEmbeddedRunner.java:86)
je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFileAndWait(SimpleEmbeddedRunner.java:36)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFileAndWait(SimpleEmbeddedRunner.java:31)
at je7hb.jaxrs.basic.EmbeddedRunner.main(EmbeddedRunner.java:7)

Apr 14, 2013 1:58:11 PM com.sun.enterprise.v3.server.ApplicationLifecycle deploy
SEVERE: Exception during lifecycle processing
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/glassfish/json/jaxrs/JsonStructureBodyReader
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
at je7hb.common.webcontainer.embedded.glassfish.AbstractEmbeddedRunner.deployWithRename(AbstractEmbeddedRunner.java:86)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFileAndWait(SimpleEmbeddedRunner.java:36)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFileAndWait(SimpleEmbeddedRunner.java:31)
at je7hb.jaxrs.basic.EmbeddedRunner.main(EmbeddedRunner.java:7)

Apr 14, 2013 1:58:11 PM org.glassfish.api.ActionReport failure
SEVERE: Exception while loading the app
Apr 14, 2013 1:58:11 PM com.sun.enterprise.web.WebContainer unloadWebModule
SEVERE: Undeployment failed for context /mywebapp
Apr 14, 2013 1:58:11 PM org.glassfish.deployment.admin.DeployCommand execute
SEVERE: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/glassfish/json/jaxrs/JsonStructureBodyReader

        • Press the ENTER key to stop the server ****


 Comments   
Comment by Michal Gajdos [ 26/Apr/13 ]

Can you list modules under glassfish4\glassfish\modules? I am especially if you have jsonp-jaxrs.jar library.
How do you run your GF instance?

Comment by peter_pilgrim [ 26/Apr/13 ]

I am actually using the embedded GlassFish container in a Gradle build file and this is the environment where I found the JAX-RS failure.

Here is my Gradle build that specifies the dependencies that I use.

// build.gradle
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'

// Define equivalent Maven GAV coordinates.
group = 'com.javaeehandbook.book1'
archivesBaseName = 'ch08-jaxrs-basic'
version = '1.0'

repositories {
maven

{ url 'https://maven.java.net/content/groups/promoted' }

maven

{ url 'http://repository.jboss.org/nexus/content/groups/public' }

mavenCentral()
mavenLocal()
}

dependencies

{ providedCompile 'org.glassfish.main.extras:glassfish-embedded-all:4.0-b84' providedCompile 'javax:javaee-api:7.0-b84' providedCompile 'javax:javaee-web-api:7.0-b84' providedCompile 'com.javaeehandbook.book1:glassfish-embedded-runner:1.0' compile 'org.glassfish.main.extras:glassfish-embedded-all:4.0-b84' compile 'javax:javaee-api:7.0-b84' compile 'com.javaeehandbook.book1:glassfish-embedded-runner:1.0' testCompile 'junit:junit:4.11' }

task wrapper(type: Wrapper)

{ gradleVersion = '1.5' }

//End

Maybe this jsonp-jaxrs is not being build into the embedded Glassfish 4.0 bundle or something along those lines?

Hope that helps.

Comment by Michal Gajdos [ 26/Apr/13 ]

The problem seems to be in embedded GF itself - it contains all Jersey libs as regular GF but does not contain JSON-P classes. I've sent a patch to Jitu.

Comment by jitu [ 26/Apr/13 ]

Here is the michael's patch.

---------------
Index: appserver/extras/embedded/web/pom.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
— appserver/extras/embedded/web/pom.xml (revision 61635)
+++ appserver/extras/embedded/web/pom.xml (revision )
@@ -3,7 +3,7 @@

DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

  • Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.
    + Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved.

The contents of this file are subject to the terms of either the GNU
General Public License Version 2 only ("GPL") or the Common Development
@@ -237,6 +237,13 @@
<dependency>
<groupId>org.glassfish.main.packager</groupId>
<artifactId>jersey</artifactId>
+ <version>$

{project.version}</version>
+ <type>zip</type>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.main.packager</groupId>
+ <artifactId>json</artifactId>
<version>${project.version}

</version>
<type>zip</type>
<optional>true</optional>
Index: appserver/extras/embedded/all/pom.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
— appserver/extras/embedded/all/pom.xml (revision 61635)
+++ appserver/extras/embedded/all/pom.xml (revision )
@@ -3,7 +3,7 @@

DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

  • Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.
    + Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved.

The contents of this file are subject to the terms of either the GNU
General Public License Version 2 only ("GPL") or the Common Development
@@ -277,6 +277,13 @@
<dependency>
<groupId>org.glassfish.main.packager</groupId>
<artifactId>jersey</artifactId>
+ <version>$

{project.version}</version>
+ <type>zip</type>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.main.packager</groupId>
+ <artifactId>json</artifactId>
<version>${project.version}

</version>
<type>zip</type>
<optional>true</optional>

Comment by dapeng_hu [ 27/Apr/13 ]

Move plugin version definition from connectors sub modules to top level pom.xml.

Comment by buddypine [ 02/May/13 ]

I'm still getting this issue in 4.0-b87 using glassfish-embedded in a Gradle build, the org.glassfish.json package does not seem to be present in the jar.

05:30:16.083 [DEBUG] [TestEventLogger] java.lang.NoClassDefFoundError: org/glassfish/json/jaxrs/JsonStructureBodyReader
05:30:16.083 [DEBUG] [TestEventLogger] at org.glassfish.jersey.jsonp.JsonProcessingFeature.configure(JsonProcessingFeature.java:66)
05:30:16.083 [DEBUG] [TestEventLogger] at org.glassfish.jersey.model.internal.CommonConfig.configureFeatures(CommonConfig.java:617)
05:30:16.084 [DEBUG] [TestEventLogger] at org.glassfish.jersey.model.internal.CommonConfig.configureMetaProviders(CommonConfig.java:558)
05:30:16.084 [DEBUG] [TestEventLogger] at org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:361)
05:30:16.084 [DEBUG] [TestEventLogger] at org.glassfish.jersey.client.ClientConfig$State.access$000(ClientConfig.java:84)
05:30:16.084 [DEBUG] [TestEventLogger] at org.glassfish.jersey.client.ClientConfig$State$3.get(ClientConfig.java:116)
05:30:16.085 [DEBUG] [TestEventLogger] at org.glassfish.jersey.client.ClientConfig$State$3.get(ClientConfig.java:113)
05:30:16.085 [DEBUG] [TestEventLogger] at org.glassfish.jersey.internal.util.collection.Values$LazyValue.get(Values.java:275)
05:30:16.085 [DEBUG] [TestEventLogger] at org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:667)
05:30:16.085 [DEBUG] [TestEventLogger] at org.glassfish.jersey.client.ClientRequest.getClientRuntime(ClientRequest.java:169)
05:30:16.085 [DEBUG] [TestEventLogger] at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:629)
05:30:16.086 [DEBUG] [TestEventLogger] at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:366)
05:30:16.086 [DEBUG] [TestEventLogger] at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:270)

Comment by Michal Gajdos [ 03/May/13 ]

Reopening the issue as the patch was not applied and the issue was closed by mistake.

Comment by Michal Gajdos [ 03/May/13 ]
  • What is the impact on the customer of the bug?

Without the fix users won't be able to deploy a JAX-RS application into the embedded GF because jersey-media-json-processing requires javax.json, jsonp-jaxrs to be on the classpath (if these libraries are not present the mentioned exception would be raised).

  • What is the cost/risk of fixing the bug?

You can see the patch here [1] - adding json packager dependency to the embedded (all/web) modules.

[1] https://java.net/jira/browse/GLASSFISH-20308?focusedCommentId=362674&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_362674

  • Is there an impact on documentation or message strings?

No.

  • Which tests should QA (re)run to verify the fix did not destabilize GlassFish?

Deploy an JAX-RS application into an embedded GF instance + run all tests for Embedded GF.

  • Which is the targeted build of 4.0 for this fix?

88.

  • If this an integration of a new version of a component from another project,
    what are the changes that are being brought in? This might be list of
    Jira issues from that project or a list of revision messages.

N/A.

Comment by Tom Mueller [ 03/May/13 ]

Approved for 4.0. Please check the fix into the 4.0 branch and the trunk.

Generated at Tue May 03 07:12:02 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.