This discussion is archived
3 Replies Latest reply: Oct 26, 2012 11:24 AM by 970725 RSS

NoClassDefFound on previously running code within same jvm instance

970725 Newbie
Currently Being Moderated
Hi,

I want to use Bouncy Castle library within my enterprise application. I put the library jar onto the ear classpath.

I created java library that uses bouncy castle, I use my library in my application.
In all the classes I created in this library I initialize the provider like this:

static {
     if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) {
          Security.addProvider(new BouncyCastleProvider());
     }
}

The problem:
I successfully deploy my application, run it without problem. Then redeploy several times because of development cycle.
After several redeployments or long idle time, when I want to run again my application, I get ClassDefNotFound exception on provider related classes or enums.

Why does it seem that Glassfish forgets this class? Or the JVM itself? I'm not even sure this a Glassfish or general problem.

Thank you for your help

Last time I got this one:

[#|2012-10-25T18:39:04.584+0200|WARNING|glassfish3.1.1|javax.enterprise.system.core.classloading.com.sun.enterprise.loader|_ThreadID=22;_ThreadName=Thread-2;|LDR5207: ASURLClassLoader EarLibClassLoader :
doneCalled = true
doneSnapshot = ASURLClassLoader.done() called ON EarLibClassLoader :
urlSet = [URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/activation-1.1.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/activiti-cdi-5.9.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/activiti-engine-5.9.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/activiti-spring-5.9.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/ant-1.8.2.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/ant-launcher-1.8.2.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/antlr-2.7.7.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/antlr-3.3.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/antlr-runtime-3.3.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/aopalliance-1.0.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/bcmail-jdk16-1.46.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/bcprov-ext-jdk16-1.46.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/bcprov-jdk16-1.44.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/bctsp-jdk16-1.46.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/cert-cvc-4.0.10.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/commons-beanutils-1.7.0.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/commons-beanutils-core-1.8.0.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/commons-cli-20040117.000000.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/commons-codec-1.6.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/commons-collections-3.2.1.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/commons-configuration-1.6.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/commons-dbcp-1.4.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/commons-digester-1.8.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/commons-email-1.2.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/commons-io-2.4.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/commons-lang-2.4.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/commons-lang3-3.1.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/commons-logging-1.1.1.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/commons-pool-1.5.4.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/concurrent.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/dom4j-1.6.1.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/drools-compiler-5.4.0.Final.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/drools-core-5.4.0.Final.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/ecj-3.5.1.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/ejb3-persistence.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/ejbca-interface-4.0.10.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/ejbca-util-4.0.10.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/guava-11.0.2.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/hibernate-commons-annotations-4.0.1.Final.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/hibernate-core-4.0.1.Final.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/hibernate-entitymanager-4.0.1.Final.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/hibernate-jpa-2.0-api-1.0.1.Final.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/javassist-3.12.1.GA.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/javassist-3.15.0-GA.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/javax.inject-1.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jboss-aop-client.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jboss-aspect-jdk50-client.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jboss-common-core.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jboss-ejb3-common-client.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jboss-ejb3-core-client.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jboss-ejb3-proxy-clustered-client.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jboss-ejb3-proxy-impl-client.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jboss-ejb3-proxy-spi-client.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jboss-ejb3-security-client.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jboss-integration.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jboss-javaee.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jboss-logging-3.1.0.CR2.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jboss-logging-log4j.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jboss-remoting.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jboss-security-spi.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jboss-transaction-api_1.1_spec-1.0.0.Final.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jbosssx-client.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jcan-ee6-1.1.1.0.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jcan-log-api-1.6.0.0.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jcan-log-log4j-1.6.0.0.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jcan-optrace-1.1.0.0.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jersey-core-1.11.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jnp-client.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/jsr305-1.3.9.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/knowledge-api-5.4.0.Final.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/knowledge-internal-api-5.4.0.Final.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/livetribe-jsr223-2.0.6.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/log4j-1.2.16.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/mail-1.4.1.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/activation.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/mvel2-2.1.0.drools16.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/mybatis-3.0.6.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/mysql-connector-java-5.1.18.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/mycomponent-business-0.0.0.0-SNAPSHOT-client.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/mycomponent-common-0.0.0.0-SNAPSHOT.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/mycomponent-datamodel-0.0.0.0-SNAPSHOT.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/mycomponent-explorer-web-0.0.0.0-SNAPSHOT.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/mycomponent-pki-utils-0.0.0.0-SNAPSHOT.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/mycomponent-processes-0.0.0.0-SNAPSHOT.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/narvisidm-ws-2.21.3.1.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/narviswf-business-0.0.0.0-client.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/narviswf-common-0.0.0.0.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/narviswf-datamodel-0.0.0.0.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/narviswf-explorer-impl-0.0.0.0.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/narviswf-narvisidm-0.0.0.0.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/reflections-0.9.8.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/spring-aop-3.0.3.RELEASE.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/spring-asm-3.0.3.RELEASE.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/spring-beans-3.0.3.RELEASE.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/spring-context-3.0.3.RELEASE.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/spring-core-3.0.3.RELEASE.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/spring-expression-3.0.3.RELEASE.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/spring-jdbc-3.0.3.RELEASE.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/spring-orm-3.0.3.RELEASE.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/spring-test-3.0.3.RELEASE.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/spring-tx-3.0.3.RELEASE.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/spring-web-3.0.3.RELEASE.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/stringtemplate-3.2.1.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/vaadin-6.6.2.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/xml-apis-1.0.b2.jar, URLEntry : file:/C:/glassfish3/glassfish/domains/domain1/applications/mycomponent-application/lib/xmlsec-1.3.0.jar]
doneCalled = false
Parent -> org.glassfish.internal.api.DelegatingClassLoader@323b2

AT Thu Oct 25 18:21:16 CEST 2012
BY :java.lang.Throwable: printStackTraceToString
     at com.sun.enterprise.util.Print.printStackTraceToString(Print.java:639)
     at com.sun.enterprise.loader.ASURLClassLoader.done(ASURLClassLoader.java:211)
     at com.sun.enterprise.loader.ASURLClassLoader.preDestroy(ASURLClassLoader.java:179)
     at org.glassfish.javaee.full.deployment.EarClassLoader.preDestroy(EarClassLoader.java:114)
     at org.glassfish.internal.data.ApplicationInfo.unload(ApplicationInfo.java:355)
     at com.sun.enterprise.v3.server.ApplicationLifecycle.unload(ApplicationLifecycle.java:1000)
     at com.sun.enterprise.v3.server.ApplicationLifecycle.undeploy(ApplicationLifecycle.java:1025)
     at org.glassfish.deployment.admin.UndeployCommand.execute(UndeployCommand.java:330)
     at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:360)
     at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
     at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1064)
     at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
     at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1244)
     at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1232)
     at org.glassfish.deployment.admin.DeployCommand.handleRedeploy(DeployCommand.java:653)
     at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:267)
     at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
     at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
     at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1064)
     at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
     at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1244)
     at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1232)
     at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:459)
     at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:209)
     at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
     at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
     at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:238)
     at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
     at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
     at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
     at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
     at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
     at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
     at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
     at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
     at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
     at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
     at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
     at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
     at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
     at java.lang.Thread.run(Thread.java:662)
