LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 04-15-2010, 08:24 AM   #1
captain_sensible
Member
 
Registered: Apr 2010
Posts: 72

Rep: Reputation: 0
tomcat5.5 mostly working , slight tweaking needed


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 off line 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 thats 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 referening 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 expalin 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 devwelopment are referencing a taglib. I think the problem is to do with down loading as root and there is a permission block somewhere. 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: <p>
18: See other reviews:<br />
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 anybody
 
Old 05-16-2010, 11:33 AM   #2
thecarpy
Member
 
Registered: Apr 2005
Location: France
Distribution: Debian Squeeeeze
Posts: 116

Rep: Reputation: 18
You always install software as root, well, not always. But be it with sudo apt-get or Synaptic, you need to provide the root password, so you are root anyway. This is not the problem, I think.
The important thing, though, is that tomcat is started as the correct user ... how do you start tomcat?
 
Old 05-17-2010, 10:05 AM   #3
captain_sensible
Member
 
Registered: Apr 2010
Posts: 72

Original Poster
Rep: Reputation: 0
hi

thanks very much for your reply. After the post got fed up with Tomcat5.5, especially after ten minutes trying localhost:8080 instead of :8081 !Tomcat5.5 is the only version via synaptic on Simply Mepis .


Had a go at Tomcat6 install which had previously successfully installed on Jaunty Jackel.

I posted how I did it here : http://mepislovers.org/showthread.php?t=26157

Its not factually correct such as in the web.xml it mentions a wwwboard servlet . It will work for me but not others. It needs cleaning up but would like to put it on my web site with screen shots for other newbies.
You know for someone like me you can achieve a lot with little code. Setting up a simple jsp test environment where yo want to see how one page interacts with another can be quite difficult.

cheers andy brookes
http://www.nkran.net
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Installed tomcat5 with yum but Not Working Mustafa^Qasim Linux - Software 1 03-12-2010 08:42 AM
Tweaking the spedd of OpenVPN, help needed. Alexander.s Linux - Networking 1 12-21-2009 08:26 AM
Why is tomcat5 still unstable?!!!!! Mathsniper Debian 1 08-28-2005 05:04 AM
Installing Tomcat5 Randvegeta Linux - Software 1 05-07-2005 05:32 AM
Connection tweaking needed arrruken Linux - Networking 5 05-28-2003 11:24 AM


All times are GMT -5. The time now is 09:56 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration