Re: JSTL XML ---org/apache/xpath/XPathException
"Kris Schneider" <[email protected]> Wed, 16 Jul 2008 00:48:56 -0400
| Newsgroups | gmane.comp.jakarta.taglibs.user |
|---|---|
| Message-ID | <[email protected]> |
When Tomcat starts up, it sets the java.endorsed.dirs system property to its common/endorsed dir. Check this out: http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html#XML%20Parsers%20and%20J2SE%201.4 You could also try putting the JARs in your app's WEB-INF/lib dir (this would be the preferred approach if you couldn't install them on the server). On Wed, Jul 16, 2008 at 12:00 AM, Rajasekhar <[email protected]> wrote: > Hi > > Thank you very much Mr. Kris. Its working for me. I have placed XercesImpl.jar and xalan.jar into the tomcat/common/endorsed folder as you specified. > > I have downloaded these jars from the site http://www.apache.org/dist/xerces/j/ > > Can you tell me whats the purpose of endorsed folder. cant these jars workout if they are placed in tomcat/common/lib directory ?? > > > Thanks & Regards > Rajasekhar > > > > > > > --- On Tue, 15/7/08, Kris Schneider <[email protected]> wrote: > > From: Kris Schneider <[email protected]> > Subject: Re: JSTL XML ---org/apache/xpath/XPathException > To: "Tag Libraries Users List" <[email protected]> > Date: Tuesday, 15 July, 2008, 7:43 PM > > Make sure that you have *both* Xerces and Xalan installed. You can put > the JARs in Tomcat's common/endorsed directory. > > On Tue, Jul 15, 2008 at 12:04 AM, Rajasekhar <[email protected]> wrote: >> >> The "out.jsp" contains >> ======================================================== >> <%@ taglib prefix="c" > uri="http://java.sun.com/jsp/jstl/core" %> >> <%@ taglib prefix="x" > uri="http://java.sun.com/jsp/jstl/xml" %> >> <html> >> <head> >> <title>JSTL: XML Support -- Parse / Out</title> >> </head> >> <body bgcolor="#FFFFFF"> >> <h3><x:parse> / <x:out></h3> >> <c:import var="docString" url="games.xml"/> >> <x:parse var="doc" doc="${docString}"/> >> <table border=1> >> <tr> >> <td valign="top"><pre><c:out > value="${docString}"/></pre></td> >> <td valign="top"> >> <table border=1> >> <tr> >> <th>Expression</th> >> <th>Result</th> >> </tr> >> <%-- >> <tr> >> <td>3 + 3</td> >> <td><pre><x:out select="3 + > 3"/></pre></td> >> </tr> >> --%> >> <tr> >> <td>$doc//sport</td> >> <td><pre><x:out > select="$doc//sport"/></pre></td> >> </tr> >> <tr> >> <td>$doc/games/country/*</td> >> <td><pre><x:out > select="$doc/games/country/*"/></pre></td> >> </tr> >> <tr> >> <td>$doc//*</td> >> <td><pre><x:out > select="$doc//*"/></pre></td> >> </tr> >> <tr> >> <td>$doc/games/country</td> >> <td><pre><x:out > select="$doc/games/country"/></pre></td> >> </tr> >> <tr> >> <td>$doc/games/country[last()]</td> >> <td><pre><x:out > select="$doc/games/country[last()]"/></pre></td> >> </tr> >> <tr> >> <td>$doc//@id</td> >> <td><pre><x:out > select="$doc//@id"/></pre></td> >> </tr> >> <tr> >> <td>$doc//country[@id='Denmark']</td> >> <td><pre><x:out > select="$doc//country[@id='Denmark']"/></pre></td> >> </tr> >> </table> >> </td> >> </tr> >> </table> >> </body> >> </html> >> ====================================================== >> games.xml contains >> >> =========================== >> >> >> <?xml version="1.0" encoding="ISO-8859-1"?> >> <games> >> <country id="Luxembourg"> >> <athlete> >> <name>Lux 1</name> >> <sport>swimming</sport> >> <age>23</age> >> <gender>M</gender> >> </athlete> >> <athlete> >> <name>Lux 2</name> >> <sport>wrestling</sport> >> <age>31</age> >> <gender>M</gender> >> </athlete> >> </country> >> <country id="Denmark"> >> <athlete> >> <name>Den 1</name> >> <sport>cycling</sport> >> <age>18</age> >> <gender>F</gender> >> </athlete> >> <athlete> >> <name>Den 2</name> >> <sport>sailing</sport> >> <age>27</age> >> <gender>M</gender> >> </athlete> >> </country> >> </games> >> ============================ >> >> I am using Tomcat 5.5 app svr. >> >> when I run the web app the following errors are shown >> >> >> HTTP Status 500 - >> >> >> type Exception report >> message >> description The server encountered an internal error () that prevented it > from fulfilling this request. >> exception javax.servlet.ServletException: org/apache/xpath/XPathException >> > org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848) >> > org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781) >> > org.apache.jsp.xml.Out_jsp._jspService(org.apache.jsp.xml.Out_jsp:155) >> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) >> javax.servlet.http.HttpServlet.service(HttpServlet.java:802) >> > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) >> > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291) >> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) >> javax.servlet.http.HttpServlet.service(HttpServlet.java:802) >> >> >> root cause java.lang.NoClassDefFoundError: org/apache/xpath/XPathException >> java.lang.ClassLoader.defineClass1(Native Method) >> java.lang.ClassLoader.defineClass(ClassLoader.java:620) >> > java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) >> > org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1629) >> > org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:850) >> > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1299) >> > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181) >> java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) >> > org.apache.taglibs.standard.tag.common.xml.ExprSupport.doStartTag(ExprSupport.java:63) >> > org.apache.jsp.xml.Out_jsp._jspx_meth_x_out_0(org.apache.jsp.xml.Out_jsp:230) >> > org.apache.jsp.xml.Out_jsp._jspService(org.apache.jsp.xml.Out_jsp:97) >> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) >> javax.servlet.http.HttpServlet.service(HttpServlet.java:802) >> > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) >> > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291) >> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) >> javax.servlet.http.HttpServlet.service(HttpServlet.java:802) >> >> >> note The full stack trace of the root cause is available in the Apache > Tomcat/5.5.9 logs. >> >> >> Thanks & Regards >> Rajasekhar >> >> >> >> >> >> >> --- On Mon, 14/7/08, Kris Schneider <[email protected]> wrote: >> >> From: Kris Schneider <[email protected]> >> Subject: Re: JSTL XML ---org/apache/xpath/XPathException >> To: "Tag Libraries Users List" > <[email protected]> >> Date: Monday, 14 July, 2008, 10:49 PM >> >> Can you provide some more details about how you're using the tag and >> which app server and version you're using? >> >> On Mon, Jul 14, 2008 at 10:49 AM, Rajasekhar <[email protected]> > wrote: >>> Hi >>> >>> I have used xml tags of jstl in my jsp. but it throwing errors like > the >> following..How can I get rid of it. >>> javax.servlet.ServletException: org/apache/xpath/XPathException >>> >> > org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848) >>> >> > org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781) >>> >> org.apache.jsp.xml.Out_jsp._jspService(org.apache.jsp.xml.Out_jsp:155) >>> > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) >>> javax.servlet.http.HttpServlet.service(HttpServlet.java:802) >>> >> > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) >>> >> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291) >>> > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) >>> javax.servlet.http.HttpServlet.service(HttpServlet.java:802) >>> >>> >>> root cause >>> >>> >>> Thanks & Regards >>> Rajasekhar >> >> -- >> Kris Schneider <mailto:[email protected]> >> directThought <http://www.directThought.com/> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> >> Unlimited freedom, unlimited storage. Get it now, on > http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/ > > > > -- > Kris Schneider <mailto:[email protected]> > directThought <http://www.directThought.com/> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > > Bring your gang together. Do your thing. Find your favourite Yahoo! group at http://in.promos.yahoo.com/groups/ -- Kris Schneider <mailto:[email protected]> directThought <http://www.directThought.com/>