The original Web project was run on Weblogic8, but now the requirement is to run into JBOSS5, preparing for a later migration to a later version of JBoss
Because I did not study WebLogic, so the previous steps have been carried out by others, in the half of the time, due to certain circumstances, and gave me to complete.
At this point he encountered two main problems, the following is the main log:
2016-03-31 03:36:59,787 ERROR [org.apache.catalina.core.containerbase.[ Jboss.web]. [localhost]. [/home]. [JSP]] (http-0.0.0.0-56880-1) Servlet.service () for Servlets JSP threw exceptionjava.lang.NullPointerException at O Rg.apache.jsp.jsp.login_jsp._jspservice (login_jsp.java:2813) at Org.apache.jasper.runtime.HttpJspBase.servi CE (httpjspbase.java:70) at Javax.servlet.http.HttpServlet.service (httpservlet.java:717) at O Rg.apache.jasper.servlet.JspServletWrapper.service (jspservletwrapper.java:369) at Org.apache.jasper.servlet . Jspservlet.servicejspfile (jspservlet.java:322) at Org.apache.jasper.servlet.JspServlet.service (JSPSERVLET.J ava:249) at Javax.servlet.http.HttpServlet.service (httpservlet.java:717) at Org.apache.catal Ina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:290) at org.apache.catalina.co Re. Applicationfilterchain.dofilter (Applicationfilterchain.java:206) at Org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter (Replyheaderfilte r.java:96) at Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (Applicationfilterchain.java: 235) at Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:206) At Org.apache.catalina.core.StandardWrapperValve.invoke (standardwrappervalve.java:235) at Org.apache. Catalina.core.StandardContextValve.invoke (standardcontextvalve.java:191) at ORG.JBOSS.WEB.TOMCAT.SECURITY.S Ecurityassociationvalve.invoke (securityassociationvalve.java:190) at Org.jboss.web.tomcat.security.JaccCont Extvalve.invoke (jacccontextvalve.java:92) at Org.jboss.web.tomcat.security.SecurityContextEstablishmentValv E.process (securitycontextestablishmentvalve.java:126) at Org.jboss.web.tomcat.security.SecurityContextEstab Lishmentvalve.invoke (SecURITYCONTEXTESTABLISHMENTVALVE.JAVA:70) at Org.apache.catalina.core.StandardHostValve.invoke (Standardhostva lve.java:127) at Org.apache.catalina.valves.ErrorReportValve.invoke (errorreportvalve.java:102) At Org.apache.catalina.core.StandardEngineValve.invoke (standardenginevalve.java:109) at Org.apache.catal Ina.connector.CoyoteAdapter.service (coyoteadapter.java:330) at Org.apache.coyote.http11.Http11Processor.pro Cess (http11processor.java:829) at Org.apache.coyote.http11.http11protocol$http11connectionhandler.process (H ttp11protocol.java:598) at Org.apache.tomcat.util.net.jioendpoint$worker.run (jioendpoint.java:447) At Java.lang.Thread.run (thread.java:662) 8:15:30,538 INFO [cachedconnectionmanager:info:307] Closing a connection F Or you. Please close them yourself:org.jboss.resource.adapter. [Email protected]ava.lang.throwable:stacktrace at Org.jboss.resource.cOnnectionmanager. Cachedconnectionmanager.registerconnection (cachedconnectionmanager.java:278) at Org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection (baseconnectionmanager2.java:524 ) at Org.jboss.resource.connectionmanager.baseconnectionmanager2$connectionmanagerproxy.allocateconnection ( baseconnectionmanager2.java941)
This section of log is when you use a browser to access a JSP page, from the log, you can divide it into two parts
1, the first part in the beginning of the time did not understand, and the location of the log is not clear enough, so first look at the second part
In this section, main see please close them yourself: [email protected]
It means, let's close a resource, the following string represents a connection, in the back of the log (log sensitive so not added) really to locate in the code to get datasource , after the study found that When the page is accessed, the data source is fetched two times from the container through Jndi, but does not know why there is no close recycle after the first fetch and end of use, and then the second time this error occurs.
And in the JBoss console can see the number of database connections display exception (set the original amount of 20, you can use 20, you are using 0, and once you try to connect to the JSP 19, is using 2, more than the normal total number of one).
The solution is found on a foreign site:
Step 1: $JBOSS _home/server/segment/deploy/jbossweb.sar/server.xml Comment or delete the ClassName cachedconn Ectionvalue:<!--Valve classname= "Org.jboss.web.tomcat.service.jca.CachedConnectionValve" cachedconnectionmanagerobjectn Ame= "Jboss.jca:service=cachedconnectionmanager" Transactionmanagerobjectname= "Jboss:service=transactionmana Ger "/ -Step 2: $JBOSS _home/server/segment/deploy/jbossweb.sar/meta-inf/jboss-beans.xml Comment or delete Cachedcon Nectionmanager:<!--<depends>jboss.jca:service=CachedConnectionManager</depends> -Step 3: $JBOSS _home/server/segment/conf/standardjboss.xml Comment or delete all cachedconnectionintercept or statements:<!--<interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor> -
After using this method, the above exception disappears.
2. Now look at the first exception
This exception I saw for the first time, the expression can not understand, and then cut the log to Baidu.
Baidu returned a lot of solutions, but in general it is a package conflict, said that the project contains the JSP and servlet jar and JBoss jar conflict, do not know what the people on the Internet to provide these solutions to meet the specific situation, anyway, according to these solutions to make me more and more biased.
Finally asked the great God to see, although did not see the specific problem, but gave me a direction, let me go to see the specific JSP code.
However, because the project is completed earlier, and then the code is written in a way that is primitive, is embedded in the JSP Java fragment, so studied, the most critical log:
Org.apache.jsp.jsp.login_jsp._jspservice (login_jsp.java:2813)
Did not understand at first, then went back to the JSP in JBoss startup load situation. It is found that the JSP is converted into a servlet when JBoss is started, and the servlet converted into JBOSS5 is placed in the segment work file, where it can be found at a level of Login_jsp.java . , it is certainly easier to see the servlet than to look at the JSP, and then you can quickly navigate to 2813 rows to find out why it went wrong.
The last magical thing came, and I found that the problem was solved, and another problem was gone ...
Its connection blocking is generated by it (just in this code).
Web Engineering Migration---WEBLOGIC8 migration to JBOSS5 exception encountered