Quantcast

Error deploying 2.1.0 war to tomcat6

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Error deploying 2.1.0 war to tomcat6

MLoe
This post has NOT been accepted by the mailing list yet.
For some reason the generated war file contains some tomcat7 files

tomcat-catalina-ant-7.0.27.jar
tomcat-embed-core-7.0.27.jar
tomcat-embed-jasper-7.0.27.jar
tomcat-embed-logging-juli-7.0.27.jar
tomcat-embed-logging-log4j-7.0.27.jar
trilead-ssh2-build213-svnkit-1.3-patch.jar

That leads to an error on startup:

INFO: validateJarFile(/usr/share/tomcat6/webapps/wiso-om-2.0.3/WEB-INF/lib/tomcat-embed-core-7.0.27.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

How can I avoid to get these files deployed?

Thanks, Michael
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error deploying 2.1.0 war to tomcat6

Julian Shen
This post has NOT been accepted by the mailing list yet.
I am having the same problem after upgraded from 1.3.9.
I am deploying it to Tomcat 7.0.25.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error deploying 2.1.0 war to tomcat6

floorflux
I'm having the same issue as well.  Everything worked fine with Grails 2.0.4.  Upgraded to 2.1.0 and get the same error message in the tomcat logs.  Tomcat version is 7.0.22.

INFO: validateJarFile(..../apache-tomcat-7.0.22/webapps/project/WEB-INF/lib/tomcat-embed-core-7.0.27.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Jul 12, 2012 3:43:43 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(..../apache-tomcat-7.0.22/webapps/project/WEB-INF/lib/tomcat-servlet-api-7.0.27.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Jul 12, 2012 3:43:43 PM org.apache.tomcat.util.digester.Digester endElement
SEVERE: End event threw exception
java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addServlet
        at org.apache.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:803)
        at org.apache.tomcat.util.digester.SetNextRule.end(SetNextRule.java:201)
        at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1051)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)
        at org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1759)
        at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1252)
        at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:896)
        at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:322)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5103)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:633)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:558)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1329)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:389)
        at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:334)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1041)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:621)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error deploying 2.1.0 war to tomcat6

MLoe
This post has NOT been accepted by the mailing list yet.
As workaround I tried to delete the files by adding


        grails.war.resources = { stagingDir, args ->
            println("grails.war.resources: stagingDir=$stagingDir, args=$args")
            delete(file:"${stagingDir}/WEB-INF/lib/tomcat-catalina-ant-7.0.27.jar")
            delete(file:"${stagingDir}/WEB-INF/lib/tomcat-embed-core-7.0.27.jar")
            delete(file:"${stagingDir}/WEB-INF/lib/tomcat-embed-jasper-7.0.27.jar")
            delete(file:"${stagingDir}/WEB-INF/lib/tomcat-embed-logging-juli-7.0.27.jar")
            delete(file:"${stagingDir}/WEB-INF/lib/tomcat-embed-logging-log4j-7.0.27.jar")
        }

to Config.groovy. But the files still remain in the war. The println did not appear :(

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error deploying 2.1.0 war to tomcat6

MLoe
This post has NOT been accepted by the mailing list yet.
Finally this work around helped:

Scripts/_Events.groovy:

...

eventCreateWarStart = { warName, stagingDir ->
    new File("${stagingDir}/WEB-INF/lib/tomcat-catalina-ant-7.0.27.jar").delete()
    new File("${stagingDir}/WEB-INF/lib/tomcat-catalina-ant-7.0.27.jar").delete()
    new File("${stagingDir}/WEB-INF/lib/tomcat-embed-core-7.0.27.jar").delete()
    new File("${stagingDir}/WEB-INF/lib/tomcat-embed-jasper-7.0.27.jar").delete()
    new File("${stagingDir}/WEB-INF/lib/tomcat-embed-logging-juli-7.0.27.jar").delete()
    new File("${stagingDir}/WEB-INF/lib/tomcat-embed-logging-log4j-7.0.27.jar").delete()
}

But this is only a work around. I'd like to understand, why these files are deployed.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error deploying 2.1.0 war to tomcat6

Graeme Rocher-4
Administrator
In reply to this post by floorflux
It appears you have the Grails tomcat jars inside your lib directory
of your app, what scope do you have the tomcat plugin defined in?

Cheers

On Fri, Jul 13, 2012 at 12:26 AM, floorflux <[hidden email]> wrote:

> I'm having the same issue as well.  Everything worked fine with Grails 2.0.4.
> Upgraded to 2.1.0 and get the same error message in the tomcat logs.  Tomcat
> version is 7.0.22.
>
> INFO:
> validateJarFile(..../apache-tomcat-7.0.22/webapps/project/WEB-INF/lib/tomcat-embed-core-7.0.27.jar)
> - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class:
> javax/servlet/Servlet.class
> Jul 12, 2012 3:43:43 PM org.apache.catalina.loader.WebappClassLoader
> validateJarFile
> INFO:
> validateJarFile(..../apache-tomcat-7.0.22/webapps/project/WEB-INF/lib/tomcat-servlet-api-7.0.27.jar)
> - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class:
> javax/servlet/Servlet.class
> Jul 12, 2012 3:43:43 PM org.apache.tomcat.util.digester.Digester endElement
> SEVERE: End event threw exception
> java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml
> addServlet
>         at
> org.apache.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:803)
>         at org.apache.tomcat.util.digester.SetNextRule.end(SetNextRule.java:201)
>         at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1051)
>         at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown
> Source)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown
> Source)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown
> Source)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown
> Source)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
>         at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)
>         at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)
>         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
> Source)
>         at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
> Source)
>         at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
> Source)
>         at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)
>         at
> org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1759)
>         at
> org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1252)
>         at
> org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:896)
>         at
> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:322)
>         at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>         at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>         at
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5103)
>         at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
>         at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
>         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
>         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
>         at
> org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:633)
>         at
> org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:558)
>         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468)
>         at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1329)
>         at
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
>         at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>         at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>         at
> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:389)
>         at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:334)
>         at
> org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1041)
>         at
> org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
>         at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
>         at
> org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
>         at
> org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
>         at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
>         at
> org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
>         at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
>         at
> org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)
>         at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
>         at org.apache.catalina.startup.Catalina.start(Catalina.java:621)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/Error-deploying-2-1-0-war-to-tomcat6-tp4631449p4631479.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>



--
Graeme Rocher
Grails Project Lead
SpringSource - A Division of VMware
http://www.springsource.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error deploying 2.1.0 war to tomcat6

MLoe
This post has NOT been accepted by the mailing list yet.
Hi Graeme,

the jars are not inside the project.

Do you mean this scope definition:


class TomcatGrailsPlugin {
    // the plugin version
    def version = "2.0.3"
    // the version or versions of Grails the plugin is designed for
    def grailsVersion = "2.0 > *"
    // resources that are excluded from plugin packaging
    def pluginExcludes = [
            "grails-app/views/error.gsp",
            "grails-app/domain/*.groovy",
            "grails-app/controllers/*.groovy"
    ]
    // don't package in war
    def scopes = [excludes:'war']
       
    def author = "Graeme Rocher"
    def authorEmail = "graeme.rocher@springsource.com"
    def title = "Apache Tomcat plugin for Grails"
    def description = '''
Makes Tomcat 7.0 the default servlet container for Grails at development time.
'''

    // URL to the plugin's documentation
    def documentation = "http://grails.org/plugin/tomcat"

}

Thanks, Michael
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error deploying 2.1.0 war to tomcat6

floorflux
In reply to this post by Graeme Rocher-4
Graeme Rocher-4 wrote
It appears you have the Grails tomcat jars inside your lib directory
of your app, what scope do you have the tomcat plugin defined in?
I just have the plugin defined in my application.properties file:  

    plugins.tomcat=2.1.0

The tomcat plugin itself, however, has

    def scopes = [excludes: 'war']
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error deploying 2.1.0 war to tomcat6

burtbeckwith
You shouldn't have any plugins in application.properties. This is causing the Tomcat plugin to be in compile scope instead of build scope. Delete all plugins from application.properties and don't use install-plugin for future ones - add them to BuildConfig.groovy:

    plugins {
        runtime ":hibernate:$grailsVersion"
        runtime ":jquery:1.7.2"
        runtime ":resources:1.1.6"

        // Uncomment these (or add new ones) to enable additional resources capabilities
        //runtime ":zipped-resources:1.0"
        //runtime ":cached-resources:1.0"
        //runtime ":yui-minify-resources:0.1.4"

        build ":tomcat:$grailsVersion"

        runtime ":database-migration:1.1"

        compile ':cache:1.0.0'
    }

