can't make graph in jsp work

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
jaypee
Posts: 32
Joined: Fri Mar 24, 2006 2:35 am

can't make graph in jsp work

Post by jaypee » Wed May 17, 2006 11:24 am

when i run it on my workstation the jsp works fine but when i run it on the server it shows this error:

org.apache.jasper.JasperException: XML parsing error on file /WEB-INF/web.xml: (line 2, col -1)
org.apache.jasper.compiler.JspConfig.processWebDotXml(JspConfig.java:184)
org.apache.jasper.compiler.JspConfig.init(JspConfig.java:197)
org.apache.jasper.compiler.JspConfig.findJspProperty(JspConfig.java:249)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:103)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
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)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)


root cause

org.apache.jasper.JasperException: XML parsing error on file /WEB-INF/web.xml: (line 2, col -1)
org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:100)
org.apache.jasper.compiler.JspConfig.processWebDotXml(JspConfig.java:76)
org.apache.jasper.compiler.JspConfig.init(JspConfig.java:197)
org.apache.jasper.compiler.JspConfig.findJspProperty(JspConfig.java:249)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:103)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
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)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)


root cause

java.lang.IllegalStateException: can't declare any more prefixes in this context
org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:691)
org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:185)
org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:95)
org.apache.jasper.compiler.JspConfig.processWebDotXml(JspConfig.java:76)
org.apache.jasper.compiler.JspConfig.init(JspConfig.java:197)
org.apache.jasper.compiler.JspConfig.findJspProperty(JspConfig.java:249)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:103)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
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)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)


i'm using netbeans. i don't know what's wrong. please help...

angel
Posts: 899
Joined: Thu Jan 15, 2004 12:07 am
Location: Germany - Palatinate

Re: can't make graph in jsp work

Post by angel » Wed May 17, 2006 11:29 am

jaypee wrote:org.apache.jasper.JasperException: XML parsing error on file /WEB-INF/web.xml: (line 2, col -1)
I doubt that this problem is related to JFreeChart.

jusepi
Posts: 16
Joined: Tue May 09, 2006 1:18 pm
Location: USA

Post by jusepi » Wed May 17, 2006 2:17 pm

you probably have something extra or missing in your web.xml file. Looks like line 2 is a good place to start. Also, you may want to try using an XML editor like the one found in eclipse.

jaypee
Posts: 32
Joined: Fri Mar 24, 2006 2:35 am

Post by jaypee » Thu May 18, 2006 12:07 am

thanks for the reply :-)

here is my web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>

<servlet>
<servlet-name>CewolfServlet</servlet-name>
<servlet-class>de.laures.cewolf.CewolfRenderer</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>CewolfServlet</servlet-name>
<url-pattern>/cewolf/*</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<jsp-config>
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>
</jsp-config>
</web-app>


i only added the Cewolf servlet. i don't know what's wrong with it. please help.

thanks in advance

jaypee
Posts: 32
Joined: Fri Mar 24, 2006 2:35 am

Post by jaypee » Thu May 03, 2007 8:16 am

I decided to implement jfreechart using servlets instead of using cewolf.
I found that cewolf was a bit limited and going with a servlet implementation
provided more flexibility.

JFreeChart is great!

Thanks Dave and to all the people in the forum who have helped and
gave their bits of tips and advices.

Kyaw
Posts: 13
Joined: Wed May 23, 2007 10:34 am
Location: Singapore

Error of adding jfreechart library to Netbeans Struts

Post by Kyaw » Wed May 23, 2007 10:58 am

Hi all,
May i know how to add JFreeChart library to Netbeans 5.5 Struts (running on bundled Tomcat) environment as every time i add them, i will get a "Servlet action is not available" error due to actionmapping cannot be found including invoking those actions without using JFreeChart library? However, after i remove it or run it in another generic JSP/Servlet environment(Bundled Tomcat also), everything resumes to normal. For your info, my JFreeChart version is 1.0.5.

Other than that, i also added JasperReport library in the same project using guideline from ( www.netbeans.org/kb/55/vwp-reports.html ). Could it due to the ant script from that site? Kindly help if it is the real root cause as i am totally new to ant script. Thanks in advance!

Locked