Upgrade troubles web.xml file

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Upgrade troubles web.xml file

manuzi1
This post was updated on .
Hi,

Again.. I have troubles with a project updating and do (grails install-template after upgrading) from 1.3.7 to 2.0.1. I always get this error - I copied the original web.xml file before:

So this is the error message on grails 2.0.1 with the web.xml file after running grails install-template:

2012-03-28 11:08:30,072 [pool-6-thread-1] ERROR startup.ContextConfig  - Unable to determine URL for WEB-INF/classes
javax.naming.NameNotFoundException: Resource /WEB-INF/classes not found
        at org.apache.naming.resources.BaseDirContext.listBindings(BaseDirContext.java:733)
        at org.apache.naming.resources.ProxyDirContext.listBindings(ProxyDirContext.java:546)
        at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1197)
        at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:825)
        at org.apache.catalina.sta...

Then i tried it again with the former file after upgrading to 2.0.1, run grails install-templates and copied the old web.xml into the templates folder. Then i got this error:

2012-03-28 11:09:29,120 [pool-6-thread-1] ERROR [localhost].[/myProject]  - Error configuring application listener of class org.codehaus.groovy.grails.web.util.Log4jConfigListener
java.lang.ClassNotFoundException: org.codehaus.groovy.grails.web.util.Log4jConfigListener
        at org.grails.plugins.tomcat.ParentDelegatingClassLoader.findClass(ParentDelegatingClassLoader.java:46)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:525)
        at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:507)
        at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:124)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4715)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1568)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1558)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)
2012-03-28 11:09:29,129 [pool-6-thread-1] ERROR [localhost].[/myProject]  - Skipped installing application listeners due to previous error(s)
2012-03-28 11:09:29,129 [pool-6-thread-1] ERROR core.StandardContext  - Error listenerStart
2012-03-28 11:09:29,131 [pool-6-thread-1] ERROR core.StandardContext  - Context [/myProject] startup failed due to previous errors

So here are two different errors. I think the second error is the "better" error.

Here are also the two web.xml files, I noticed two things which I made bold:
-> i just copy the important things

The web.xml file after the upgrade and install-template command:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
         metadata-complete="true"
         <b>xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

    <filter-mapping>
        <filter-name>sitemesh</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>ERROR</dispatcher>

    </filter-mapping>

    <listener>
        <listener-class>org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener</listener-class>
    </listener>


and the web.xml file before i run install-template (to copy it out and past it after the install-template cmd)

<web-app version="2.4"
         <b>xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>/@grails.project.key@</display-name>

    <filter-mapping>
        <filter-name>sitemesh</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <listener>
        <listener-class>org.codehaus.groovy.grails.web.util.Log4jConfigListener</listener-class>
    </listener>


    <listener>
        <listener-class>org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener</listener-class>
    </listener>


------------------------------------------------

So these are the things I noticed. And no I have not forget to copy the Log4jConfigListener class in the first web.xml. There is noone. Also watch these two lines (cannot make them bold - don't know why):
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns="http://java.sun.com/xml/ns/j2ee"

Can someone solve this problem?
Greetings from Austria,
Manuel
Reply | Threaded
Open this post in threaded view
|

Re: Upgrade troubles web.xml file

manuzi1
#push

Noone who can help me?
Greetings from Austria,
Manuel
Reply | Threaded
Open this post in threaded view
|

Re: Upgrade troubles web.xml file

pledbrook
In reply to this post by manuzi1
> So this is the error message on grails 2.0.1 with the web.xml file after
> running grails install-template:
>
> 2012-03-28 11:08:30,072 [pool-6-thread-1] ERROR startup.ContextConfig  -
> Unable to determine URL for WEB-INF/classes
> javax.naming.NameNotFoundException: Resource /WEB-INF/classes not found
>        at
> org.apache.naming.resources.BaseDirContext.listBindings(BaseDirContext.java:733)

How are you running your Grails application? 'grails run-app'? 'grails
run-war'? Have you deployed the WAR file to a separate Tomcat?

I've not come across this error before. It's not clear why Tomcat is
looking for the name "WEB-INF/classes". Does your application use JNDI
for anything?

Peter

--
Peter Ledbrook
Grails Advocate
SpringSource - A Division of VMware

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Upgrade troubles web.xml file

manuzi1
Hi pledbrook,

I am running it with grails run-app.

> Have you deployed the WAR file to a separate Tomcat?
What do you mean with that?

>I've not come across this error before. It's not clear why Tomcat is
>looking for the name "WEB-INF/classes". Does your application use JNDI
>for anything?

I don't know why Tomcat does this. No I don't use this interface or any other.
What I found in the web is this:

http://wpfeiffe.blogspot.ca/2011/12/notes-on-upgrading-to-grails-20-from.html

But when I copy the code and run it, I got the error for an unexpected token: ajpConnector
Connector.port = 8080, Connector.protocol,....
Greetings from Austria,
Manuel