glassfish
  1. glassfish
  2. GLASSFISH-20732

java.lang.OutOfMemoryError: PermGen space error during re-deployment of EARs from IDE (Netbeans/Eclipse)

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 4.0_b89_RC5
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Mac OS X, Glassfish 4 Build 89, Netbeans 7.3.1, Eclipse 4.3 (Kepler)

      Description

      There seems to be a Memory Leak available in Glassfish 4 which becomes visible when you deploy ear files again and again. This error is also available in Glassfish 3. Working with ear projects does not make fun at all as long as the issue is not fixed. My productivity is during development is also decreased a lot!!!! Therefore I believe this issue is at least critical.

      Please download the ear file from http://localhost:8080/download/tutorials/struts2/struts2-multi-module-demo.zip. It comes from my tutorial at http://www.nabisoft.com/tutorials/struts2/maven-struts-2-enterprise-application-based-on-java-ee-7-and-glassfish-4, so please check there for details about what you can find in the ear archive. Basically it is a Struts 2 project based on Java EE 7, Tiles, maven...

      The bug can be reproduced in Eclipse and Netbeans, so I guess this is not an Eclipse nor a Netbeans issue. To reproduce the bug do the following in your Netbeans IDE (or Eclipse):

      1. Make sure to adapt the persistence.xml in the struts2-module-ejb module and make sure the corresponding JDBC resource is available on your Glassfish 4 (for details see the tutorial, which uses a PostgreSQL database).
      2. import the project into Netbeans
      3. deploy to your local Glassfish 4 server from within Netbeans and wait until deployment has finished
      4. go to MessageServiceBean.java (struts2-module-ejb module), change something (i.e. add an empty line somewhere)
      5. save the change to trigger a re-deployment
      6. wait until re-deployment has finished
      7. in your browser hit http://localhost:8080/service/message/ (I think this step helps to make the bug occur earlier than without this step)
      8. check the glassfish output in netbeans
      9. repeat steps 4-7 about 20-35 times (check glassfish output after each re-deployment).

      I typically get this error after around 10-25 re-deployments. Please let me know if you can reproduce the issue, I am willing to help as much as I can!

      Below you can see how the error looks like (by the way: after restarting Glassfish after the error the deployed application is not deployed anymore). Depending on when exactly theOutOfMemory error happens you will get a slightly different log or stack trace. In the past I have this error much faster with large ear projects, but my clients do not allow me to publish details...

      EXAMPLE 1:

       
      INFO: Loading application struts2-module-ear#struts2-module-service-1.0-SNAPSHOT.war at [/service]
      WARNING: Unable to load class com.nabisoft.jaxrs.application.ApplicationConfig, reason: java.lang.ClassNotFoundException: com.nabisoft.jaxrs.application.ApplicationConfig
      WARNING: Unable to load class com.nabisoft.jaxrs.application.ApplicationConfig, reason: java.lang.ClassNotFoundException: com.nabisoft.jaxrs.application.ApplicationConfig
      WARNING: Unable to load class com.nabisoft.jaxrs.provider.MyJacksonJsonProvider, reason: java.lang.ClassNotFoundException: com.nabisoft.jaxrs.provider.MyJacksonJsonProvider
      WARNING: Unable to load class com.nabisoft.tutorials.mavenstruts.service.MessageService, reason: java.lang.ClassNotFoundException: com.nabisoft.tutorials.mavenstruts.service.MessageService
      WARNING: Unable to load class com.nabisoft.tutorials.mavenstruts.service.MessageService, reason: java.lang.ClassNotFoundException: com.nabisoft.tutorials.mavenstruts.service.MessageService
      SEVERE: WebModule[/struts2-module-war]Exception starting filter struts2
      java.lang.OutOfMemoryError: PermGen space
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:1183)
      at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1728)
      at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1611)
      at org.apache.struts2.dispatcher.ng.InitOperations.cleanup(InitOperations.java:114)
      at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:69)
      at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
      at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:131)
      at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:5297)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:5909)
      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.execute(CommandRunnerImpl.java:537)
      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 org.glassfish.deployment.admin.ReDeployCommand.execute(ReDeployCommand.java:131)

      WARNING: java.lang.OutOfMemoryError: PermGen space
      java.lang.OutOfMemoryError: PermGen space
      at java.lang.Class.getDeclaredConstructors0(Native Method)
      at java.lang.Class.privateGetDeclaredConstructors(Class.java:2483)
      at java.lang.Class.getConstructor0(Class.java:2793)
      at java.lang.Class.newInstance(Class.java:345)
      at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:399)
      at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:396)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:395)
      at sun.reflect.MethodAccessorGenerator.generateSerializationConstructor(MethodAccessorGenerator.java:113)
      at sun.reflect.ReflectionFactory.newConstructorForSerialization(ReflectionFactory.java:331)
      at java.io.ObjectStreamClass.getSerializableConstructor(ObjectStreamClass.java:1376)
      at java.io.ObjectStreamClass.access$1500(ObjectStreamClass.java:72)
      at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:493)
      at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:468)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:468)
      at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:365)
      at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:602)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1620)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
      at org.apache.catalina.session.StandardManager.readSessions(StandardManager.java:550)
      at com.sun.enterprise.web.WebModule.loadSessions(WebModule.java:1762)
      at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2280)
      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)

      SEVERE: Exception while invoking class com.sun.enterprise.web.WebApplication start method
      java.lang.Exception: java.lang.OutOfMemoryError: PermGen space
      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.execute(CommandRunnerImpl.java:537)
      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 org.glassfish.deployment.admin.ReDeployCommand.execute(ReDeployCommand.java:131)
      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.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
      at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
      at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
      at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
      at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
      at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
      at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
      at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
      at java.lang.Thread.run(Thread.java:724)

      SEVERE: Exception during lifecycle processing
      java.lang.Exception: java.lang.OutOfMemoryError: PermGen space
      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.execute(CommandRunnerImpl.java:537)
      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 org.glassfish.deployment.admin.ReDeployCommand.execute(ReDeployCommand.java:131)
      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.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
      at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
      at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
      at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
      at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
      at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
      at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
      at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
      at java.lang.Thread.run(Thread.java:724)

      SEVERE: Exception while loading the app
      SEVERE: Ausnahme beim Deployment der Anwendung [struts2-module-ear]
      SEVERE: Exception during lifecycle processing
      java.lang.OutOfMemoryError: PermGen space
      at java.lang.Class.getDeclaredConstructors0(Native Method)
      at java.lang.Class.privateGetDeclaredConstructors(Class.java:2483)
      at java.lang.Class.getConstructor0(Class.java:2793)
      at java.lang.Class.newInstance(Class.java:345)
      at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:399)
      at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:396)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:395)
      at sun.reflect.MethodAccessorGenerator.generateSerializationConstructor(MethodAccessorGenerator.java:113)
      at sun.reflect.ReflectionFactory.newConstructorForSerialization(ReflectionFactory.java:331)
      at java.io.ObjectStreamClass.getSerializableConstructor(ObjectStreamClass.java:1376)
      at java.io.ObjectStreamClass.access$1500(ObjectStreamClass.java:72)
      at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:493)
      at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:468)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:468)
      at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:365)
      at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:602)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1620)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
      at org.apache.catalina.session.StandardManager.readSessions(StandardManager.java:550)
      at com.sun.enterprise.web.WebModule.loadSessions(WebModule.java:1762)
      at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2280)
      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)

      SEVERE: PermGen space
       

      EXAMPLE 2:

       
      WARNING: PER01000: Got SQLException executing statement "CREATE TABLE MESSAGES (ID SERIAL NOT NULL, CREATEDON TIMESTAMP NOT NULL, MESSAGE VARCHAR(64) NOT NULL, PRIMARY KEY (ID))": org.postgresql.util.PSQLException: ERROR: relation "messages" already exists
      INFO: EJB5181:Portable JNDI names for EJB MessageServiceBean: [java:global/struts2-module-ear/struts2-module-ejb/MessageServiceBean, java:global/struts2-module-ear/struts2-module-ejb/MessageServiceBean!com.nabisoft.tutorials.mavenstruts.ejb.MessageServiceBean]
      INFO: EJB5181:Portable JNDI names for EJB MessageService: [java:global/struts2-module-ear/struts2-module-service-1.0-SNAPSHOT/MessageService, java:global/struts2-module-ear/struts2-module-service-1.0-SNAPSHOT/MessageService!com.nabisoft.tutorials.mavenstruts.service.MessageService]
      WARNING: java.lang.OutOfMemoryError: PermGen space
      java.lang.OutOfMemoryError: PermGen space
      at sun.misc.Unsafe.defineClass(Native Method)
      at sun.reflect.ClassDefiner.defineClass(ClassDefiner.java:63)
      at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:399)
      at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:396)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:395)
      at sun.reflect.MethodAccessorGenerator.generateConstructor(MethodAccessorGenerator.java:94)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:48)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      at java.lang.reflect.Proxy.newInstance(Proxy.java:748)
      at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:739)
      at org.glassfish.external.statistics.impl.CountStatisticImpl.<init>(CountStatisticImpl.java:55)
      at org.glassfish.external.statistics.impl.CountStatisticImpl.<init>(CountStatisticImpl.java:69)
      at org.glassfish.web.admin.monitor.ServletInstanceStatsProvider.<init>(ServletInstanceStatsProvider.java:78)
      at org.glassfish.web.admin.monitor.WebStatsProviderBootstrap.registerApplicationStatsProviders(WebStatsProviderBootstrap.java:167)
      at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2275)
      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.execute(CommandRunnerImpl.java:537)
      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 org.glassfish.deployment.admin.ReDeployCommand.execute(ReDeployCommand.java:131)

      SEVERE: Exception while invoking class com.sun.enterprise.web.WebApplication start method
      java.lang.Exception: java.lang.OutOfMemoryError: PermGen space
      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.execute(CommandRunnerImpl.java:537)
      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 org.glassfish.deployment.admin.ReDeployCommand.execute(ReDeployCommand.java:131)
      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.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
      at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
      at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
      at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
      at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
      at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
      at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
      at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
      at java.lang.Thread.run(Thread.java:724)

      SEVERE: Exception during lifecycle processing
      java.lang.Exception: java.lang.OutOfMemoryError: PermGen space
      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.execute(CommandRunnerImpl.java:537)
      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 org.glassfish.deployment.admin.ReDeployCommand.execute(ReDeployCommand.java:131)
      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.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
      at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
      at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
      at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
      at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
      at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
      at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
      at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
      at java.lang.Thread.run(Thread.java:724)

      SEVERE: Exception while loading the app
      SEVERE: Undeployment failed for context /service
      SEVERE: Undeployment failed for context /struts2-module-war
      SEVERE: Exception while loading the app : java.lang.OutOfMemoryError: PermGen space
       

        Activity

        Hide
        nabizamani added a comment -

        My fault, the correct url for downloading the ear file is http://www.nabisoft.com/download/tutorials/struts2/struts2-multi-module-demo.zip

        Unfortunately, I have no permission to attach the ear file to this ticket and I have no permission to edit my previous post (for correcting the url...)

        Show
        nabizamani added a comment - My fault, the correct url for downloading the ear file is http://www.nabisoft.com/download/tutorials/struts2/struts2-multi-module-demo.zip Unfortunately, I have no permission to attach the ear file to this ticket and I have no permission to edit my previous post (for correcting the url...)
        Hide
        nabizamani added a comment -

        Can anyone reproduce this issue? I would be happy to help you reproducing the issue.

        ps
        I did not add all the external references above which seem to be spam! Can someone please remove them??

        Show
        nabizamani added a comment - Can anyone reproduce this issue? I would be happy to help you reproducing the issue. ps I did not add all the external references above which seem to be spam! Can someone please remove them??
        Hide
        mauritzlovgren added a comment -

        Also seeing this issue when redeploying artifacts to Glassfish a few times.

        Getting this during undeploy:

        [2013-12-05T18:24:38.309+0100] [glassfish 4.0] [SEVERE] [] [javax.enterprise.web.util] The web application [/crm] created a ThreadLocal with key of type [org.glassfish.pfl.dynamic.codegen.impl.CurrentClassLoader$1] (value [org.glassfish.pfl.dynamic.codegen.impl.CurrentClassLoader$1@742a8d28]) and a value of type [org.glassfish.web.loader.WebappClassLoader] (value [WebappClassLoader (delegate=true; repositories=WEB-INF/classes/)]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

        The amount of classes loaded in PermGen increases after each redeploy and never gets collected (even during Full GC), so seems there is a leak somewhere here.

        We use PrimeFaces 4.0.4 on GlassFish 4.0 b89. The issue is present whether deployment is performed through IDE (Eclipse / IntelliJ / NetBeans) or through asadmin / admin GUI.

        Show
        mauritzlovgren added a comment - Also seeing this issue when redeploying artifacts to Glassfish a few times. Getting this during undeploy: [2013-12-05T18:24:38.309+0100] [glassfish 4.0] [SEVERE] [] [javax.enterprise.web.util] The web application [/crm] created a ThreadLocal with key of type [org.glassfish.pfl.dynamic.codegen.impl.CurrentClassLoader$1] (value [org.glassfish.pfl.dynamic.codegen.impl.CurrentClassLoader$1@742a8d28] ) and a value of type [org.glassfish.web.loader.WebappClassLoader] (value [WebappClassLoader (delegate=true; repositories=WEB-INF/classes/)] ) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. The amount of classes loaded in PermGen increases after each redeploy and never gets collected (even during Full GC), so seems there is a leak somewhere here. We use PrimeFaces 4.0.4 on GlassFish 4.0 b89. The issue is present whether deployment is performed through IDE (Eclipse / IntelliJ / NetBeans) or through asadmin / admin GUI.

          People

          • Assignee:
            michael.y.chen
            Reporter:
            nabizamani
          • Votes:
            9 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

            • Created:
              Updated: