5 Replies Latest reply on Mar 9, 2012 2:33 AM by Kim Lindberg

    Groovy classloading issue

    Kim Lindberg Newbie

      We have a project which was originally built for JBoss 4, which we're now in progress upgrading to JBoss 7(.1)

       

      My current dilemma is that I have a spring bean which uses groovy, and when I create that bean, it fails with NoClassDefFoundError: groovy/lang/Script

       

      Thing is that it does find other classes from the groovy jar, since if I remove the groovy jar, it fails at an earlier stage, not finding groovy/util/ConfigSlurper

       

      I've tried having the groovy jar as a jboss module, as a jboss global module as well as shaded inside my own jar, but it always fails.

       

      The stacktrace doesn't have much information either:

       

      [Server:ivr] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageRouter' defined in URL [jar:file:/usr/java/jboss-as-7.1.0.Final/modules/com/tecnomen/ivr/system/ivr-message-service/main/ivr-message-service-2.0.0-6-SNAPSHOT.jar!/com/tecnomen/ivr/messaging/service/receiver/jms/applicationContext-message-service-jms.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
      [Server:ivr] PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'routing' threw exception; nested exception is java.lang.NoClassDefFoundError: groovy/lang/Script
      [Server:ivr]           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1396)
      [Server:ivr]           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
      [Server:ivr]           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
      [Server:ivr]           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      [Server:ivr]           at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
      [Server:ivr]           at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
      [Server:ivr]           at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
      [Server:ivr]           at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
      [Server:ivr]           at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
      [Server:ivr]           ... 30 more
      [Server:ivr] Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
      [Server:ivr] PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'routing' threw exception; nested exception is java.lang.NoClassDefFoundError: groovy/lang/Script
      [Server:ivr]           at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:102)
      [Server:ivr]           at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)
      [Server:ivr]           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1393)
      [Server:ivr]           ... 38 more
      [Server:ivr] 
      
      

       

      Anyone have any suggestion on what I could try?

        • 1. Re: Groovy classloading issue
          jaikiran pai Master

          It looks like that's not the entire exception stacktrace. Can you post the entire exception stacktrace?

          • 2. Re: Groovy classloading issue
            Kim Lindberg Newbie

            True, here is everything, but there isn't much more in it

             

            [Server:ivr] 14:28:19,635 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."GROOVY-ivr-messageservice.xml".DEPENDENCIES: org.jboss.msc.service.StartException in service jboss.deployment.unit."GROOVY-ivr-messageservice.xml".DEPENDENCIES: Failed to process phase DEPENDENCIES of deployment "GROOVY-ivr-messageservice.xml"
            [Server:ivr]           at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]
            [Server:ivr]           at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
            [Server:ivr]           at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
            [Server:ivr]           at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [classes.jar:1.6.0_29]
            [Server:ivr]           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [classes.jar:1.6.0_29]
            [Server:ivr]           at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_29]
            [Server:ivr] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageTransport' defined in URL [jar:file:/usr/java/jboss-as-7.1.0.Final/modules/com/tecnomen/ivr/system/ivr-message-service/main/ivr-message-service-2.0.0-6-SNAPSHOT.jar!/com/tecnomen/ivr/messaging/service/receiver/jms/applicationContext-message-service-jms.xml]: Cannot resolve reference to bean 'messageRouter' while setting bean property 'messageRouter'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageRouter' defined in URL [jar:file:/usr/java/jboss-as-7.1.0.Final/modules/com/tecnomen/ivr/system/ivr-message-service/main/ivr-message-service-2.0.0-6-SNAPSHOT.jar!/com/tecnomen/ivr/messaging/service/receiver/jms/applicationContext-message-service-jms.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
            [Server:ivr] PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'routing' threw exception; nested exception is java.lang.NoClassDefFoundError: groovy/lang/Script
            [Server:ivr]           at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
            [Server:ivr]           at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
            [Server:ivr]           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)
            [Server:ivr]           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
            [Server:ivr]           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
            [Server:ivr]           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
            [Server:ivr]           at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
            [Server:ivr]           at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
            [Server:ivr]           at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
            [Server:ivr]           at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
            [Server:ivr]           at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
            [Server:ivr]           at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
            [Server:ivr]           at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
            [Server:ivr]           at com.tecnomen.ivr.messaging.service.receiver.jms.JmsForwardingMessageListener.initJMSTransport(JmsForwardingMessageListener.java:94)
            [Server:ivr]           at com.tecnomen.ivr.messaging.service.receiver.jms.JmsForwardingMessageListener.init(JmsForwardingMessageListener.java:57)
            [Server:ivr]           at com.tecnomen.ivr.messaging.service.configuration.XMLConfigurationReader.initConfigurable(XMLConfigurationReader.java:128)
            [Server:ivr]           at com.tecnomen.ivr.messaging.service.configuration.XMLConfigurationReader.access$1100(XMLConfigurationReader.java:42)
            [Server:ivr]           at com.tecnomen.ivr.messaging.service.configuration.XMLConfigurationReader$ReportChannelXMLConfiguration.parseListener(XMLConfigurationReader.java:768)
            [Server:ivr]           at com.tecnomen.ivr.messaging.service.configuration.XMLConfigurationReader$ReportChannelXMLConfiguration.parse(XMLConfigurationReader.java:751)
            [Server:ivr]           at com.tecnomen.ivr.messaging.service.configuration.XMLConfigurationReader$ReportChannelXMLConfiguration.<init>(XMLConfigurationReader.java:743)
            [Server:ivr]           at com.tecnomen.ivr.messaging.service.configuration.XMLConfigurationReader$MessageServiceXMLConfiguration.parseReportChannel(XMLConfigurationReader.java:370)
            [Server:ivr]           at com.tecnomen.ivr.messaging.service.configuration.XMLConfigurationReader$MessageServiceXMLConfiguration.parse(XMLConfigurationReader.java:329)
            [Server:ivr]           at com.tecnomen.ivr.messaging.service.configuration.XMLConfigurationReader$MessageServiceXMLConfiguration.<init>(XMLConfigurationReader.java:314)
            [Server:ivr]           at com.tecnomen.ivr.messaging.service.configuration.XMLConfigurationReader.parseConfiguration(XMLConfigurationReader.java:47)
            [Server:ivr]           at com.tecnomen.ivr.messaging.service.MessageServiceDeployer.deploy(MessageServiceDeployer.java:188)
            [Server:ivr]           at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]
            [Server:ivr]           ... 5 more
            [Server:ivr] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageRouter' defined in URL [jar:file:/usr/java/jboss-as-7.1.0.Final/modules/com/tecnomen/ivr/system/ivr-message-service/main/ivr-message-service-2.0.0-6-SNAPSHOT.jar!/com/tecnomen/ivr/messaging/service/receiver/jms/applicationContext-message-service-jms.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
            [Server:ivr] PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'routing' threw exception; nested exception is java.lang.NoClassDefFoundError: groovy/lang/Script
            [Server:ivr]           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1396)
            [Server:ivr]           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
            [Server:ivr]           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
            [Server:ivr]           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
            [Server:ivr]           at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
            [Server:ivr]           at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
            [Server:ivr]           at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
            [Server:ivr]           at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
            [Server:ivr]           at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
            [Server:ivr]           ... 30 more
            [Server:ivr] Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
            [Server:ivr] PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'routing' threw exception; nested exception is java.lang.NoClassDefFoundError: groovy/lang/Script
            [Server:ivr]           at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:102)
            [Server:ivr]           at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)
            [Server:ivr]           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1393)
            [Server:ivr]           ... 38 more
            [Server:ivr] 
            [Server:ivr] 14:28:19,652 INFO  [org.jboss.as.server] (host-controller-connection-threads - 5) JBAS015870: Deploy of deployment "GROOVY-ivr-messageservice.xml" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"GROOVY-ivr-messageservice.xml\".DEPENDENCIES" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"GROOVY-ivr-messageservice.xml\".DEPENDENCIES: Failed to process phase DEPENDENCIES of deployment \"GROOVY-ivr-messageservice.xml\""}}
            
            
            • 3. Re: Groovy classloading issue
              jaikiran pai Master

              Hmm looks like some code is eating up the original exception stacktrace. Probably the org.springframework.beans.MethodInvocationException class. If you could somehow get the entire exception stacktrace, then that might help us understand what's going on. Also, note that a NoClassDefFoundError isn't the same as ClassNotFoundException, although most of the times the NoClassDefFoundError can result from a ClassNotFoundException. Sometimes a failing static block can trigger a NoClassDefFoundError too.

              • 4. Re: Groovy classloading issue
                Kim Lindberg Newbie

                Took some tweaking of spring code, but I found out where it lost the stacktrace and managed to print it out from there:

                 

                 

                [Server:ivr] 08:56:16,027 ERROR [stderr] (MSC service thread 1-15) org.springframework.beans.MethodInvocationException: Property 'routing' threw exception; nested exception is java.lang.NoClassDefFoundError: groovy/lang/Script
                [Server:ivr] 08:56:16,027 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1167)
                [Server:ivr] 08:56:16,028 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:924)
                [Server:ivr] 08:56:16,028 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:76)
                [Server:ivr] 08:56:16,029 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)
                [Server:ivr] 08:56:16,029 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1393)
                [Server:ivr] 08:56:16,030 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
                [Server:ivr] 08:56:16,031 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
                [Server:ivr] 08:56:16,031 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
                [Server:ivr] 08:56:16,032 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
                [Server:ivr] 08:56:16,033 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
                [Server:ivr] 08:56:16,033 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
                [Server:ivr] 08:56:16,034 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
                [Server:ivr] 08:56:16,034 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
                [Server:ivr] 08:56:16,035 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
                [Server:ivr] 08:56:16,035 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)
                [Server:ivr] 08:56:16,036 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
                [Server:ivr] 08:56:16,037 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
                [Server:ivr] 08:56:16,037 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
                [Server:ivr] 08:56:16,038 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
                [Server:ivr] 08:56:16,038 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
                [Server:ivr] 08:56:16,038 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
                [Server:ivr] 08:56:16,039 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
                [Server:ivr] 08:56:16,039 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
                [Server:ivr] 08:56:16,040 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
                [Server:ivr] 08:56:16,040 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
                [Server:ivr] 08:56:16,040 ERROR [stderr] (MSC service thread 1-15)           at com.tecnomen.ivr.messaging.service.receiver.jms.JmsForwardingMessageListener.initJMSTransport(JmsForwardingMessageListener.java:94)
                [Server:ivr] 08:56:16,041 ERROR [stderr] (MSC service thread 1-15)           at com.tecnomen.ivr.messaging.service.receiver.jms.JmsForwardingMessageListener.init(JmsForwardingMessageListener.java:57)
                [Server:ivr] 08:56:16,041 ERROR [stderr] (MSC service thread 1-15)           at com.tecnomen.ivr.messaging.service.configuration.XMLConfigurationReader.initConfigurable(XMLConfigurationReader.java:128)
                [Server:ivr] 08:56:16,042 ERROR [stderr] (MSC service thread 1-15)           at com.tecnomen.ivr.messaging.service.configuration.XMLConfigurationReader.access$1100(XMLConfigurationReader.java:42)
                [Server:ivr] 08:56:16,042 ERROR [stderr] (MSC service thread 1-15)           at com.tecnomen.ivr.messaging.service.configuration.XMLConfigurationReader$ReportChannelXMLConfiguration.parseListener(XMLConfigurationReader.java:768)
                [Server:ivr] 08:56:16,042 ERROR [stderr] (MSC service thread 1-15)           at com.tecnomen.ivr.messaging.service.configuration.XMLConfigurationReader$ReportChannelXMLConfiguration.parse(XMLConfigurationReader.java:751)
                [Server:ivr] 08:56:16,043 ERROR [stderr] (MSC service thread 1-15)           at com.tecnomen.ivr.messaging.service.configuration.XMLConfigurationReader$ReportChannelXMLConfiguration.<init>(XMLConfigurationReader.java:743)
                [Server:ivr] 08:56:16,043 ERROR [stderr] (MSC service thread 1-15)           at com.tecnomen.ivr.messaging.service.configuration.XMLConfigurationReader$MessageServiceXMLConfiguration.parseReportChannel(XMLConfigurationReader.java:370)
                [Server:ivr] 08:56:16,044 ERROR [stderr] (MSC service thread 1-15)           at com.tecnomen.ivr.messaging.service.configuration.XMLConfigurationReader$MessageServiceXMLConfiguration.parse(XMLConfigurationReader.java:329)
                [Server:ivr] 08:56:16,044 ERROR [stderr] (MSC service thread 1-15)           at com.tecnomen.ivr.messaging.service.configuration.XMLConfigurationReader$MessageServiceXMLConfiguration.<init>(XMLConfigurationReader.java:314)
                [Server:ivr] 08:56:16,045 ERROR [stderr] (MSC service thread 1-15)           at com.tecnomen.ivr.messaging.service.configuration.XMLConfigurationReader.parseConfiguration(XMLConfigurationReader.java:47)
                [Server:ivr] 08:56:16,045 ERROR [stderr] (MSC service thread 1-15)           at com.tecnomen.ivr.messaging.service.MessageServiceDeployer.deploy(MessageServiceDeployer.java:188)
                [Server:ivr] 08:56:16,045 ERROR [stderr] (MSC service thread 1-15)           at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113)
                [Server:ivr] 08:56:16,046 ERROR [stderr] (MSC service thread 1-15)           at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
                [Server:ivr] 08:56:16,046 ERROR [stderr] (MSC service thread 1-15)           at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
                [Server:ivr] 08:56:16,047 ERROR [stderr] (MSC service thread 1-15)           at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                [Server:ivr] 08:56:16,047 ERROR [stderr] (MSC service thread 1-15)           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                [Server:ivr] 08:56:16,047 ERROR [stderr] (MSC service thread 1-15)           at java.lang.Thread.run(Thread.java:680)
                [Server:ivr] 08:56:16,048 ERROR [stderr] (MSC service thread 1-15) Caused by: java.lang.NoClassDefFoundError: groovy/lang/Script
                [Server:ivr] 08:56:16,048 ERROR [stderr] (MSC service thread 1-15)           at java.lang.ClassLoader.defineClass1(Native Method)
                [Server:ivr] 08:56:16,048 ERROR [stderr] (MSC service thread 1-15)           at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
                [Server:ivr] 08:56:16,049 ERROR [stderr] (MSC service thread 1-15)           at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
                [Server:ivr] 08:56:16,049 ERROR [stderr] (MSC service thread 1-15)           at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
                [Server:ivr] 08:56:16,049 ERROR [stderr] (MSC service thread 1-15)           at groovy.lang.GroovyClassLoader.access$300(GroovyClassLoader.java:55)
                [Server:ivr] 08:56:16,050 ERROR [stderr] (MSC service thread 1-15)           at groovy.lang.GroovyClassLoader$ClassCollector.createClass(GroovyClassLoader.java:519)
                [Server:ivr] 08:56:16,050 ERROR [stderr] (MSC service thread 1-15)           at groovy.lang.GroovyClassLoader$ClassCollector.onClassNode(GroovyClassLoader.java:536)
                [Server:ivr] 08:56:16,050 ERROR [stderr] (MSC service thread 1-15)           at groovy.lang.GroovyClassLoader$ClassCollector.call(GroovyClassLoader.java:540)
                [Server:ivr] 08:56:16,051 ERROR [stderr] (MSC service thread 1-15)           at org.codehaus.groovy.control.CompilationUnit$14.call(CompilationUnit.java:776)
                [Server:ivr] 08:56:16,051 ERROR [stderr] (MSC service thread 1-15)           at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:967)
                [Server:ivr] 08:56:16,051 ERROR [stderr] (MSC service thread 1-15)           at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:546)
                [Server:ivr] 08:56:16,052 ERROR [stderr] (MSC service thread 1-15)           at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:524)
                [Server:ivr] 08:56:16,052 ERROR [stderr] (MSC service thread 1-15)           at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:501)
                [Server:ivr] 08:56:16,052 ERROR [stderr] (MSC service thread 1-15)           at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:306)
                [Server:ivr] 08:56:16,053 ERROR [stderr] (MSC service thread 1-15)           at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:287)
                [Server:ivr] 08:56:16,053 ERROR [stderr] (MSC service thread 1-15)           at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:267)
                [Server:ivr] 08:56:16,053 ERROR [stderr] (MSC service thread 1-15)           at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:214)
                [Server:ivr] 08:56:16,054 ERROR [stderr] (MSC service thread 1-15)           at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:224)
                [Server:ivr] 08:56:16,054 ERROR [stderr] (MSC service thread 1-15)           at groovy.lang.GroovyClassLoader$parseClass.call(Unknown Source)
                [Server:ivr] 08:56:16,054 ERROR [stderr] (MSC service thread 1-15)           at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
                [Server:ivr] 08:56:16,055 ERROR [stderr] (MSC service thread 1-15)           at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
                [Server:ivr] 08:56:16,055 ERROR [stderr] (MSC service thread 1-15)           at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
                [Server:ivr] 08:56:16,055 ERROR [stderr] (MSC service thread 1-15)           at groovy.util.ConfigSlurper.parse(ConfigSlurper.groovy:120)
                [Server:ivr] 08:56:16,056 ERROR [stderr] (MSC service thread 1-15)           at com.tecnomen.ivr.messaging.service.receiver.jms.FlexibleJmsMessageRouter.setRouting(FlexibleJmsMessageRouter.java:47)
                [Server:ivr] 08:56:16,056 ERROR [stderr] (MSC service thread 1-15)           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                [Server:ivr] 08:56:16,056 ERROR [stderr] (MSC service thread 1-15)           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                [Server:ivr] 08:56:16,057 ERROR [stderr] (MSC service thread 1-15)           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                [Server:ivr] 08:56:16,057 ERROR [stderr] (MSC service thread 1-15)           at java.lang.reflect.Method.invoke(Method.java:597)
                [Server:ivr] 08:56:16,057 ERROR [stderr] (MSC service thread 1-15)           at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1154)
                [Server:ivr] 08:56:16,058 ERROR [stderr] (MSC service thread 1-15)           ... 42 more
                [Server:ivr] 08:56:16,058 ERROR [stderr] (MSC service thread 1-15) Caused by: java.lang.ClassNotFoundException: groovy.lang.Script
                [Server:ivr] 08:56:16,058 ERROR [stderr] (MSC service thread 1-15)           at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
                [Server:ivr] 08:56:16,059 ERROR [stderr] (MSC service thread 1-15)           at java.security.AccessController.doPrivileged(Native Method)
                [Server:ivr] 08:56:16,059 ERROR [stderr] (MSC service thread 1-15)           at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
                [Server:ivr] 08:56:16,059 ERROR [stderr] (MSC service thread 1-15)           at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
                [Server:ivr] 08:56:16,059 ERROR [stderr] (MSC service thread 1-15)           at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:696)
                [Server:ivr] 08:56:16,060 ERROR [stderr] (MSC service thread 1-15)           at groovy.lang.GroovyClassLoader$InnerLoader.loadClass(GroovyClassLoader.java:449)
                [Server:ivr] 08:56:16,060 ERROR [stderr] (MSC service thread 1-15)           at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:805)
                [Server:ivr] 08:56:16,060 ERROR [stderr] (MSC service thread 1-15)           at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
                [Server:ivr] 08:56:16,061 ERROR [stderr] (MSC service thread 1-15)           ... 71 more
                
                
                • 5. Re: Groovy classloading issue
                  Kim Lindberg Newbie

                  And the stacktrace got made me realise the problem... Groovy was using the wrong classloader...

                   

                  Adding the following seems to have fixed that issue:

                   

                  configSlurper.setClassLoader(new GroovyClassLoader(this.getClass().getClassLoader()));
                  

                   

                  Thanks for your help