I have a slight problem with my off line tomcat5.5 web development
servlet engine .Firstly I must mention that all the
jsp files etc that DON'T WORK ofline DO WORK on my web site.
tomcat5.5 was installed on "Simply Mepis" a debian based linux system. There is no sudo apt-get install tomcat5.5 in Mepis, so I had to log in as root , and then # apt-get install sun-java5-jdk
# apt-get install tomcat5.5
i think that maybe part of the problem , tomcat5.5 downloaded as root ?
Simple jsp files work, such as those having something like
<jsp:include page="newtop.jsp" />
but jsp files that reference a taglib jar file don't work.
such as : <%@ taglib uri="WEB-INF/lib/navtag.jar" prefix="Set" %> on my offline, ( but DO WORK on web site).
I think its either my system can not see the jar files in the lib directory at:
/var/lib/tomcat5.5/webapps/ROOT/WEB-INF/lib or that its a permission thing.
briefly let me explain the set up:
after installation the default index.jsp was in : var/lib/tomcat5.5/webapps/ROOT
what I did is add my own jsp files ,html ,.css to ROOT folder. I put jar files in WEB-INF/lib . I made ROOT chown -R user
and chmod -R 777 for user , and I simply amended the web.xml inside WEB-INF referencing the taglibs so:
<taglib>
<taglib-uri>/WEB-INF</taglib-uri>
<taglib-location>/WEB-INF/lib/taglib191.tld</taglib-location>
</taglib>
I have used the same web.xml on the web and it works.
as mentioned the only jsp NOT working on my off line tomcat5.5 web development are referencing a taglib. I am not sure if its about permissions
now, since i logged back in as a session as "root" at
http://localhost:8180/index.jsp worked , plus all jsp's except those referencing taglib.
The other things is I can not seems to actually see whats in classpath or get much info out of system .
echo $CLASSPATH gives nothing all i have out of the system is:
find / -name *tools.jar* gave this output :
/usr/share/java/mx4j-tools.jar
/usr/lib/jvm/java-1.5.0-sun-1.5.0.17/lib/tools.jar
java -version gave this output
java version "1.5.0_17"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_17-b04)
Java HotSpot(TM) Client VM (build 1.5.0_17-b04, mixed mode, sharing)
at $ env gives:
andrew@mepis1:~$ env
KDE_MULTIHEAD=false
SSH_AGENT_PID=3770
DM_CONTROL=/var/run/xdmctl
TERM=xterm
SHELL=/bin/bash
XDG_SESSION_COOKIE=b3d35c83fa008b2dca2ab900464e6583-1271341634.846513-449761136
XDM_MANAGED=/var/run/xdmctl/xdmctl-:0,maysd,mayfn,sched,rsvd,method=classic
GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/andrew/.gtkrc-2.0:/home/andrew/.kde/share/config/gtkrc-2.0
GTK_RC_FILES=/etc/gtk/gtkrc:/home/andrew/.gtkrc:/home/andrew/.kde/share/config/gtkrc
GS_LIB=/home/andrew/.fonts
WINDOWID=20971528
KDE_FULL_SESSION=true
USER=andrew
SSH_AUTH_SOCK=/tmp/ssh-DEdNfd3738/agent.3738
SESSION_MANAGER=local/mepis1:/tmp/.ICE-unix/3813
KONSOLE_DCOP=DCOPRef(konsole-13032,konsole)
DESKTOP_SESSION=default
PATH=/usr/local/bin:/usr/bin:/bin:/usr/games
KONSOLE_DCOP_SESSION=DCOPRef(konsole-13032,session-1)
PWD=/home/andrew
LANG=en_GB.utf8
KDE_SESSION_UID=1000
SHLVL=2
HOME=/home/andrew
XCURSOR_THEME=default
LOGNAME=andrew
DISPLAY=:0.0
COLORTERM=
_=/usr/bin/env
andrew@mepis1:~$
The output i'm getting is:
The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Exception in JSP: /hotel_link.jsp:20
17:
18: See other reviews:
19: <%@ taglib uri="WEB-INF/lib/navtag.jar" prefix="Set" %>
20: <Set:Navigation separator=" >> ">
21: <Set:link url="/hansonic.jsp" title ="hansonic" />
22: <Set:link url="/esthers_hotel.jsp" title="esthers hotel" />
23: <Set:link url="/big_milly.jsp" title="bigg milly" />
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
root cause
javax.servlet.ServletException: Could not initialize class org.apache.jasper.runtime.BodyContentImpl
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
org.apache.jasper.runtime.PageContextImpl.access$11(PageContextImpl.java:779)
org.apache.jasper.runtime.PageContextImpl$12.run(PageContextImpl.java:761)
java.security.AccessController.doPrivileged(Native Method)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:759)
org.apache.jsp.hotel_005flink_jsp._jspService(hotel_005flink_jsp.java:112)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
root cause
java.lang.NoClassDefFoundError: Could not initialize class org.apache.jasper.runtime.BodyContentImpl
org.apache.jasper.runtime.PageContextImpl.pushBody(PageContextImpl.java:705)
org.apache.jasper.runtime.PageContextImpl.pushBody(PageContextImpl.java:695)
org.apache.jsp.hotel_005flink_jsp._jspx_meth_Set_005fNavigation_005f0(hotel_005flink_jsp.java:131)
org.apache.jsp.hotel_005flink_jsp._jspService(hotel_005flink_jsp.java:80)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5 logs.
any ideas please