说三道四技术文摘-感悟人生的经典句子
说三道四 > 文档快照

websphere的问题(4)?

编辑:说三道四文库 发布时间:2018-07-17 12:11
HTML文档下载 WORD文档下载 PDF文档下载
我在JBUDER中的代码是这样的:
 RequestDispatcher  dispatcher = getServletContext().getRequestDispatcher("/servlet/com.publicsoft.tool.FileListServlet");
 
 dispatcher.forward(request,res);

在JBUDER运行正常。而且在原来的WEBSPHERE配置的服务器下面运行也正常。这就说明我的所有程序没问题。

可当把程序发布到另一台服务器下面的WEBSPHERE下面的时候,出现错误如下:
[03.09.06 11:42:02:265 CST] 64e0a6d4 WebGroup      X Servlet Error: ERROR: Cannot forward. Writer or Stream already obtained.: java.lang.IllegalStateException: ERROR: Cannot forward. Writer or Stream already obtained.
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:96)
at com.publicsoft.skmis.yb.Yb_modifyactionindb.doGet(Yb_modifyactionindb.java:68)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:159)
at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:286)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:106)
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:499)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:278)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:105)
at com.ibm.servlet.engine.webapp.InvokerServlet.service(InvokerServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:159)
at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:286)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:106)
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:499)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:278)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:105)
at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:67)
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:123)
at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)
at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:106)
at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:125)
at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:315)
at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:313)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:242)
at com.ibm.ws.util.CachedThread.run(ThreadPool.java:122)

[03.09.06 11:42:02:406 CST] 64ef26d4 WebGroup      X Servlet Error-[rz_query.files]: 未能装入小服务程序: java.lang.ClassNotFoundException: rz_query.files
at java.net.URLClassLoader.findClass(URLClassLoader.java(Compiled Code))
at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:292)
at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:292)
at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
at com.ibm.ws.classloader.ReloadableClassLoader.loadClass(ReloadableClassLoader.java:66)
at java.beans.Beans.instantiate(Beans.java:196)
at java.beans.Beans.instantiate(Beans.java:57)
at com.ibm.servlet.engine.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:148)
at com.ibm.servlet.engine.webapp.WebApp.addServlet(WebApp.java:424)
at com.ibm.servlet.engine.webapp.WebAppServletRegistry.addServlet(WebAppServletRegistry.java:42)
at com.ibm.servlet.engine.webapp.InvokerServlet.service(InvokerServlet.java:188)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:159)
at com.ibm.servlet.engine.webapp.ServicingServletState.service(StrictLifecycleServlet.java:306)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:106)
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:499)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:278)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:105)
at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:67)
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:123)
at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)
at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:106)
at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:125)
at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:315)
at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:313)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:242)
at com.ibm.ws.util.CachedThread.run(ThreadPool.java:122)

请教各位师兄师姐。我的WEBSPHERE是不是哪儿配置有问题。
超长的问题,学习.
根据最新的java sevlet API 2.3 的协议,你的问题应该是res在这段程序前边
被管道打开了。删除前面对于res的管道操作,就可以了,自己试试吧。
RequestDispatcher  dispatcher = getServletContext().getRequestDispatcher("/servlet/com.publicsoft.tool.FileListServlet");

修改为RequestDispatcher  dispatcher = reuqest.getRequestDispatcher("/servlet/com.publicsoft.tool.FileListServlet");
备案号:鲁ICP备13029499号-2 说三道四 www.s3d4.cn 说三道四技术文摘