0 Replies Latest reply on Jan 24, 2012 11:07 AM by welsh

    JBoss AS 5.1 JMX (Twiddle) Start / Stop Grails App Issue

    welsh Newbie

      Hey Everyone,

       

      I'm having some issues with JMX starting and stoping a grails application. I'm using twiddle to access the JMX remotley and stoping/stopping the application with the following commands:

       

      ./twiddle.sh -u username -p password -s 10.98.8.61:1099 invoke "jboss.web.deployment:war=/my-grails" stop

      ./twiddle.sh -u username -p password -s 10.98.8.61:1099 invoke "jboss.web.deployment:war=/my-grails" start

       

      And the console makes it look like it starts and starts properly:

       

      16:52:00,349 INFO  [TomcatDeployment] undeploy, ctxPath=/my-grails

      16:52:00,351 INFO  [[/my-grails]] Destroying Spring FrameworkServlet 'grails'

      16:52:00,801 INFO  [[/my-grails]] Destroying Spring FrameworkServlet 'gsp'

      16:52:07,212 INFO  [[/my-grails]] Closing Spring root WebApplicationContext

      16:39:09,883 INFO  [TomcatDeployment] deploy, ctxPath=/my-grails

      16:39:09,954 INFO  [[/my-grails]] Initializing Spring root WebApplicationContext

      16:39:16,898 INFO  [[/my-grails]] Initializing Spring FrameworkServlet 'grails'

       

      Which shows no errors until I try to navigate to the context path, which causes the logs to throw up:

       

      16:52:51,456 INFO  [[/my-grails]] Initializing Spring FrameworkServlet 'gsp'

      16:52:51,456 INFO  [[/my-grails]] GSP servlet initialized

      16:52:51,521 INFO  [STDOUT] 16:52:51.518 | [ERROR] | errors.GrailsExceptionResolver | Exception occurred when processing request: [GET] /my-grails/

      Stacktrace follows:

      org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: Error executing tag <g:render>: Error executing tag <g:link>: Error creating bean with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib': Instantiation of bean failed; nested exception is java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext at /WEB-INF/grails-app/views/common/includes/_lockup.gsp:1 at /WEB-INF/grails-app/views/layouts/pano.gsp:51

              at gsp_myGrailsApp_layoutspano_gsp$_run_closure2.doCall(pano.gsp:51)

              at gsp_myGrailsApp_layoutspano_gsp$_run_closure2.doCall(pano.gsp)

              at gsp_myGrailsApp_layoutspano_gsp.run(pano.gsp:156)

              at com.studentsonly.grails.plugins.uiperformance.CacheFilter.doFilter(CacheFilter.java:67)

              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)

              at org.jboss.web.tomcat.service.session.ClusteredSessionValve.handleRequest(ClusteredSessionValve.java:135)

              at org.jboss.web.tomcat.service.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:94)

              at org.jboss.web.tomcat.service.session.JvmRouteValve.invoke(JvmRouteValve.java:88)

              at org.jboss.web.tomcat.service.session.LockingValve.invoke(LockingValve.java:62)

              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)

              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

              at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.internalProcess(ActiveRequestResponseCacheValve.java:74)

              at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:47)

              at java.lang.Thread.run(Thread.java:662)

      Caused by: org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: Error executing tag <g:link>: Error creating bean with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib': Instantiation of bean failed; nested exception is java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext at /WEB-INF/grails-app/views/common/includes/_lockup.gsp:1

              at gsp_myGrailsApp_common_includes_lockup_gsp.run(_lockup.gsp:1)

              ... 17 more

      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib': Instantiation of bean failed; nested exception is java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

              ... 18 more

      Caused by: java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

              ... 18 more

       

      Now, I've done the start and stop through the admin-console and it works perfectly fine as proven by this log entry:

       

      16:44:11,341 INFO  [DeployHandler] Stop, [vfsfile:/apps/jboss-eap-5.1/jboss-as/server/node2/deploy/my-grails.war/]

      16:44:11,349 INFO  [TomcatDeployment] undeploy, ctxPath=/my-grails

      16:44:11,355 INFO  [[/my-grails]] Destroying Spring FrameworkServlet 'grails'

      16:44:11,843 INFO  [[/my-grails]] Destroying Spring FrameworkServlet 'gsp'

      16:44:19,165 INFO  [[/my-grails]] Closing Spring root WebApplicationContext

      16:44:19,185 INFO  [DeployHandler] End stop, [vfsfile:/apps/jboss-eap-5.1/jboss-as/server/node2/deploy/my-grails.war/]

      16:44:25,349 INFO  [DeployHandler] Begin start, [vfsfile:/apps/jboss-eap-5.1/jboss-as/server/node2/deploy/my-grails.war/]

      16:44:30,040 INFO  [TomcatDeployment] deploy, ctxPath=/my-grails

      16:44:30,117 ERROR [STDERR] log4j:ERROR A "org.jboss.logging.appender.FileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.

      16:44:30,117 ERROR [STDERR] log4j:ERROR The class "org.apache.log4j.Appender" was loaded by

      16:44:30,117 ERROR [STDERR] log4j:ERROR [BaseClassLoader@42c00877{vfsfile:/apps/jboss-eap-5.1/jboss-as/server/node2/deploy/my-grails.war/}] whereas object of type

      16:44:30,117 ERROR [STDERR] log4j:ERROR "org.jboss.logging.appender.FileAppender" was loaded by [org.jboss.bootstrap.NoAnnotationURLClassLoader@6ac2a132].

      16:44:30,117 ERROR [STDERR] log4j:ERROR Could not instantiate appender named "FILE".

      16:44:30,664 INFO  [[/my-grails]] Initializing Spring root WebApplicationContext

      16:44:31,507 ERROR [STDERR] SLF4J: Class path contains multiple SLF4J bindings.

      16:44:31,507 ERROR [STDERR] SLF4J: Found binding in [vfszip:/apps/jboss-eap-5.1/jboss-as/common/lib/slf4j-jboss-logging.jar/org/slf4j/impl/StaticLoggerBinder.class]

      16:44:31,507 ERROR [STDERR] SLF4J: Found binding in [vfszip:/apps/jboss-eap-5.1/jboss-as/server/node2/deploy/my-grails.war/WEB-INF/lib/slf4j-log4j12-1.5.8.jar/org/slf4j/impl/StaticLoggerBinder.class]

      16:44:31,507 ERROR [STDERR] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

      16:44:43,847 INFO  [[/my-grails]] Initializing Spring FrameworkServlet 'grails'

      16:44:43,866 INFO  [DeployHandler] End start, [vfsfile:/apps/jboss-eap-5.1/jboss-as/server/node2/deploy/my-grails.war/]

      16:44:51,669 INFO  [[/my-grails]] Initializing Spring FrameworkServlet 'gsp'

      16:44:51,670 INFO  [[/my-grails]] GSP servlet initialized

       

      So from what I can determine is that the way JBoss admin console works is different from the JMX console and whatever that difference is, is causing my grails application to blow up.

       

      I'm wondering if anyone has had similiar issues with this, any help would be appreciated!

       

      Thanks,

       

      Welsh