0

I tried to run simple example(Hello wold) in struts-2.3.4.1 with tomcat server 7.0. But when i run this sample application i got following exception :

java.lang.NullPointerException
    org.apache.struts2.impl.StrutsActionProxy.getErrorMessage(StrutsActionProxy.java:69)
    com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:185)
    org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)
    org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
    com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
    org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:501)
    org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:432)

used Log4j.xml Configuration file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">

<appender class="org.apache.log4j.rolling.RollingFileAppender" name="FixedWindowRollingFile">
   <param name="Append" value="true"/>
   <param name="ImmediateFlush" value="true"/>

   <rollingPolicy class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
      <param name="fileNamePattern" value="c:/logs/HelloExample/HelloExample.%i.log"/>
       <param name="minIndex" value="1"/>
      <param name="maxIndex" value="10"/>
       </rollingPolicy>
   <triggeringPolicy class="org.apache.log4j.rolling.SizeBasedTriggeringPolicy">
     <param name="MaxFileSize" value="1002400"/>
       </triggeringPolicy>
   <layout class="org.apache.log4j.PatternLayout">
     <param name="ConversionPattern"  value="%d{yyyy-MM-dd HH:mm:ss} %p %c{1}:%L - %m%n"/>
     </layout>
</appender>

 <appender name="ConsoleAppender" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.SimpleLayout"/>
</appender>


   <root>
   <priority value="DEBUG"/>
   <appender-ref ref="ConsoleAppender"/>
    <appender-ref ref="FixedWindowRollingFile"/>

   </root>
</log4j:configuration>

Also I have used my own log4j.xml configuration file to configure web application but i got this exception regularly(generated log file https://gist.github.com/3851738).

4

0 回答 0