getPageIterator's result is null, check your ModelListAction subclass

golddragon發表於2006-03-29
環境:myeclipse+tomcat
應用名:Jdonsample
Jndi: 在tomcat下的conf\Catalina\localhost下放入一個Jdonsample.xml檔案內容如下
<Context path="/Jdonsample" docBase="Jdonsample" debug="99" reloadable="true" crossContext="true" verbosity="DEBUG">
<Logger className="org.apache.catalina.logger.FileLogger" prefix="Jdonsample." suffix=".log" timestamp="true" />
<Resource name="TestDS" auth="Container" type="javax.sql.DataSource" />
<ResourceParams name="TestDS">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/Jdonsample</value>
</parameter>
<parameter>
<name>username</name>
<value>root</value>
</parameter>
<parameter>
<name>password</name>
<value>root</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>20</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>10</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>-1</value>
</parameter>
</ResourceParams>
</Context>
在web.xml中新增了如下一段
<resource-ref>
<description>MySQL Connection</description>
<res-ref-name>TestDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
jdonframework.xml中的配置修改了以下部分
<component name="messageDao" class="sample.dao.hibernate.MessageDaoHB" >
<constructor value="java:comp/env/TestDS"/>
</component>
執行後,控制檯出現如下錯誤
2006-03-29 10:10:52,438 [Thread-5] DEBUG com.jdon.util.UtilCache - [JdonFramework]found cache configure: cache.default.maxSize = 1000
2006-03-29 10:10:58,366 [Thread-5] ERROR com.jdon.bussinessproxy.target.POJOObjectFactory - [JdonFramework]create error: java.lang.NoClassDefFoundError: org/dom4j/Attribute
2006-03-29 10:10:58,366 [Thread-5] ERROR com.jdon.bussinessproxy.target.DefaultTargetServiceFactory - [JdonFramework]create error: java.lang.Exception: java.lang.NoClassDefFoundError: org/dom4j/Attribute
2006-03-29 10:10:58,386 [Thread-5] ERROR root - com.jdon.aop.interceptor.PoolInterceptor
java.lang.NullPointerException
at com.jdon.aop.interceptor.PoolInterceptor.invoke(PoolInterceptor.java:106)
at com.jdon.aop.reflection.ProxyMethodInvocation.proceed(ProxyMethodInvocation.java:84)
at com.jdon.aop.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:59)
at com.jdon.aop.reflection.ProxyMethodInvocation.proceed(ProxyMethodInvocation.java:84)
at com.jdon.aop.AopClient.invoke(AopClient.java:95)
at com.jdon.bussinessproxy.dyncproxy.DynamicProxyWeaving.invoke(DynamicProxyWeaving.java:61)
at $Proxy0.getAllMessages(Unknown Source)
at sample.web.MessageListAction.getPageIterator(MessageListAction.java:39)
at com.jdon.strutsutil.ModelListAction.execute(ModelListAction.java:65)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:286)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.jdon.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:92)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:253)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:256)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:210)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:190)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:175)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:974)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:207)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:637)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:488)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:568)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:631)
at java.lang.Thread.run(Thread.java:534)
2006-03-29 10:10:58,396 [Thread-5] DEBUG com.jdon.bussinessproxy.dyncproxy.DynamicProxyWeaving - [JdonFramework]call method:getAllMessages finish!
2006-03-29 10:10:58,426 [Thread-5] WARN org.apache.struts.action.RequestProcessor - Unhandled Exception thrown: class java.lang.Exception

並且在啟動時出現了
<======== Jdon Framework started successfully! =========>

開啟Jdonsample.2006-03-29.log檢視,發現如下提示
2006-03-29 10:10:58 StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
java.lang.Exception: getPageIterator's result is null, check your ModelListAction subclass
at com.jdon.strutsutil.ModelListAction.execute(ModelListAction.java:67)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:286)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.jdon.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:92)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:253)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:256)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:210)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:190)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:175)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:974)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:207)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:637)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:488)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:568)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:631)
at java.lang.Thread.run(Thread.java:534)


實在不知道什麼原因,請bang老師幫忙

相關文章