MrCasio MrCasio - 7 months ago 5
Java Question

Transferring Tomcat files from one server to another

I'm new to this, and I've been asked by work to move a internal Tomcat server and webapps to another (long story why I got this task). I'm not 100% sure what's involved here. The website is primarily written in JSP, which I know very little of.
What I've done so far is install Tomcat 6.0 (this is the version on the original server), copied the webapps folder containing the site and placed it in the new webapps folder. Not surprised it didn't work but need help on diagnosing or reconfiguring to get this working again. Any help please?

Error I get when I load the main.jsp

HTTP Status 500 - An exception occurred processing JSP page /pages/main.jsp at line 1

type Exception report

message An exception occurred processing JSP page /pages/main.jsp at line 1

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: An exception occurred processing JSP page /pages/main.jsp at line 1

1: <jsp:include page="\includes\header.jsp" />
2: <div id="index" class="page">
3: <h2>Welcome to helpdesk Webnotes</h2>
4: <h3>Machine Search Tool</h3>


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:521)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:412)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
root cause

org.apache.jasper.JasperException: An exception occurred processing JSP page /pages/includes/header.jsp at line 13

10: </head>
11: <body>
12: <jsp:include page="sidebar.jsp" />
13: <jsp:include page="menu.jsp" />
14: <div id="content">
15: <noscript>
16: <h2></h2>


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:521)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:412)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
org.apache.jsp.pages.main_jsp._jspService(main_jsp.java:53)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
root cause

org.apache.jasper.JasperException: An exception occurred processing JSP page /pages/includes/menu.jsp at line 56

53:
54: //Execute Query
55: try{
56: pst = con.prepareStatement("select m.parent_menu as mainMenu,m.menu_title as subMenu,a.menu_title as articleTitle,a.article_id as articleId from articles a left join menu m on m.menu_id = a.menu_id where a.menu_title is not null order by parent_menu desc,menu_order");
57: rs = pst.executeQuery();
58: out.print("<div id=\"zmenu\">\r\n\t<ul class=\"mainmenu\">\r\n");
59: out.print("\t\t<li><a href=\"main.jsp\">Search</a></li>\r\n");


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:521)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:430)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
org.apache.jsp.pages.includes.header_jsp._jspService(header_jsp.java:67)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
org.apache.jsp.pages.main_jsp._jspService(main_jsp.java:53)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
root cause

java.lang.NullPointerException
org.apache.jsp.pages.includes.menu_jsp._jspService(menu_jsp.java:113)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
org.apache.jsp.pages.includes.header_jsp._jspService(header_jsp.java:67)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
org.apache.jsp.pages.main_jsp._jspService(main_jsp.java:53)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.45 logs.

Apache Tomcat/6.0.45

Answer

Seems like you have a problem with

 pst = con.prepareStatement("select m.parent_menu as mainMenu,m.menu_title as subMenu,a.menu_title as articleTitle,a.article_id as articleId from articles a left join menu m on m.menu_id = a.menu_id where a.menu_title is not null order by parent_menu desc,menu_order");

Have you set up a database connection in the new server?

And probably you should read the logs of the server (as indicated in the last line)

Hope this helps a bit.

Regards, Patrick

Comments