Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jasper reports error in weblogic 8.1

 
Nick Potter
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm using jasperreports 3.6.0 in weblogic 8.1. When I try to compile a report I'm getting:

net.sf.jasperreports.engine.JRRuntimeException: Error creating SAX parser
at net.sf.jasperreports.engine.xml.JRReportSaxParserFactory.createParser(JRReportSaxParserFactory.java:109)
at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createParser(JRXmlDigesterFactory.java:1320)
at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createDigester(JRXmlDigesterFactory.java:1295)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:199)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:164)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:148)
at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:85)
at report.ReportController.compileReport(ReportController.java:93)
at report.ReportController.doPost(ReportController.java:43)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)


......

Caused by: org.xml.sax.SAXNotRecognizedException: http://java.sun.com/xml/jaxp/properties/schemaLanguage
at org.apache.xerces.framework.XMLParser.setProperty(XMLParser.java:1714)
at org.apache.xerces.parsers.SAXParser.setProperty(SAXParser.java:770)
at org.apache.xerces.jaxp.SAXParserImpl.setProperty(SAXParserImpl.java:190)
at net.sf.jasperreports.engine.xml.JRReportSaxParserFactory.configureParser(JRReportSaxParserFactory.java:140)
at net.sf.jasperreports.engine.xml.JRReportSaxParserFactory.createParser(JRReportSaxParserFactory.java:104)



Does anyone know how to solve this issue? Thanks.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That property does not seem to be recognized by your version of sax. Which one are you using ? Did you try "http://java.sun.com/xml/properties/jaxp/schemaLanguage"
 
Nick Potter
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I use xerces 1.4.4. But i don't know how to change the property.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
 
Nick Potter
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe this is done in the back by weblogic (probably a conflict in the libs, since the jasper version is very new and xerces one is very old, yet i'm not able to find the correct jasper version for xerces 1.4.4). This is how my controller looks like:




This works on tomcat 6 and jboss 5. So it must be a jar conflict (or more). I don't know if the link you gave me helps in this matter because i don't see where I should insert the code.
 
Nick Potter
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
New error, after trying with jasper 2.0.5:

net.sf.jasperreports.engine.JRException: No report compiler set for language : null
at net.sf.jasperreports.engine.JasperCompileManager.getCompiler(JasperCompileManager.java:508)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:219)
at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:135)
at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:94)

What's this?
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That error seems to be Jasper specific. Google churned up a few links when I searched. Here is one

http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=47369
 
Nick Potter
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a new error now. I'm trying to compile the jrxml in the servlet but i'm getting a filenotfoundexception:

my servlet uri is http://localhost:8080/tests/report.jsp

i have the file in tests/reports.

JasperCompileManager.compileReportToFile("reports/example.jrxml");

i've tried in different ways, with full server path, replacing / with \\, etc yet it doesn't find it. So how to i put the path to the file relative to the server? if i hardcode it (C:\\server\\....) it finds it...
 
Nick Potter
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nevermind, i got it

Thanks for the help
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nick Potter wrote:Nevermind, i got it

Thanks for the help


I am glad that you solved the problem. Can you share your solution with us so that others will also benefit from it ? Thanks
 
Nick Potter
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure, here it is:
JasperCompileManager.compileReportToFile(getServletContext().getRealPath("/jsp/example.jrxml"));

my jrxml was in the application on the server/jsp
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic