Hi all, I'm trying to use the struts2 spring plugin as indicated by the tutorial at http://struts.apache.org/2.3.8/docs/spring-and-struts-2.html without success.

I got the following log:

SEVERE: Error listenerStart
gen 26, 2013 6:15:57 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/Struts2_Themes] startup failed due to previous errors
gen 26, 2013 6:15:57 PM org.apache.catalina.core.StandardContext filterStop
FINE: Stopping filters
gen 26, 2013 6:15:57 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
gen 26, 2013 6:15:57 PM org.apache.catalina.core.StandardContext listenerStop SEVERE: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.springframework.web.context.ContextCleanupListener.<clinit>(ContextCleanupListener.java:43) at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:80) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4831) at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5478)
        at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
...

I had to increment the juli verbosity to print the exception tracert as showed:

$ cat WEB-INF/classes/logging.properties
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/Struts2_Themes].level=FINE
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/Struts2_Themes].handlers=java.util.logging.ConsoleHandler

These libraries are available to my application..

$ ls -1 WEB-INF/lib/
aopalliance-1.0.jar
asm-3.3.jar
asm-commons-3.3.jar
asm-tree-3.3.jar
commons-fileupload-1.2.2.jar
commons-io-2.0.1.jar
commons-lang3-3.1.jar
freemarker-2.3.19.jar
javassist-3.11.0.GA.jar
log4j-1.2.17.jar
ognl-3.0.5.jar
spring-beans-3.0.5.RELEASE.jar
spring-context-3.0.5.RELEASE.jar
spring-core-3.0.5.RELEASE.jar
spring-web-3.0.5.RELEASE.jar
struts2-config-browser-plugin-2.3.7.jar
struts2-core-2.3.7.jar
struts2-dojo-plugin-2.3.7.jar
struts2-spring-plugin-2.3.7.jar
xwork-core-2.3.7.jar

with the following configuration files:

$ cat WEB-INF/web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns="http://java.sun.com/xml/ns/javaee"; xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"; xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"; version="3.0">
  <display-name>Struts2_Theme</display-name>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
  <listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  <filter>
      <filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
  </filter>
  <filter-mapping>
      <filter-name>struts2</filter-name>
      <url-pattern>/*</url-pattern>
  </filter-mapping>
</web-app>

$ cat WEB-INF/classes/struts.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd";>
<struts>
    <constant name="struts.devMode" value="true" />
    <constant name="struts.enable.DynamicMethodInvocation" value="false" />
    <constant name="struts.objectFactory" value="spring" />
    <package name="Struts2_Themes" extends="struts-default">
<action name="edit" class="tutorial.struts2.themes.action.PersonAction" method="edit">
            <result name="input">/edit.jsp</result>
        </action>
<action name="save" class="tutorial.struts2.themes.action.PersonAction" method="save">
            <result name="success">/thankyou.jsp</result>
        </action>
    </package>
</struts>

$ cat WEB-INF/applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xsi:schemaLocation="
            http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd";>
<bean id="personService" class="tutorial.struts2.themes.service.PersonServiceInMemory" />
</beans>

$ ls WEB-INF/classes/tutorial/struts2/themes/service/PersonServiceInMemory.class
WEB-INF/classes/tutorial/struts2/themes/service/PersonServiceInMemory.class

It seems Spring can't find the log classes provided by juli in my tomcat 7 environment, surely I miss some conf directive..
Any hint will be appreciated.

Best regards


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to