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.