Parent -> org.glassfish.internal.api.DelegatingClassLoader@323b2
was requested to find class org.bouncycastle.jce.provider.JDKX509CertificateFactory after done was invoked from the following stack trace
java.lang.Throwable
     at com.sun.enterprise.loader.ASURLClassLoader.findClassData(ASURLClassLoader.java:780)
     at com.sun.enterprise.loader.ASURLClassLoader.findClass(ASURLClassLoader.java:696)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
     at java.security.Provider$Service.getImplClass(Provider.java:1262)
     at java.security.Provider$Service.newInstance(Provider.java:1220)
     at sun.security.jca.GetInstance.getInstance(GetInstance.java:220)
     at sun.security.jca.GetInstance.getInstance(GetInstance.java:190)
     at java.security.cert.CertificateFactory.getInstance(CertificateFactory.java:195)
     at org.bouncycastle.openssl.PEMReader$X509CertificateParser.parseObject(Unknown Source)
     at org.bouncycastle.openssl.PEMReader.readObject(Unknown Source)
     at my.project.pkiutils.PemUtils.certificateFromPemString(PemUtils.java:123)
     at my.project.mycomponent.rs.sign.CertificateFacade.verifySignedMessage(CertificateFacade.java:93)
     at my.project.mycomponent.rs.sign.org$jboss$weld$bean-mycomponent-services_war-ManagedBean-class_my$project$mycomponent$rs$sign$CertificateFacade_$$_WeldClientProxy.verifySignedMessage(org$jboss$weld$bean-mycomponent-services_war-ManagedBean-class_my$project$mycomponent$rs$sign$CertificateFacade_$$_WeldClientProxy.java)
     at my.project.mycomponent.rs.sign.SignedMessageJAXBUnmarshaller.readFrom(SignedMessageJAXBUnmarshaller.java:103)
     at com.sun.jersey.spi.container.ContainerRequest.getEntity(ContainerRequest.java:474)
     at com.sun.jersey.server.impl.model.method.dispatch.EntityParamDispatchProvider$EntityInjectable.getValue(EntityParamDispatchProvider.java:123)
     at com.sun.jersey.server.impl.inject.InjectableValuesProvider.getInjectableValues(InjectableValuesProvider.java:46)
     at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$EntityParamInInvoker.getParams(AbstractResourceMethodDispatchProvider.java:153)
     at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:183)
     at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
     at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
     at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
     at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
     at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
     at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
     at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
     at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
     at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
     at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
     at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
     at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
     at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
     at my.project.jcan.ee6.web.filters.RequestResponseLoggingFilter.doFilter(RequestResponseLoggingFilter.java:172)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
     at com.narvis.jcan.optrace.web.RequestContextFilter.doFilter(RequestContextFilter.java:115)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
     at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
     at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
     at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
     at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
     at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:232)
     at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
     at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
     at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
     at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
     at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
     at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
     at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
     at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
     at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
     at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
     at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
     at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
     at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
     at java.lang.Thread.run(Thread.java:662)
