Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Struts - A MVC web framework
Tomcat - JSP/Servlet container
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
JSP - A mailing list about Java Server Pages specification and reference
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
RE: Problems running pre-compiled JSP classes when in subdirector
   ies

RE: Problems running pre-compiled JSP classes when in subdirector
   ies

2004-01-07       - By Edson Alves Pereira

 Back
Reply:     1     2  

  That�s the answer, you need to specify org.apache as your JSP
package. Here�s a example from my build.xml how to use <jspc>

  <jspc   srcdir   ="${webapp}/jsp"   //Place where JSPC can find
web.xml
    destdir   ="${webapp}"     //place where jsp files will
be created
    verbose   ="9"
    package="org.apache"     //root package
    uriroot   ="jsp"       // alias that you would use
for JSP pages
    webxml   ="${webapp}/WEB-INF/jsp.xml"   // file to manage
JSP files
    classpathref="base-path">
    <webapp basedir="${webapp}"/>
  </jspc>


> -- ---- --
> De:   Antony Paul[SMTP:antonypaul24@(protected)]
> Responder:   Tomcat Users List
> Enviada:   quarta-feira, 7 de janeiro de 2004 11:13
> Para:   Tomcat Users List
> Assunto:   Re: Problems running pre-compiled JSP classes when in
> subdirectories
>
> I think the problem is the compiled source file is not in the
> org.apache.jsp
> package. How to set this in jspc task.
>
> Antony Paul
>
> -- -- Original Message -- --
> From: "Antony Paul" <antonypaul24@(protected)>
> To: "Tomcat Users List" <tomcat-user@(protected)>
> Sent: Wednesday, January 07, 2004 7:41 PM
> Subject: Re: Problems running pre-compiled JSP classes when in
> subdirectories
>
>
> > exception
> >
> > javax.servlet.ServletException Source code of javax.servlet.ServletException: org/apache/jsp/index_jsp (wrong name:
> > index_jsp)
> > at org.apache.jasper.servlet.JspServlet Source code of org.apache.jasper.servlet.JspServlet(JspServlet.java:249)
> > at javax.servlet.http.HttpServlet Source code of javax.servlet.http.HttpServlet(HttpServlet.java:853)
> >
> >
> > java.lang.NoClassDefFoundError Source code of java.lang.NoClassDefFoundError: org/apache/jsp/index_jsp (wrong name:
> > index_jsp)
> > at java.lang.ClassLoader Source code of java.lang.ClassLoader(Native Method)
> > at java.lang.ClassLoader Source code of java.lang.ClassLoader(ClassLoader.java:502)
> > at java.lang.ClassLoader Source code of java.lang.ClassLoader(ClassLoader.java:431)
> > at
> org.apache.jasper.servlet.JasperLoader Source code of org.apache.jasper.servlet.JasperLoader(JasperLoader.java:215)
> > at
> org.apache.jasper.servlet.JasperLoader Source code of org.apache.jasper.servlet.JasperLoader(JasperLoader.java:131)
> >
> >
> > Interestingly if the jsp is comiled to servlet using jspc ant task and
> page
> > is requested through browser then everything
> > goes fine. If the generated source file is compiled using javac target
> of
> it
> > is showing this error.
> >
> > Antony Paul
> > -- -- Original Message -- --
> > From: "Edson Alves Pereira" <eapereira@(protected)>
> > To: "'Tomcat Users List'" <tomcat-user@(protected)>
> > Sent: Wednesday, January 07, 2004 8:12 PM
> > Subject: RE: Problems running pre-compiled JSP classes when in
> > subdirectories
> >
> >
> > > Show us the exception how it appears to you.
> > >
> > > > -- ---- --
> > > > De: Jay Glanville[SMTP:jay.glanville@(protected)]
> > > > Responder: Tomcat Users List
> > > > Enviada: quarta-feira, 7 de janeiro de 2004 10:20
> > > > Para: 'Tomcat Users List'
> > > > Assunto: Problems running pre-compiled JSP classes when in
> > > > subdirectories
> > > >
> > > > I originally posted this question back in mid-December, but without
> any
> > > > responses.  In the hopes that someone will have a hit or a solution,
> I'm
> > > > reposting the question again.
> > > >
> > > >
> > > > I'm having a problem when I try to use my pre-compiled JSP files: I
> > > > receive a NoClassDefFoundError exception.  Here's what I'm doing ...
> > > >
> > > > I have pre-compiled my JSP classes using the JspC plugin from ant.
> My
> > > > files compile without complaint.  However, when I try to access the
> > > > files through tomcat, I receive some NoClassDefFoundError
> exceptions.
> > > > But these exceptions only occur when I'm accessing JSPs in the
> > > > subdirectories off of the web root.
> > > >
> > > > Here's my application's background.  I have two files:
> > > >   <WEBROOT>/index.jsp
> > > >   <WEBROOT>/dir/index.jsp
> > > > The contents of the two files are just simple HTML.  I precompiled
> the
> > > > JSP using the JspC ant target, then compiled using javac.  Finally,
> I
> > > > created a context pointing the work directory to the location of my
> java
> > > > and class files.  When I tried to access the first file
> > > > (http://localhost/context/index.jsp) everything went fine.  However,
> > > > when I tried to access the second file
> > > > (http://localhost/context/dir/index.jsp), I received the
> > > > NoClassDefFoundError.  The log file looks like this:
> > > >
> > > > 2003-12-15 20:11:25 StandardWrapperValve[jsp]: Servlet.service() for
> > > > servlet jsp threw exception
> > > > javax.servlet.ServletException Source code of javax.servlet.ServletException: org/apache/jsp/index_jsp (wrong
> name:
> > > > org/apache/jsp/dir/index_jsp)
> > > > at
> > > > org.apache.jasper.servlet.JspServlet Source code of org.apache.jasper.servlet.JspServlet(JspServlet.java:249)
> > > > at javax.servlet.http.HttpServlet Source code of javax.servlet.http.HttpServlet(HttpServlet.java:853)
> > > >         [deleted ...]
> > > > -- -- Root Cause -- --
> > > > java.lang.NoClassDefFoundError Source code of java.lang.NoClassDefFoundError: org/apache/jsp/index_jsp (wrong
> name:
> > > > org/apache/jsp/dir/index_jsp)
> > > > at java.lang.ClassLoader Source code of java.lang.ClassLoader(Native Method)
> > > > at java.lang.ClassLoader Source code of java.lang.ClassLoader(ClassLoader.java:537)
> > > > at java.lang.ClassLoader Source code of java.lang.ClassLoader(ClassLoader.java:448)
> > > > at
> > > >
> org.apache.jasper.servlet.JasperLoader Source code of org.apache.jasper.servlet.JasperLoader(JasperLoader.java:215)
> > > >         [deleted]
> > > >
> > > > Now, according to my research on this mailing list, the most
> frequent
> > > > reason for a NoClassDef error is capitalization.  However, this
> isn't
> > > > the case in my situation as the two package names are completely
> > > > different: org/apache/jsp/index_jsp vs.
> org/apache/jsp/dir/index_jsp.
> > > >
> > > > I'm using Tomcat 4.1.29.
> > > >
> > > > Any suggestions on how to alleviate this situation would be greatly
> > > > appreciated.
> > > >
> > > > Thanks
> > > >
> > > > JDG
> > > >
> > > > PS: I should also point out that I have tried the recommended way of
> > > > precompiling my JSP by converting to servlets
> > > >
> (http://jakarta.apache.org/tomcat/tomcat-4 (See http://cat-4.ora-code.com).1-doc/jasper-howto.html#Web%2
> > > > 0Application%20Compilation).  However, I have a problem with this
> > > > method: it makes it that much harder to patch my application.  With
> the
> > > > non-servlet approach, I just simply deliver the modified JSP files.
> With
> > > > the servlet approach, I need to deliver the classes, plus ensure
> that
> > > > the web.xml is correct (add new entries, remove old ones, modify
> where
> > > > needed), plus restart the context.
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Jay Glanville
> > > >
> > > >
> > > >
> > > >
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
> > > > To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
> > > > For additional commands, e-mail: tomcat-user-help@(protected)
> > > >
> > >
> >
> > -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
> > For additional commands, e-mail: tomcat-user-help@(protected)
> >
> >
>
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
> For additional commands, e-mail: tomcat-user-help@(protected)
>

©2008 junlu.com - Jax Systems, LLC, U.S.A.