本文讲述在WAS6、WAS7日常使用中若个问题,希望对你有所帮助。
1、在我们重新删除应用后,然后在重新部署应用时,常常会出来下面这个错误,报错信息如下:
Caused by: org.xml.sax.SAXException: JSPG0235E: JSP 容器无法装入 TagExtraInfo 类[org.apache.struts.taglib.logic.IterateTei]
at com.ibm.ws.jsp.taglib.TldParser.endElement(TldParser.java:366)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLNSDTDValidator.endNamespaceScope(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at com.ibm.ws.jsp.translator.visitor.xml.ParserFactory.parseDocument(ParserFactory.java:104)
at com.ibm.ws.jsp.taglib.TldParser.parse(TldParser.java:271)
at com.ibm.ws.jsp.taglib.TldParser.parseTLD(TldParser.java:231)
at com.ibm.ws.jsp.taglib.TagLibraryCache.loadWebInfMap(TagLibraryCache.java:277)
at com.ibm.ws.jsp.taglib.TagLibraryCache.<init>(TagLibraryCache.java:91)
at com.ibm.ws.jsp.webcontainerext.JSPExtensionProcessor.<init>(JSPExtensionProcessor.java:143)
at com.ibm.ws.jsp.webcontainerext.JSPExtensionFactory.createExtensionProcessor(JSPExtensionFactory.java:96)
at com.ibm.ws.webcontainer.webapp.WebApp.initializeExtensionProcessors(WebApp.java:1068)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:363)
at com.ibm.ws.webcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:114)
at com.ibm.ws.webcontainer.VirtualHost.addWebApplication(VirtualHost.java:127)
at com.ibm.ws.webcontainer.WebContainer.addWebApp(WebContainer.java:776)
解决办法:这个错误很简单,由于我们在重新部署应用,没有把共享库添加上,导致加载struts的标签库失败。添加之前定义好的共享库就OK!
2、修改了应用的配置文件后,突然之前应用启动不了,报如下错误:
[6/26/13 18:12:19:462 GMT+08:00] 00000037 ApplicationMg E WSVR0101W: An error occurred starting, scetb2b
[6/26/13 18:12:19:484 GMT+08:00] 00000037 ApplicationMg A WSVR0217I: Stopping application: scetb2b
[6/26/13 18:12:19:578 GMT+08:00] 00000037 ApplicationMg A WSVR0220I: Application stopped: scetb2b
解决办法:具体里面systemOut.log可能有更详细的说明,一般来说这个问题是WAS6在加载web.xml文件失败导致,这是你需要检查你的
web.xml文件,如果servlet是否对应,是否把mapping放在servlet定义的前面等等。
3、WAS6在进行了安全测试扫描之后,突然宕了,是整个server都宕机了,查看日志报错信息如下:
[6/26/13 9:33:48:312 GMT+08:00] 0000001d VSync I DCSV2004I: DCS Stack DefaultCoreGroup at Member deca1Cell01\deca1Node02\scServer1: The synchronization procedure completed successfully. The View Identifier is (104:0.deca1Cell01\deca1CellManager01\dmgr). The internal details are [0 0 0 0 0 0].
[6/26/13 9:33:48:413 GMT+08:00] 0000001c CoreGroupMemb I DCSV8050I: DCS Stack DefaultCoreGroup at Member deca1Cell01\deca1Node02\scServer1: New view installed, identifier (105:0.deca1Cell01\deca1CellManager01\dmgr), view size is 6 (AV=6, CD=6, CN=6, DF=9)
[6/26/13 9:33:48:436 GMT+08:00] 0000001d ViewReceiver I DCSV1033I: DCS Stack DefaultCoreGroup at Member deca1Cell01\deca1Node02\scServer1: Confirmed all new view members in view identifier (105:0.deca1Cell01\deca1CellManager01\dmgr). View channel type is View|Ptp.
解决办法:目前还未查明具体是什么原因导致,通过分析javacore,发现前后两个文件的线程一致。方法就是重新启动server,OK!
4、在访问servlet的时候,突然报这个错误:Error 404: No target servlet configured for uri: /GreenServlet,
解决办法:报404说明应用服务器找不到请求,其实这个问题很蹊跷,有可能是应用服务器加载的顺序问题,我这里的解决办法是:访问下
网站,如登陆下,然后再访问servlet,就OK了!
5、在启动的应用的时候,报如下错误:
Caused by: java.lang.SecurityException: sealing violation: package oracle.net.nt is sealed
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.jorphan.reflect.ClassFinder.isChildOf(ClassFinder.java:468)
at org.apache.jorphan.reflect.ClassFinder.access$0(ClassFinder.java:464)
at org.apache.jorphan.reflect.ClassFinder$FilterTreeSet.add(ClassFinder.java:106)
at org.apache.jorphan.reflect.ClassFinder$FilterTreeSet.add(ClassFinder.java:1)
at org.apache.jorphan.reflect.ClassFinder.findClassesInOnePath(ClassFinder.java:536)
at org.apache.jorphan.reflect.ClassFinder.findClassesInPaths(ClassFinder.java:553)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:293)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:214)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:197)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:159)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.setupClasslist(JUnitTestSamplerGui.java:182)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.createClassPanel(JUnitTestSamplerGui.java:210)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.init(JUnitTestSamplerGui.java:160)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.<init>(JUnitTestSamplerGui.java:144)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.apache.jmeter.gui.util.MenuFactory.initializeMenus(MenuFactory.java:439)
at org.apache.jmeter.gui.util.MenuFactory.<clinit>(MenuFactory.java:154)
... 14 more
解决办法:这个异常一般是由于classpath中有多个jar包都包含同样的java包,比如oracle.net.nt
6、在访问某些应用的时候(由于航空公司电子商务网站,采用IBE接口),国际票查询时报如下错误:
[13-5-16 10:46:22:550 GMT] 00000047 WebApp E SRVE0026E: [Servlet 错误]-[action]:java.lang.VerifyError: arguments are not type compatible (class: com/travelsky/ibe/parser/AVParser method: createAVRequestHeader(Ljava/lang/String;Ljava/lang/String;)Lorg/jdom/Document;) at pc: 20
at java.lang.Class.verifyImpl(Native Method)
at java.lang.Class.verify(Class.java:253)
at java.lang.Class.initialize(Class.java:315)
at com.travelsky.ibe.internal.IAV.getAvailability(IAV.java:358)
at com.travelsky.ebuildm.factory.AVInternalImpl.getAvailability(AVInternalImpl.java:57)
at com.travelsky.scetb2b.commons.PnrUtil.getAv(PnrUtil.java:566)
at com.travelsky.scetb2b.commons.PnrUtil.getAv(PnrUtil.java:519)
at com.travelsky.scetb2b.commons.PnrUtil.getAv(PnrUtil.java:467)
at com.travelsky.web.scetb2b.reservation.fltshop.FltShopAvResultBuilder.getInternationalAvSeats(FltShopAvResultBuilder.java:650)
at com.travelsky.web.scetb2b.reservation.fltshop.FltShopAvResultBuilder.getAVSeats(FltShopAvResultBuilder.java:99)
at com.travelsky.web.scetb2b.reservation.fltshop.FltShopAvResultBuilder.buildAVResultBean(FltShopAvResultBuilder.java:84)
at com.travelsky.web.scetb2b.reservation.action.FlightSearchAction.flightSearchFltShop(FlightSearchAction.java:93)
at com.travelsky.web.scetb2b.reservation.action.FlightSearchAction.doAction(FlightSearchAction.java:42)
at com.travelsky.web.scb2bframework.BaseAction.execute(BaseAction.java:530)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1173)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92)
at com.travelsky.scetb2b.commons.XSSDefendFilter.doFilter(XSSDefendFilter.java:69)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:626)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2841)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:220)
at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:204)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1681)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:94)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:601)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)
解决办法:jdom.jar包冲突,需要更新WAS6中lib的jar包
7、在新引入接口的时候伴随着新的jar的使用,如果在引入新的jar的时候报如下错误:
[13-5-16 1:22:22:319 GMT] 00000015 ContextLoader E TRAS0014I: 下列异常已记录 java.lang.LinkageError: LinkageError while defining class: com.travelsky.ibe.exceptions.IBEException
Could not be defined due to: (com/travelsky/ibe/exceptions/IBEException) bad major version at offset=6
This is often caused by having a class defined at multiple
locations within the classloader hierarchy. Other potential causes
include compiling against an older or newer version of the class
that has an incompatible method signature.
Dumping the current context classloader hierarchy:
==> indicates defining classloader
解决办法:由于WAS6采用的jdk1.4的环境,这个问题是jar包在1.4以上版本编译的,导致冲突,重新要求jar提供方在1.4的环境下打包生成OK!
后记:关于从tomcat中迁移到WAS环境
平常开发中使用tomcat中最多,但是投入生产环境中一般为商业服务器,我们公司就是WAS环境,这里总结下项目中tomcat中迁移到WAS的几个小问题。
其实需要注意的地方不是很多,基本你先按照WAS的环境,建立建群、建立服务器、共享库、数据源,然后部署引用,但是WAS和tomcat中有一个最大的
不同就是:对jar的使用不同。tomcat中jar一般都放在lib中,而且每个war包都有自己对应的jar包。而WAS环境提倡使用共享库的概念,还有配置在JVM的classpath中。
如果不这么做有什么问题呢:虽然WAS也可以从应用中lib中读到jar包,但是如果你的jar够多,然后打成的ear包将非常多,这时,WAS在应用部署启动的时候将报错:
OOM错误,意思就是你的ear包太大了。
所以这里就是tomcat和WAS在jar包问题上面的拉锯。
先说明一点:tomcat也可以使用共享库的概念,如果一开始使用了共享库,估计后面迁移的事情就不会那么多。因为多个应用不用考虑jar冲突。
8、这里介绍一个spring的错误,如下所示:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'frontUserService' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:529)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1094)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:276)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1075)
at com.travelsky.b2bplatform.framework.ServiceFactory.getFrontUserService(ServiceFactory.java:192)
at com.travelsky.aess.logic.user.manager.UserManagerImpl.queryUserInfoForLogin(UserManagerImpl.java:230)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
at $Proxy11.queryUserInfoForLogin(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(RemoteInvocationTraceInterceptor.java:77)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
原因分析:这个错误意思就是spring容器找不到这个bean,但是其他同事都可以加载到。不可能是代码方面的问题。
后来经排查,我tomcat的使用的是共享库的配置,他们的是myeclipse自带的classpath的配置导致的,由于后面对spring加载做了变化,
导致AESW无法加载到配置文件,而AESS则能够正确加载。
解决办法:经过了几番较量,还是在AESW的spring加载时候加入与AESS的一致的配置文件,等于同一个配置文件两个应用都加载一遍。
具体这个问题是否真有tomcat共享库引起还不得而知。
9、项目中报java.lang.NoClassDefFoundError异常及java.lang.NoSuchMethodException、java.lang.NoSuchMethodError异常。
粗看起来,两个错误大多表示没有class或者class中没有该方法。
1、一般如果加载的类中没有该方法,则会报这个错误:java.lang.NoSuchMethodError,比如新添加个静态static的方法,如果没有重启的话,则抛出这个错误。
2、如果报出这个错误:java.lang.NoSuchMethodException,则有可能是你的jar包中含有类名相同、方法名也相同的方法。
比如这次中:tomcat共享库一份jar和lib中一份jar包,然后访问的时候,有两个相同的方法,就抛出这个异常。
3、java.lang.NoClassDefFoundError所指对象的类不存在,如不是自定义类的话,到 http://www.findjar.com 查找包含该信息的jar包并引入.
4、类的加载先后顺序有问题如启动web application的时候,类的加载是有一个先后顺序的,如果应该先加载的类在后面加载,别的类在调用时找不到它,那么也会报这个错.其他 java.lang.NoClassDefFoundError 异常都可这样处理.
10、最诡异的一个问题,在tomcat中没发生这问题,但是一旦在WAS上面部署就出来这个问题。目前还未清除原因及如何解决的。
问题产生的是我们使用应用名访问的时候(http://122.119.144.25/aeswmfet),报错500,然后使用http://122.119.144.25/aeswmfet/index.jsp则可以正常访问。
查了下web.xml的welcome配置,没发现什么问题,都正常。刚报错500的日志如下:
[4/22/13 17:46:01:626 CST] 00000032 webapp E com.ibm.ws.webcontainer.webapp.WebApp logError SRVE0293E: [Servlet Error]-[null]: com.ibm.ws.webcontainer.webapp.WebAppErrorReport:
at com.ibm.ws.webcontainer.webapp.WebAppDispatcherContext.sendError(WebAppDispatcherContext.java:624)
at com.ibm.ws.webcontainer.srt.SRTServletResponse.sendError(SRTServletResponse.java:1071)
at org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:839)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:533)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:434)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:852)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:917)
at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:924)
at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:651)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3610)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:274)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:926)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)
问题分析:这个问题在后面突然就OK了,在tomcat和WAS都可以正常了。
这个问题网上说法是:WAS报了一个NULL的错误,一般来说是在配置文件,具体是什么原因,还请各位看官看看?
--转自
该贴由system转至本版2014-10-28 22:50:39