I have the exact same issue, although with Spring plus two other
listeners configured in the web.xml. I believe these error messages
are spurious, as they happen after the listeners are actually
initialized. These three lines are a clue:
at
com.google.gwt.dev.ServletValidator.create(ServletValidator.java:69)
at
com.google.gwt.dev.ServletValidator.create(ServletValidator.java:52)
at com.google.gwt.dev.DevMode.doSlowStartup(DevMode.java:356)
After looking at the ServletValidator code, I believe what the servlet
validator is doing is loading the web.xml a second time to parse it in
order to report warnings about mis-configured module servlets (and
maybe other things). The validator is not actually loading the
webapp--but its using the Jetty webapp parser without setting up the
classloader. I think the thinking here is that GWT sets up the
validator in order to read its metamodel, and doesn't expect any
classloading. However, since listeners are setup in this case to fire
on context load, Jetty is actually attempting to load the classes but
does not understand how to load them (again, it's classloader is not
setup correctly).
I would think the fix is fairly simple in the ServletValidator class.
If you actually try to test your code, you'll find it's probably
working. In my case, I've decided to ignore these errors and move on.
Someone (me?) should file a bug against GWT devmode for this.
On Feb 15, 12:53 pm, Paul S <[email protected]> wrote:
> I have a fresh project that I've started to test GWT 2.0.2 with Spring
> 3. I am using the Eclipse GWT plugin and am using the in-built Jetty
> server that is enabled by default for hosted mode.
>
> GWT creates a web.xml file inside WEB-INF. I opened this up to add
> some extra Spring functionality to the server side. Some really basic
> that is causing me such a headache is the applicationContext.xml
> loading.
>
> Inside my web.xml I have put
> <web-app>
> ...
> <listener>
> <listener-class>
> org.springframework.web.context.ContextLoaderListener
> </listener-class>
> </listener>
> ...
> </web-app>
>
> which by default expects to find applicationContext.xml inside WEB-
> INF. The file is there. If I remove it I get an error to the effect
> that the file could not be found. So by placing a file by that name in
> the right place that error goes away. Progress. Now In that file I
> have put some skeleton code that I believe is a valid spring
> application context file.
>
> When I click the green play button in Eclipse (run) I get the
> following, not very helpful, warning message on the console. The
> reason I say it's not helpful is because
> org.springframework.web.context.ContextLoaderListener very much exists
> and is accessible to the container. If I put it on the classpath it
> tries to run the main method which is not right. But from previous
> projects I understand that it being in the WEB-INF/lib folder is the
> right place. So it is my belief that something is failing silently and
> then instead this message pops up:
>
> [WARN] Could not instantiate listener
> org.springframework.web.context.ContextLoaderListener
> java.lang.ClassNotFoundException:
> org.springframework.web.context.ContextLoaderListener
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at org.mortbay.util.Loader.loadClass(Loader.java:91)
> at org.mortbay.util.Loader.loadClass(Loader.java:71)
> at
> org.mortbay.jetty.handler.ContextHandler.loadClass(ContextHandler.java:
> 1036)
> at
> org.mortbay.jetty.webapp.WebXmlConfiguration.initListener(WebXmlConfiguration.java:
> 629)
> at
> org.mortbay.jetty.webapp.WebXmlConfiguration.initWebXmlElement(WebXmlConfiguration.java:
> 367)
> at
> org.mortbay.jetty.webapp.WebXmlConfiguration.initialize(WebXmlConfiguration.java:
> 289)
> at
> org.mortbay.jetty.webapp.WebXmlConfiguration.configure(WebXmlConfiguration.java:
> 222)
> at com.google.gwt.dev.ServletValidator.create(ServletValidator.java:
> 69)
> at com.google.gwt.dev.ServletValidator.create(ServletValidator.java:
> 52)
> at com.google.gwt.dev.DevMode.doSlowStartup(DevMode.java:356)
> at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1057)
> at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:783)
> at com.google.gwt.dev.DevMode.main(DevMode.java:275)
>
> I'm wondering if it's a Jetty thing? Or GWT web.xml content
> restrictions? Really not sure, please help!
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.