Burt

floorflux wrote
Graeme Rocher-4 wrote
It appears you have the Grails tomcat jars inside your lib directory
of your app, what scope do you have the tomcat plugin defined in?
I just have the plugin defined in my application.properties file:  

    plugins.tomcat=2.1.0

The tomcat plugin itself, however, has

    def scopes = [excludes: 'war']
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error deploying 2.1.0 war to tomcat6

Ian Roberts
On 13/07/2012 17:54, burtbeckwith wrote:
> You shouldn't have any plugins in application.properties. This is causing the
> Tomcat plugin to be in compile scope instead of build scope. Delete all
> plugins from application.properties and don't use install-plugin for future
> ones - add them to BuildConfig.groovy:

Have you considered removing install-plugin entirely, maybe in Grails
2.2?  Or better, make it so that when I run grails install-plugin foo it
prints a message telling me not to, and giving me the stanza that I need
to add to BuildConfig instead.

Ian

--
Ian Roberts               | Department of Computer Science
[hidden email]  | University of Sheffield, UK



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error deploying 2.1.0 war to tomcat6

floorflux
In reply to this post by burtbeckwith
burtbeckwith wrote
You shouldn't have any plugins in application.properties. This is causing the Tomcat plugin to be in compile scope instead of build scope. Delete all plugins from application.properties and don't use install-plugin for future ones - add them to BuildConfig.groovy
I moved the one tomcat plugin into the BuildConfig.groovy and it works like a charm.  Thank you for your help.

I guess it will take a bit of research for me to figure out the most appropriate scope for each individual plugin I'm using.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error deploying 2.1.0 war to tomcat6

burtbeckwith
Usually compile or runtime is what you want. The plugin's portal page has the string you can copy/paste into your BuildConfig.groovy in the "Dependency" row at the top, e.g. 'compile ":spring-security-core:1.2.7.3"' for http://grails.org/plugin/spring-security-core

Burt

floorflux wrote
burtbeckwith wrote
You shouldn't have any plugins in application.properties. This is causing the Tomcat plugin to be in compile scope instead of build scope. Delete all plugins from application.properties and don't use install-plugin for future ones - add them to BuildConfig.groovy
I moved the one tomcat plugin into the BuildConfig.groovy and it works like a charm.  Thank you for your help.

I guess it will take a bit of research for me to figure out the most appropriate scope for each individual plugin I'm using.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error deploying 2.1.0 war to tomcat6

Julian Shen
This post has NOT been accepted by the mailing list yet.
Thanks. Now no tomcat jar problem, but a different one. It's working fine in dev mode. Failed to start after deployed to Tomcat 7.0.25. It was ok before migrated from v2.1. Any clue?

context.ContextLoader Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsApplication' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeException
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.reflect.MalformedParameterizedTypeException
        at java.lang.Class.getGenericInterfaces(Class.java:794)
        ... 3 more

Thanks in advance.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error deploying 2.1.0 war to tomcat6

avaramis
I appear to have followed a very similar path.

I was able to prevent the tomcat 7 jars issue only to experience the MalformedParameterizedTypeException after deploying to Tomcat 6.

This problem started after adding:
                compile ":webflow:1.3.8"
                or
                compile ':webflow:2.0.0'
to BuildConfig.groovy

Commenting it will get it working again but then of course webflow won't.

It appears to be a conflict with Spring Jars and much like how the Tomcat plugin was pulling Tomcat 7 jars into the war file the webflow plugin is pulling a lot of spring 2.5.6 jars despite the presence of competing spring 3.1.2 jars.

For example after building a war file I end up with
 org.springframework.aop-2.5.6.SEC01.jar
 spring-aop-3.1.2.RELEASE.jar

I have hastily gone through and deleted all of the spring 2.5.6 jars but that didn't prevent the MalformedParameterizedTypeException so now I'm going through and paying attention in case some actually don't have parity with existing jars and shouldn't be deleted.

If I'm successful then I can disable their transitive dependency in the BuildConfig but if there's something more efficient please tell me.

Loading...