[jdom-interest] Help need to cofugure tomcat3.2 and jdom

Matthew MacKenzie matt at xmlglobal.com
Sat Oct 20 11:04:35 PDT 2001


JDOM is not in the WebApp's classpath.  Try putting jdom.jar into either
<webapp>/WEB-INF/lib or
<tomcat>/lib, and make sure there is a jaxp.jar and crimson.jar.  With
tomcat 3.x, I generally remove the jaxp and parser jars from <tomcat>/lib
and replace the with whatever JDOM ships with.

Regards,

Matt
----- Original Message -----
From: "koka phani" <phanikoka at rediffmail.com>
To: <jdom-interest at jdom.org>
Sent: Saturday, October 20, 2001 4:57 AM
Subject: [jdom-interest] Help need to cofugure tomcat3.2 and jdom


>
> Hi all,
>
>        I am using tomcat 3.2 and jdom-b7.
>
>  I am calling bean from jsp file.The bean is working standalone but i am
getting errors when i try to call that using jsp.
>
> Erros:
>
> Internal Servlet Error:
>
>
> javax.servlet.ServletException: org/jdom/input/DOMBuilder
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:508)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
> at org.apache.tomcat.core.Handler.service(Handler.java:287)
> at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
> at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
> at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
(Ajp12ConnectionHandler.java:166)
> at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
> at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
> at java.lang.Thread.run(Thread.java:484)
>
> Root cause:
>
> java.lang.NoClassDefFoundError: org/jdom/input/DOMBuilder
> at java.lang.Class.newInstance0(Native Method)
> at java.lang.Class.newInstance(Class.java:237)
> at java.beans.Beans.instantiate(Beans.java:207)
> at java.beans.Beans.instantiate(Beans.java:51)
> at
jsp.d_00025mbean._0002fjsp_0002fdombean_0002fstockadd_0002ejspstockadd_jsp_7
._jspService(_0002fjsp_0002fdombean_0002fstockadd_0002ejspstockadd_jsp_7.jav
a:75)
> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.ja
va:130)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:282)
> at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
> at org.apache.jasper.servlet.JspServlet
> let.http.HttpServlet.service(HttpServlet.java:853)
> at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
> at org.apache.tomcat.core.Handler.service(Handler.java:287)
> at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
> at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
> at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
(Ajp12ConnectionHandler.java:166)
> at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
> at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
> at java.lang.Thread.run(Thread.java:484)
>
> I place jdom.jar in tomcat/lib and update the tomcat.bat file
>
> if exist "%TOMCAT_HOME%\lib\jdom.jar" set
CP=%CP%;%TOMCAT_HOME%\lib\jdom.jar
>
> Why i am getting errors. My jsp and bean are given below.
>
> Plese help me  out from this .Thanks in advance.
>
> I am passing stock,name,price values for another jsp file to add.jsp file.
>
> add.jsp
>
> <html>
>
> <head>
>
> <title>Serch Results</title>
>
> <%@ page import="dombean.*" %>
>
> </head>
>
> <jsp:useBean id="addBean" class="dombean.addelements"/>
>
> <body>
>
> <%String symbol=request.getParameter("symbol");%>
>
> <%String name=request.getParameter("name");%>
>
> <%String price=request.getParameter("price");%>
>
> <%addBean.adding(symbol,name,price);%>
>
> <%=symbol%>
>
> </body>
>
> </html>
>
> My addelements.java :
>
> package dombean;
>
> import java.io.FileInputStream;
>
> import java.io.FileOutputStream;
>
> import org.jdom.Document;
>
> import org.jdom.Element;
>
> import org.jdom.input.DOMBuilder;
>
> import org.jdom.output.XMLOutputter;
>
> public class addelements{
>
> public void adding(String symbol,String name,String price)
>
> {
>
> String Symbol=symbol;
>
> String Name=name;
>
> String Price=price;
>
> try
>
> {
>
> DOMBuilder builder=new DOMBuilder("org.jdom.adapters.XercesDOMAdapter");
>
> Document doc=builder.build(new FileInputStream("c:/xm
> tElement();
>
> Element parent=new Element("stock");
>
> Element child1=new Element("symbol").setText(symbol);
>
> Element child2=new Element("name").setText(name);
>
> Element child3=new Element("price").setText(price);
>
> root.addContent(parent);
>
> parent.addContent(child1);
>
> parent.addContent(child2);
>
> parent.addContent(child3);
>
> XMLOutputter fmt=new XMLOutputter();
>
> fmt.output(doc,new FileOutputStream("stocks.xml"));
>
> }
>
> catch(Exception e)
>
> {
>
> e.printStackTrace();
>
> }
>
> }
>
> }
>
> Thanks in advance
>
> phani
>
>
>
>
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com
>




More information about the jdom-interest mailing list