I want to deploy multiple grails applications on Jboss. Because they all use same grails version (2.1.1) I want to exclude common jars from war file and provide them via Jboss module. For starters, I'm trying with one application, but can't get it to work.
What I tried
- Set
defaultDependenciesProvided true
in BuildConfig.groovy (beforeinherits("global")
) - Created module folders: modules/commons/grails/main and put all the common jars in
- Created module.xml
- Added
Dependencies: commons.grails
to MANIFEST.MF file inside war - Tried to deploy the app
What happend
10:16:12,800 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "sofmk13-web-0.1.war"
10:16:23,095 WARN [org.jboss.modules] (MSC service thread 1-4) Failed to define class org.codehaus.groovy.grails.web.taglib.jsp.JspInvokeGrailsTagLibTag in Module "commons.grails:main" from local module loader @4ec57293 (roots: C:\development\tools\jboss-as-7.1.2.Final\modules,C:\development\repository\jboss): java.lang.LinkageError: Failed to link org/codehaus/groovy/grails/web/taglib/jsp/JspInvokeGrailsTagLibTag (Module "commons.grails:main" from local module loader @4ec57293 (roots: C:\development\tools\jboss-as-7.1.2.Final\modules,C:\development\repository\jboss))
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)
at org.jboss.modules.Module.loadModuleClass(Module.java:527)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_17]
at java.lang.ClassLoader.defineClass(ClassLoader.java:791) [rt.jar:1.7.0_17]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [rt.jar:1.7.0_17]
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)
at org.jboss.modules.Module.loadModuleClass(Module.java:527)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_17]
at java.lang.Class.forName(Class.java:266) [rt.jar:1.7.0_17]
at org.jboss.as.server.deployment.reflect.DeploymentClassIndex.classIndex(DeploymentClassIndex.java:54)
at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81) [jboss-as-ee-7.1.2.Final.jar:7.1.2.Final]
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17]
Caused by: java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/DynamicAttributes
at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_17]
at java.lang.ClassLoader.defineClass(ClassLoader.java:791) [rt.jar:1.7.0_17]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [rt.jar:1.7.0_17]
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)
... 31 more
Caused by: java.lang.ClassNotFoundException: javax.servlet.jsp.tagext.DynamicAttributes from [Module "commons.grails:main" from local module loader @4ec57293 (roots: C:\development\tools\jboss-as-7.1.2.Final\modules,C:\development\repository\jboss)]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
... 36 more
There is a lot of similar warnings for different classes.
Can somebody point me to what to try next? I can't decipher what exactly is wrong from the error message.
Thanks!