0

I have a gwt application using the gwt-maven-plugin version 1.2

I can generate my app and run the generated war but when I'm running the hosted mode using mvn gwt:run, it breaks:

java.io.FileNotFoundException: D:\workspaceTempo\TempoUI\war\WEB-INF\classes\net\stinfoservices\axsens\tempo\ui\log4j\log4j.xml (The system cannot find the path specified)
[ERROR]     at java.io.FileInputStream.open(Native Method)
[ERROR]     at java.io.FileInputStream.<init>(FileInputStream.java:120)
[ERROR]     at java.io.FileInputStream.<init>(FileInputStream.java:79)
[ERROR]     at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
[ERROR]     at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
[ERROR]     at org.apache.log4j.xml.DOMConfigurator$2.parse(DOMConfigurator.java:765)
[ERROR]     at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:866)
[ERROR]     at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:773)
[ERROR]     at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:901)
[ERROR]     at org.springframework.util.Log4jConfigurer.initLogging(Log4jConfigurer.java:70)
[ERROR]     at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:152)
[ERROR]     at org.springframework.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:47)
[ERROR]     at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:543)
[ERROR]     at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
[ERROR]     at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220)
[ERROR]     at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513)
[ERROR]     at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
[ERROR]     at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:447)
[ERROR]     at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
[ERROR]     at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
[ERROR]     at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115)
[ERROR]     at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
[ERROR]     at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
[ERROR]     at org.mortbay.jetty.Server.doStart(Server.java:222)
[ERROR]     at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
[ERROR]     at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:543)
[ERROR]     at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:421)
[ERROR]     at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1035)
[ERROR]     at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:783)
[ERROR]     at com.google.gwt.dev.DevMode.main(DevMode.java:275)

I looked under the war/WEB-INF/classes and the package structure is broken, every classes and resources are generated but not in their respective package/folder.

EDITED: Sorry I forgot to include the pom.xml file, here it is: http://pastebin.com/C9kRJ5GN

What the hell is going on?!? Have you already experienced this?

Thanks for your time guys

Laurent T
  • 1,070
  • 4
  • 13
  • 25

1 Answers1

0

I think (but I could be wrong) this is the normal behaviour of your maven project : you haven't declared some <resources> in your pom.xml, so resources will not be copied into your war directory.

see http://maven.apache.org/pom.html#Resources

so to avoid your problem :

  1. add a directory src/main/resources
  2. copy your log4j.xml inside src/main/resources/net/stinfoservices/axsens/tempo/ui/log4j
  3. modify your pom.xml : add a <resources> tag inside the <build> tag and specify src/main/resources as <directory>
willome
  • 3,062
  • 19
  • 32