PDA

View Full Version : JCommon BaseUrl is invalid



begunrom
07-27-2006, 08:06 AM
I have a JfreeReport that produces an output as expected. However in the log files i find an MalformedURLException. How can i get rid of this error?

20:39:11,962 WARN [JCommon] BaseURL is invalid: null
java.net.MalformedURLException
at java.net.URL.<init>(URL.java:601)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at org.jfree.report.modules.parser.ext.factory.templates.ImageURLElementTemplateDescription.createObject(ImageURLElementTemplateDescription.java:78)
at org.jfree.report.modules.parser.ext.readhandlers.BasicObjectReadHandler.getObject(BasicObjectReadHandler.java:182)
at org.jfree.report.modules.parser.ext.readhandlers.ElementReadHandler.doneParsing(ElementReadHandler.java:136)
at org.jfree.xml.parser.AbstractXmlReadHandler.endElement(AbstractXmlReadHandler.java:136)
at org.jfree.xml.parser.RootXmlReadHandler.endElement(RootXmlReadHandler.java:485)
at org.jfree.report.modules.parser.base.ReportParser.endElement(ReportParser.java:159)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.jfree.xml.ParserFrontend.parse(ParserFrontend.java:230)
at org.jfree.report.modules.parser.base.ReportGenerator.parseReport(ReportGenerator.java:241)
at org.pentaho.plugin.jfreereport.JFreeReportComponent.generateReport(JFreeReportComponent.java:555)
at org.pentaho.plugin.jfreereport.JFreeReportComponent.generateReport(JFreeReportComponent.java:517)
at org.pentaho.plugin.jfreereport.JFreeReportComponent.executeAction(JFreeReportComponent.java:374)
at org.pentaho.plugin.ComponentBase.execute(ComponentBase.java:397)
at org.pentaho.core.runtime.RuntimeContext.executeComponent(RuntimeContext.java:977)
at org.pentaho.core.runtime.RuntimeContext.executeAction(RuntimeContext.java:949)
at org.pentaho.core.runtime.RuntimeContext.performActions(RuntimeContext.java:865)
at org.pentaho.core.runtime.RuntimeContext.executeLoop(RuntimeContext.java:821)
at org.pentaho.core.runtime.RuntimeContext.executeSequence(RuntimeContext.java:727)
at org.pentaho.core.runtime.RuntimeContext.executeSequence(RuntimeContext.java:651)
at org.pentaho.core.solution.SolutionEngine.executeInternal(SolutionEngine.java:251)
at org.pentaho.core.solution.SolutionEngine.execute(SolutionEngine.java:204)
at org.pentaho.core.services.BaseRequestHandler.handleActionRequest(BaseRequestHandler.java:132)
at org.pentaho.ui.servlet.ViewAction.doGet(ViewAction.java:117)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595) http://forums.pentaho.org/archived_att/files/Performance.zip

Taqua
07-28-2006, 06:27 AM
This error occurs, because the JFreeReportComponent does some weird things with the report definition source and therefore does not set the base-URL correctly.

A new (completely rewritten) component is available in the trunk-branch of Pentaho. As this is a major rewrite, it was nothing that could have been safely introduced into a release candidate.

The Content-Base of a report (the base-URL) is used to resolve relative URLs. This way, you can put your images in the same directory (or a subdir) as the report definition, and if you move the report (but keep the general structure) you dont have to worry about the URLs inside the report.

There are two ways to fix it:

(1) Fix the incredible ugly JFreeReportComponent. It does not always
set the base-url, but it should.

(2) Use the TRUNK-branch, as the new report components have that issue fixed.


I've also fixed the log message inside JFreeReport. This message now only appears, if the given content of the ImageURLElement is a relative URL. In case the URL given is already absolute, we will silently ignore the missing content-base and continue.

The ImageElementField however, will always complain (but now with a more understandable message).

Regards,
Thomas