Sunday, November 10, 2013

struts maven project fails to start with eclipse's embedded tomcat server


Scenario:

Using eclipse's embedded tomcat server to deploy a struts project:




Result: it fails to start.



Solution

Supposing that server's configuration is correct(addres, port, etc), check the war plugin configuration in the pom.xml file.


The current value:

<plugin>
  <artifactId>maven-war-plugin</artifactId>
  <version>2.3</version>
  <configuration>
    <warSourceDirectory>WebContent</warSourceDirectory>
    <failOnMissingWebXml>false</failOnMissingWebXml>
  </configuration>
</plugin>

During a copy/paste from another project, the proper value was not set.

Switch to :

<plugin>
  <artifactId>maven-war-plugin</artifactId>
  <version>2.3</version>
  <configuration>
    <warSourceDirectory>src/main/webapp</warSourceDirectory>
    <failOnMissingWebXml>false</failOnMissingWebXml>
  </configuration>
</plugin>



 



Result : problem fixed.





No comments:

Post a Comment

eclipse: java: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" or Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

  >PROBLEM Using Eclipse, you try to run a simple logging test using "org.slf4j.Logger" like the sample below: package Test; im...