Grails
  1. Grails
  2. GRAILS-4986

Cannot deploy multiple apps with different databases with shared lib folder

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1.1
    • Fix Version/s: None
    • Component/s: Persistence
    • Labels:
      None
    • Environment:
      Jboss 4.02 running on SUSE

      Description

      If you run more than one app on the same server, where each app is compiled with the "nojars" option, and all the libs are shared in the container's lib folder (jboss lib folder in my case), both apps end up pointing at the same database (the one deployed first)

      If you create a normal war file with all jars, but remove all but the grails-*.jar files, everything is fine.

      See this thread for initial discussion:
      http://www.nabble.com/App2-takes-App1's-database-td24972459.html

        Activity

        Hide
        srinath a added a comment -

        Hi i too facing the same issue when multiple wars are deployed on liferay. I followed your solution keeping only grails-*.jar files in war and rest of jars in tomcat/shared/lib .

        But still i was getting issues like this :

        SEVERE: StandardWrapper.Throwable
        java.lang.LinkageError: loader constraint violation: when resolving field "logger" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the referring class, org/springframework/web/servlet/HttpServletBean, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for the field's resolved type, org/apache/commons/logging/Log, have different Class objects for that type
        at org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.initMultipartResolver(GrailsDispatcherServlet.java:93)
        at org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.initFrameworkServlet(GrailsDispatcherServlet.java:80)
        at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:283)
        at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
        at javax.servlet.GenericServlet.init(GenericServlet.java:212)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4371)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:516)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
        <b>19 Feb, 2010 12:30:12 AM org.apache.catalina.core.StandardContext loadOnStartup
        SEVERE: Servlet /public_associations_jan09-0.1 threw load() exception
        java.lang.LinkageError: loader constraint violation: when resolving field "logger" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the referring class, org/springframework/web/servlet/HttpServletBean, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for the field's resolved type, org/apache/commons/logging/Log, have different Class objects for that type</b>
        at org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.initMultipartResolver(GrailsDispatcherServlet.java:93)
        at org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.initFrameworkServlet(GrailsDispatcherServlet.java:80)
        at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:283)
        at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
        at javax.servlet.GenericServlet.init(GenericServlet.java:212)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4371)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:516)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

        can any one help me why it occurs ?

        thanks in advance.

        Show
        srinath a added a comment - Hi i too facing the same issue when multiple wars are deployed on liferay. I followed your solution keeping only grails-*.jar files in war and rest of jars in tomcat/shared/lib . But still i was getting issues like this : SEVERE: StandardWrapper.Throwable java.lang.LinkageError: loader constraint violation: when resolving field "logger" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the referring class, org/springframework/web/servlet/HttpServletBean, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for the field's resolved type, org/apache/commons/logging/Log, have different Class objects for that type at org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.initMultipartResolver(GrailsDispatcherServlet.java:93) at org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.initFrameworkServlet(GrailsDispatcherServlet.java:80) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:283) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4371) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) <b>19 Feb, 2010 12:30:12 AM org.apache.catalina.core.StandardContext loadOnStartup SEVERE: Servlet /public_associations_jan09-0.1 threw load() exception java.lang.LinkageError: loader constraint violation: when resolving field "logger" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the referring class, org/springframework/web/servlet/HttpServletBean, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for the field's resolved type, org/apache/commons/logging/Log, have different Class objects for that type</b> at org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.initMultipartResolver(GrailsDispatcherServlet.java:93) at org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.initFrameworkServlet(GrailsDispatcherServlet.java:80) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:283) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4371) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) can any one help me why it occurs ? thanks in advance.
        Hide
        Ganesh Krishnan added a comment -

        Any updates on this issue? This also occurs with Glassfish Webapplication server. I spent few nightmarish days trying to work it out and gave up.

        Show
        Ganesh Krishnan added a comment - Any updates on this issue? This also occurs with Glassfish Webapplication server. I spent few nightmarish days trying to work it out and gave up.

          People

          • Assignee:
            Unassigned
            Reporter:
            Dale Wiggins
          • Votes:
            11 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

            • Created:
              Updated:
              Last Reviewed:

              Development