getPageIterator's result is null, check your ModelListAction subclass

06-03-29 golddragon

环境: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老师帮忙

banq
2006-03-31 09:23

注意第一个错误往往是一系列错误的根源,第一个错误是:

java.lang.NoClassDefFoundError: org/dom4j/Attribute

说明你的jdom.jar包没有放入系统的classpath中。

golddragon
2006-03-31 09:53

因为我是在eclipse中运行tomcat,jdom.jar包已经放入了lib下,且编译都不出错,jdom.jar也确定在构建路径中,为什么还是会出这种错误呢?

golddragon
2006-03-31 10:02

我知道了,工程里面还差一些包,比如dom4j.jar ehcache.jar

ok118
2006-04-29 14:31

老师啊。。快回复啊,,

我看了您的视频,一步一步做,把所有包都放进去了。

jboss启动时没错误信息,打用ie浏览时出错:

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: getPageIterator's result is null, check your ModelListAction subclass

org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:516)

org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:423)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)

org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)

javax.servlet.http.HttpServlet.service(HttpServlet.java:697)

javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

一直都找不到原因,请老师帮忙啊

2Go 1 2 下一页