WebLogic.jar and servlet-api.jar in Tomcat5.5 also have a conflict!

xiaoxiao2021-03-06  14

WebLogic.jar and servlet-api.jar in Tomcat5.5 also have a conflict!

It's not blamed every day. If you see more, you will not blame.

The EJB layer is basically fixed. The previous test EJB is also writing an Application test, no problem.

Yesterday, I started writing code yesterday, but it's coming. Open the JSP and the following error occurs

TYPE EXCEPTION Report

Message

Description The Server Encountered An Internal Error () That Prevented It from fulventing this request.

EXCEPTION

Javax.Servlet.ServletException: Javax / EJB / EJBOBJECT

Org.apache.jasper.Runtime.pageContextImpl.doHandLePageException (pageContextimpl.java: 846)

Org.apache.jasper.Runtime.pageContextImpl.HandlePageException (pageContextimpl.java: 779)

Org.apache.jsp.index_jsp._jspservice (Org.apache.jsp.Index_jsp: 154)

Org.apache.jasper.Runtime.httpjspBase.Service (httpjspbase.java:99)

Javax.servlet.http.httpservlet.service (httpservlet.java:802)

Org.apache.jasper.servlet.jspservletWrapper.Service (jspservletWrapper.java: 325)

Org.apache.jasper.servlet.jspservlet.Servicejspfile (jspservlet.java: 295)

Org.apache.jasper.servlet.jspservlet.Service (jspservlet.java: 245)

Javax.servlet.http.httpservlet.service (httpservlet.java:802)

Web.filter.changecharsetfilter.dofilter (changecharsetfilter.java: 58)

Root Cause

Java.lang.noclassdefounderror: javax / ejb / ejbobject

Java.lang.classloader.defineclass1 (Native Method)

Java.lang.classloader.defineClass (Unknown Source)

Java.security.secureClassLoader.defineClass (Unknown Source)

Org.apache.catalina.Loader.WebAppclassLoader.FindClassinternal (WebAppclassLoader.java: 1626)

Org.apache.catalina.Loader.WebAppclassLoader.FindClass (WebAppclassLoader.java: 850)

Org.apache.catalina.Loader.WebAppClassLoader.loadClass (WebAppclassLoader.java: 1299)

Org.apache.catalina.Loader.WebappClassLoader.loadClass (WebAppclassLoader.java: 1181)

Java.lang.classloader.loadClassInternal (Unknown Source)

Caiwu.data.Department.Identified (department.java: 418) org.apache.jsp.index_jsp._jspservice (org.apache.jsp.index_jsp: 143)

Org.apache.jasper.Runtime.httpjspBase.Service (httpjspbase.java:99)

Javax.servlet.http.httpservlet.service (httpservlet.java:802)

Org.apache.jasper.servlet.jspservletWrapper.Service (jspservletWrapper.java: 325)

Org.apache.jasper.servlet.jspservlet.Servicejspfile (jspservlet.java: 295)

Org.apache.jasper.servlet.jspservlet.Service (jspservlet.java: 245)

Javax.servlet.http.httpservlet.service (httpservlet.java:802)

Web.filter.changecharsetfilter.dofilter (changecharsetfilter.java: 58)

Note The Full Stack TRACE OF THE ROOT CAUSE IS AVAILABLE IN The Apache Tomcat /

5.5.7

Logs.

Java.lang.noclassdefounderror: javax / ejb / ejbobject ???????????????????????????????????????????

How can I not find the EJBOBJECT class? Check the web-inf / lib directory, indeed WebLogic.jar !?

Go to Baidu to search, see there is a possession that is DR. Jar and Tools.jar in Classpath.

I also checked ClassPath and added it!

Open Tomcat's log, find that there is such a line

2005-3-6 10:44:02 Org.apache.catalina.Loader.WebappclassLoader Validatejarfile

Information: Validatejarfile (D: /JBProject/sf/web/web-inf/lib/weblogic.jar) - JAR NOT Loaded. See Servlet Spec 2.3, Section

9.7.2

Offending class: javax / servlet / servlet.class

See Servlet Spec 2.3, Section

9.7.2

What is the stuff, it is too lazy to check it.

Go to the baidu search, find this more similar