|#]

Edited by: user11017481 on 2012.10.26. 11:26
  • 1. Re: NoClassDefFound on previously running code within same jvm instance
    970804 Newbie
    Currently Being Moderated
    G'day

    I got this too.

    java.lang.ClassNotFoundException: org.bouncycastle.jce.provider.BouncyCastleProvider

    My code was working fine before I did a double upgrade - to Java 1.6.0_37 and Glassfish 3.1.2.2. So I can't shed light directly on whether it is a Java or Glassfish problem. But I can confirm the problem exists. My previous Glassfish was 3.1.2 and I didn't have the problem there. I see that user11017481 got the problem in Glassfish 3.1.1. So most likely the problem is in Java 1.6.0_37. That makes sense since BouncyCastle has been in Java for a long time and there would no need for it to be in Glassfish separately.

    The Java install as seen by my Glassfish includes: /Users/Ian/Library/Java/Extensions/bcprov-jdk15-143.jar

    My platform is Mac OS 10.6.8 while user11017481 is on some variant of Windows.
  • 2. Re: NoClassDefFound on previously running code within same jvm instance
    EJP Guru
    Currently Being Moderated
    That makes sense since BouncyCastle has been in Java for a long time
    BouncyCastle has never been in Java at all. It has always been a separate download.

    I suspect that someone put the BC jars into the previous JRE lib/ext directory, and hasn't done so for the new JRE.
  • 3. Re: NoClassDefFound on previously running code within same jvm instance
    970725 Newbie
    Currently Being Moderated
    It doesn't seem to be the same problem. I don't think either that BC has been provided with glassfish or JDK by default.
    I provide the library in the EAR file and is working fine. But after several redeployments the jvm seems to forget about the classes and cannot find them anymore on the classpath. Even though It's been found previously

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points