http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=81&threadID=37385
Solaris 10 SPARC WebLogic 8.1.5下
Spring 1.2.8
Hibernate 3.1.3
出现JSP编译错误
同样在Windows下面没有问题,不解中。。。
0821 18:46:19:250XmlWebApplicationContext:215]- Publishing event in context [WebApplicationContext for namespace 'dispatcherServlet-servlet']: Request
HandledEvent: url=[/cms/Login.do]; time=[67ms]; client=[198.24.9.248]; method=[GET]; servlet=[dispatcherServlet]; session=[null]; user=[null]; status=
[failed: java.lang.ClassCastException]
0821 18:47:54:472DispatcherServlet:849]- Testing handler map [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping@1b11524] in DispatcherSe
rvlet with name 'dispatcherServlet'
0821 18:47:54:478SimpleUrlHandlerMapping:134]- Looking up handler for [/Login.do]
0821 18:47:54:482DispatcherServlet:888]- Testing handler adapter [org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter@e31969]
0821 18:47:54:485DispatcherServlet:795]- Last-Modified value for [/cms/Login.do] is [-1]
0821 18:47:54:489DispatcherServlet:638]- DispatcherServlet with name 'dispatcherServlet' received request for [/cms/Login.do]
0821 18:47:54:493DispatcherServlet:888]- Testing handler adapter [org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter@e31969]
0821 18:47:54:497SSOController:321]- Displaying new form
0821 18:47:54:501SSOController:329]- Creating new command of class [com.ericsson.ctsn.cms.web.formbean.LoginForm]
0821 18:47:54:506CachedIntrospectionResults:101]- Using cached introspection results for class [com.ericsson.ctsn.cms.web.formbean.LoginForm]
0821 18:47:54:513DispatcherServlet:963]- Rendering view [org.springframework.web.servlet.view.InternalResourceView: name 'Login'; URL [/WEB-INF/jsp/Lo
gin.jsp]] in DispatcherServlet with name 'dispatcherServlet'
0821 18:47:54:517InternalResourceView:234]- Rendering view with name 'Login' with model {command=com.ericsson.ctsn.cms.web.formbean.LoginForm@ad5867,
org.springframework.validation.BindException.command=org.springframework.validation.BindException: BindException: 0 errors} and static attributes {}
0821 18:47:54:521InternalResourceView:141]- Added model object 'org.springframework.validation.BindException.command' of type [org.springframework.val
idation.BindException] to request in InternalResourceView 'Login'
0821 18:47:54:531InternalResourceView:141]- Added model object 'command' of type [com.ericsson.ctsn.cms.web.formbean.LoginForm] to request in Internal
ResourceView 'Login'
0821 18:47:54:550DispatcherServlet:411]- Could not complete request
java.lang.ClassCastException
at antlr.CharScanner.makeToken(CharScanner.java:173)
at weblogic.servlet.jsp.JspLexer.mWORD(JspLexer.java:4723)
at weblogic.servlet.jsp.JspLexer.mPAGE_DIRECTIVE_ATTRIBUTES(JspLexer.java:5286)
at weblogic.servlet.jsp.JspLexer.mPAGE_DIRECTIVE_BODY(JspLexer.java:5122)
at weblogic.servlet.jsp.JspLexer.mPAGE_DIRECTIVE(JspLexer.java:4934)
at weblogic.servlet.jsp.JspLexer.mDIRECTIVE(JspLexer.java:4756)
at weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(JspLexer.java:2161)
at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1947)
at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java:1820)
at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:963)
at weblogic.servlet.jsp.JspParser.doit(JspParser.java:106)
at weblogic.servlet.jsp.JspParser.parse(JspParser.java:234)
at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:125)
at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:258)
at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:396)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:246)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:196)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:598)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:406)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:328)
at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:111)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:965)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:744)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:663)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:394)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:348)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:75)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6987)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3892)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2766)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
0821 18:47:54:558XmlWebApplicationContext:215]- Publishing event in context [WebApplicationContext for namespace 'dispatcherServlet-servlet']: Request
HandledEvent: url=[/cms/Login.do]; time=[69ms]; client=[198.24.9.248]; method=[GET]; servlet=[dispatcherServlet]; session=[null]; user=[null]; status=
[failed: java.lang.ClassCastException]
拿直原始的武器来解决原始的问题:)
一、找这个类antlr.CommonToken
F:\>java -cp . JarClassFind D:\BEA\WebLogic81 antlr.CommonToken
Find class [antlr.CommonToken] in Path [D:\BEA\WebLogic81] Results:
No.1
Jar Package:D:\BEA\WebLogic81\server\lib\weblogic.jar
antlr/CommonToken.class
Find Process Ended! Total Results:1
2、分析配置文件
由于我在weblogic.xml里设置前加载
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
而且我的WEB-INF\lib\下有antlr-2.7.6rc1.jar的包,于是冲突了!导致ClassCastException
三、解决方法:
1、去掉前加载的配置;
2、去掉应用WEB-INF\lib\下的包含antlr.CommonToken类的antlr-2.7.6rc1.jar的包