Http://blog.9cbs.net/china2wto/archive/2004/12/09/210527.aspx

The content is as follows.

JAR Package and Web / LIB under Tomcat5 JAR Packet Conflict under the common / lib directory

I am learning Struts, start Tomcat5, basically normal, open ordinary JSP is normal, but open the JSP error associated with struts, as follows: javax.servlet.jsp.pageContext.HandlepageException (ljava / lang / V org.apache.jasper.servlet.jspservlet.service (jspservlet.java: 256) javax.servlet.http.httpservlet.Service (httpservlet.java: 868)

Root Cause

java.lang.NoSuchMethodError: javax.servlet.jsp.PageContext.handlePageException (Ljava / lang / Throwable;) V org.apache.jsp.manager_005findex_jsp._jspService (manager_005findex_jsp.java:84) org.apache.jasper.runtime.HttpJspBase. service (HttpJspBase.java:133) javax.servlet.http.HttpServlet.service (HttpServlet.java:868) org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java:311) org.apache.jasper.servlet. JspServlet.serviceJspFile (JspServlet.java:301) org.apache.jasper.servlet.JspServlet.service (JspServlet.java:248) javax.servlet.http.HttpServlet.service (HttpServlet.java:868) View tomcat5 console monitor found some Abnormal: Information: Validatejarfile (C: / Program Files / Apache Software Foundation / Tomcat 5.0 / WebApps / SOOS / Web-INF / LIB / Servlet-Api.jar) - JAR Not Loaded. See Servlet Spec 2.3, Section

9.7.2

Offending class: javax / servlet / servlet.class

This remembered that I also put J2EE.jar and other packages in Tomcat / Common / Lib /, went to Common / Lib to unnecessary packages, guarantee Tomcat / Common / LIB / and Web-INF / LIB. JAR in a directory has no duplicate, and the problem is solved. It turned out that Tomcat started to read all the JAR packets under Tomcat / Common / Lib directory, if there is the same package in the web-inf / lib directory in the application in the webapps directory, it will not be loaded, estimated different versions A similar problem is also caused between the bag. So I recommend trying to put the JAR package in the Tomcat / Common / Lib directory, should be placed in a web-inf / lib directory.

I saw Tomcat / Common / Lib /, no J2EE.jar, nor WebLogic.jar.

Try to delete WebLogic.jar under the Web-INF / LIB directory.

There is no error above this time, but when you open the JSP or the same fault

Java.lang.noclassdefounderror: javax / ejb / ejbobject

At this time, I went back to check the Tomcat log. Notice that there is such a sentence

Offending class: javax / servlet / servlet.class

Lenovo mentioned the BLOG content, knowing the reason (red word part).

Use WinRAR to open Tomcat5.5 / common / lib / servlet-api.jar and web-inf / lib / weblogic.jar, found that there is the same package javax / servlet / *.

The reason is to find out more.

Remove the javax / servlet / pack in Web-INF / LIB / WebLogic.jar in WinRAR. Restart Tomcat, normal!

But the problem has not been completely resolved, because in the JB Rebuild project, the JAR restored in the Win-INF / LIB directory will return it! It's trouble, simply screened to the root:

Change the settings in the attribute window of the web module: WebModule-> Properties: Content / Dependencies, change WebLogic 8.x Client to [Execude All]. Copy the two files under / bea / weblogic81 / server / lib (WebLogic.jar, Webservices.jar) to Tomcat5.5 / Common / LIB / (now we found that WebLogic.jar has 36M huge, no wonder me The last REBUILD has to wait for N long, the hard disk is around!).

If you start Tomcat now, you will find that even Tomcat strikes!

why?

Because Tomcat started, first read all the JAR packets under Tomcat / Common / Lib directory, at this time, the original servlet-api.jar under Tomcat / Common / lib and the WebLogic.jar that just copied into the WebLogic.jar included When you have a repetition, you find that there is a repetition when you join Javax / servlet /, Tomcat loading.

last step:

Delete Tomcat / Common / lib / servlet-api.jar or use WinRAR to open Tomcax / Servlet directory in Tomcat / Common / LibWebLogic.jar.

Start Tomcat, problem solve!

This small problem wasted for a long time.

转载请注明原文地址:https://www.9cbs.com/read-50267.html

New Post(0)