2 Replies Latest reply on Feb 4, 2014 11:05 AM by D. Alvarado

    How to configure the Maven-JBoss plugin to quit if an OutOfMemory error occurs?

    D. Alvarado Newbie

      Hi,

       

      I’m using JBoss 7.1.3.Final on Mac 10.9.1 and trying to deploy WAR files using the JBoss-Maven plugin (plugin version 7.5.Final and Maven version 3.1.1).  Occasionally, when deploying using the “deploy” goal, things will hang indefinitely because of this error on the server …

       

       

        14:57:37,036 ERROR [org.springframework.web.context.ContextLoader] (MSC service thread 1-1) Context initialization failed: java.lang.OutOfMemoryError: PermGen space

       

        14:57:37,036 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/myproject]] (MSC service thread 1-1) Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener: java.lang.OutOfMemoryError: PermGen space

       

      [code]

        14:57:43,319 WARN  [org.jboss.modules] (MSC service thread 1-1) Failed to define class org.springframework.web.util.Log4jWebConfigurer in Module "deployment.myproject.war:main" from Service Module Loader: java.lang.OutOfMemoryError: PermGen space

       

        14:57:52,738 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) Context [/myproject] startup failed due to previous errors: java.lang.OutOfMemoryError: PermGen space

       

        14:57:52,738 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) Context [/myproject] startup failed due to previous errors

      [/code]

       

      Unless the server is restarted, the Maven build will just hang forever.  Is there a way I can configure the Maven build to timeout and the deploy to fail if an error like the above occurs on the server?

       

      Thanks, - Dave