mvn gwt:gwt and src/main/webapp/WEB-INF folder visibility

12 views
Skip to first unread message

Mark

unread,
Apr 8, 2008, 11:47:10 AM4/8/08
to gwt-maven
Hi,
I've created gwt project under maven that uses Spring
DispatcherServlet (declared in web.xml). In src/main/webapp/WEB-INF
there is servlet configuration - quotation-servlet.xml. I run it by
mvn gwt:gwt. Unfortunatelly servlet doesn't see it's configuration
file and now I suppose it's connected to gwt-maven plugin. I get the
following exception:



[WARN] StandardContext[]StandardWrapper.Throwable
org.springframework.beans.factory.BeanDefinitionStoreException:
IOException parsing XML document from ServletContext resource [/WEB-
INF/quotation-servlet.xml]; nested exception is
java.io.FileNotFoundException: Could not open ServletContext resource
[/WEB-INF/quotation-servlet.xml]
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:
320)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:
290)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:
131)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:
147)
at
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:
124)
at
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:
92)
at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:
101)
at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:
394)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:
324)
at
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:
332)
Caused by: java.io.FileNotFoundException: Could not open
ServletContext resource [/WEB-INF/quotation-servlet.xml]
at
org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:
99)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:
307)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:
290)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:
131)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:
147)
at
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:
124)
at
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:
92)
at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:
101)
at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:
394)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:
324)
at
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:
332)



I've tried to pack my project to war and run it by mvn jetty:run-war.
In this case servlet initialization goes well. Shouldn't folder src/
main/webapp/WEB-INF be visible to app started by "mvn gwt:gwt" by
default? Should I add this folder to <build><resources><resource>
element in pom.xml?


Thanks in advance!
Mark



Charlie Collins

unread,
Apr 14, 2008, 9:22:23 AM4/14/08
to gwt-maven
This is not a visibility to the compile phase issue, I don't think.
Rather it's related to the hosted mode embedded Tomcat not seeing the
file.

Maybe I am confused, but I think we are talking hosted mode Tomcat
doesn't see it, since you are using gwt:gwt. In this case it's a
tricky one, the hosted mode tomcat gets the classpath and web.xml from
GWT-Maven, but it doesn't get other resources unless they are
specifically added.

I already have an issue around to try to make this work more smoothly
in hosted mode - http://code.google.com/p/gwt-maven/issues/detail?id=82
- but for now you may have to use AntRun or such to copy the file over
to the hosted mode location. (It's not the final WAR that is at
issue, or the target, it's the hosted mode "tomcat" folder - a bit
more complicated, unfortunately.)
Reply all
Reply to author
Forward
0 new messages