浏览 6185 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2008-03-20
web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/classes/applicationContext-service.xml, /WEB-INF/classes/applicationContext-dao.xml, /WEB-INF/classes/applicationContext-jdbc.xml </param-value> </context-param> <context-param> <param-name>webAppRootKey</param-name> <param-value>PIRCClient</param-value> </context-param> <context-param> <param-name>log4jConfigLocation</param-name> <param-value>WEB-INF/classes/log4j.properties</param-value> </context-param> <context-param> <param-name>log4jRefreshInterval</param-name> <param-value>600000</param-value> </context-param> <listener> <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.util.WebAppRootListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> ....... <servlet> <servlet-name>PIRCClientSysInit</servlet-name> <servlet-class>com.dragonsoft.pircclient.sys.PIRCClinetSysInit</servlet-class> <load-on-startup>2</load-on-startup> </servlet> PIRCClientSysInit是随服务器启动加载上下文的入口,问题也出在这里,其代码如下: PIRCClientSysInit.java: package com.dragonsoft.pircclient.sys; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import org.apache.log4j.Logger; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import com.dragonsoft.pircclient.service.SysConfigureBufferedService; public class PIRCClinetSysInit extends HttpServlet { /** * */ private static final long serialVersionUID = -2344733689247434124L; static private Logger log = Logger.getLogger(PIRCClinetSysInit.class); /** * 容器启动时进行初始化 * * @throws ServletException if an error occure */ public void init() throws ServletException { log.info("系统开始初始化..."); ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(this.getServletContext()); //WebSphere下会停留此处 log.info("系统初始化上下文结束..."); ServiceLocator.init(ctx); //系统参数初始化 SysConfigureBufferedService.init(); log.info("系统初始化结束!"); } } 在WebSphere下该WS工程日志会一直停留在“系统开始初始化...”,不会再向下进行进一步初始化,而在tomcat下不会存在这个问题。估计是ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(this.getServletContext());加载的问题,请了解的不吝赐教,谢谢~! 我WebSphere是6.0. 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2008-03-20
我们以前遇到过 tomcat 没问题,websphere无法启动项目的情况.
后来是问了IBM的工程师.在他们的帮助下搞定了问题. 我们那次是websphere本身的问题.IBM给了个补丁,打上好了. 并且IBM工程师说那个补丁还未公开发布... |
|
返回顶楼 | |
发表时间:2008-03-20
如果是那样问题就大条了,客户那边据说只有WAS,搞不定这个不就等于白忙活了.....郁闷了
|
|
返回顶楼 | |
发表时间:2008-03-20
没人碰到过这种情况吗?
把ContextLoaderListener 改为ContextLoaderServlet实现,同样解决不了问题... |
|
返回顶楼 | |
发表时间:2008-03-25
自己搞定了。把解决方法帖上来:
发帖时没把错误日志弄上来,失误!难怪没人回解决办法,错误日志: [08–3−20 18:44:03:469 CST] 00000036 ServletWrappe E SRVE0100E: 未识别出由 servlet context 抛出的 init() 异常:org.springframework.beans.FatalBeanException: Unable to determine validation mode for ServletContext resource [/WEB-INF/classes/applicationContext-jdbc.xml]. Did you attempt to load directly from a SAX InputSource?; nested exception is sun.io.MalformedInputException: null sun.io.MalformedInputException at sun.io.ByteToCharGB18030.convert(ByteToCharGB18030.java(Compiled Code)) at sun.nio.cs.StreamDecoder$ConverterSD.convertInto(StreamDecoder.java(Inlined Compiled Code)) at sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java(Compiled Code)) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java(Compiled Code)) at java.io.InputStreamReader.read(InputStreamReader.java(Compiled Code)) at java.io.BufferedReader.fill(BufferedReader.java(Compiled Code)) at java.io.BufferedReader.readLine(BufferedReader.java(Compiled Code)) at java.io.BufferedReader.readLine(BufferedReader.java(Compiled Code)) ……. at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:207) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:109) at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566) at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code)) at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952) at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code)) 这个异常产生的原因是IBM在JDK 1.4版本中为了追求对io通道的高效率改变了JDK 1.3中对io通道中异常处理的策略。IBM JDK 1.4中对于io通道的异常处理更加严格,因此系统中会报上面的错误。 解决这一问题的办法是不使用IBM JDK 1.4中默认的io通道,而使用nio通道。具体的做法如下: 1.打开管理控制台,找到并选择运行这个JSP的应用服务器 2.依次选择进程定义,java虚拟机,一般JVM自变量 3.添加-Dibm.stream.nio=true 4.确定,保存 5.重新启动该服务器 |
|
返回顶楼 | |