Jump to content
Changes to the Jaspersoft community edition download ×

Recommended Posts

By: Aurelia Ducreau - aurelia

load xml file

2003-08-22 06:09

Here is my problem : I am trying to load an xml file to get the Jasper design object. But an error occurs...







public Map getParametersMap(HttpServletRequest request, HttpServletResponse response) throws IOException


Map baseObjectsMap = new HashMap();


FileInputStream fis = new FileInputStream(request.getRealPath( "/Profil/rapports/" + (String)parameters.get("rpt") + ".xml" ) );

System.setProperty("org.xml.sax.driver", "org.apache.xerces.parsers.SAXParser");





JasperDesign jasperDesign = JasperManager.loadXmlDesign(fis);

baseObjectsMap = jasperDesign.getParametersMap();


} catch (JRException Exce)

{ AfficheErreurHTML( Exce , response); }


return baseObjectsMap;




Generated error


[Fri Aug 22 15:05:46 CEST 2003] info: PoolManager: ==> Cré¡´ion POOL - SGBD=M

javax.xml.parsers.FactoryConfigurationError: Factory class gnu.xml.aelfred2.JAXPFactory not found

at org.apache.jserv.JServConnection.processRequest(Compiled Code)

at org.apache.jserv.JServConnection.run(Compiled Code)

at java.lang.Thread.run(Compiled Code)





By: David Hardwick - dhardwick

RE: load xml file

2003-08-22 07:17

Make sure you have the XML parser jars in your library and then try running this from the command line so you have complete control over your environment variables.


Once it's working from the command line, then you know it's just a library issue within your servlet runner.







By: Ryan Johnson - delscovich

RE: load xml file

2003-08-22 10:50

The problem is that SAXParserFactory doesn't use the system property you're setting. It looks at the property "javax.xml.parsers.SAXParserFactory" for the parser class to use







By: Aurelia Ducreau - aurelia

RE: load xml file

2003-08-26 07:48

Thanks a lot... I've solved the problem

I've downloaded xerces parser :





And I've placed it in the right directories (servletxxx directories)

Sothat the Factory now find the needed class...


Thanks again



Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...