Jump to content

No query executer factory class registered


longbeach

Recommended Posts

Hi,
I am trying to compile a .jrxml file in a Java program.

The database is Microsoft Sql Server 2008 Analysis Services.

First, it works well in iReport 3.6.1.
I could succesfully connect to the database and compile the .jrxml file from it. It produces a .jasper file.
It initially complained about some unregistered language :
Message:
    net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: No query executer factory class registered for xmla-mdx queries.

   
I found out that I had to add a language property for the XML/A datasource (the language is MDX ) :
Language : xmla-mdx
Factory class :net.sf.jasperreports.olap.xmla.JRXmlaQueryExecuterFactory


So that works for iReport.

Now i am trying to do the same in Java program.
I guess i need to do the same. How do you register a query executer factory class for xmla-mdx queries, in the
JasperReports API ?

Thanks for helping.

Here are the logs that i get. This is produced just after the call to the following method :
    JasperCompileManager.compileReportToFile(context.getRealPath("/reports/report1.jrxml"));
   
    My version of the JasperReports library is 3.5.2 :
    WEB-INF/lib/jasperreports-3.5.2.jar
           
Logs :
11:47:36,562 INFO  [ApriaServlet] ------------------------- Debut Compilation du fichier .jrxml -------------------------
11:47:39,005 ERROR [Digester] End event threw exception
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:281)
    at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:216)
    at org.apache.commons.digester.Rule.end(Rule.java:230)
    at org.apache.commons.digester.Digester.endElement(Digester.java:1130)
    at net.sf.jasperreports.engine.xml.JRXmlDigester.endElement(JRXmlDigester.java:187)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.apache.commons.digester.Digester.parse(Digester.java:1647)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:239)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:226)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:214)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:168)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:152)
    at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:89)
    at servlets.ApriaServlet.doGet(ApriaServlet.java:58)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Unknown Source)
Caused by: net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: No query executer factory class registered for xmla-mdx queries.
    at net.sf.jasperreports.engine.design.JRDesignDataset.queryLanguageChanged(JRDesignDataset.java:1021)
    at net.sf.jasperreports.engine.design.JRDesignDataset.setQuery(JRDesignDataset.java:555)
    at net.sf.jasperreports.engine.design.JasperDesign.setQuery(JasperDesign.java:884)
    ... 51 more
Caused by: net.sf.jasperreports.engine.JRException: No query executer factory class registered for xmla-mdx queries.
    at net.sf.jasperreports.engine.query.DefaultQueryExecuterFactoryBundle.getQueryExecuterFactory(DefaultQueryExecuterFactoryBundle.java:84)
    at net.sf.jasperreports.engine.util.JRQueryExecuterUtils.getQueryExecuterFactory(JRQueryExecuterUtils.java:61)
    at net.sf.jasperreports.engine.design.JRDesignDataset.queryLanguageChanged(JRDesignDataset.java:1010)
    ... 53 more

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

So far this is what i've got with JBoss 6.

The important line is :

    net.sf.jasperreports.engine.util.JRProperties.setProperty("net.sf.jasperreports.query.executer." +
                    "factory.xmla-mdx", "net.sf.jasperreports.olap.xmla.JRXmlaQueryExecuterFactory");

 

With JBoss 6, i have this error :

net.sf.jasperreports.engine.JRRuntimeException: javax.xml.soap.SOAPException: Unable to create SOAP Factory: org.jboss.ws.core.soap.SOAPFactoryImpl cannot be cast to javax.xml.soap.SOAPFactory
    net.sf.jasperreports.olap.xmla.JRXmlaQueryExecuter.createDatasource(JRXmlaQueryExecuter.java:119)
    net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:685)
    net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:605)
    net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1235)
    net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:865)
    net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:814)
    net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63)
    net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:421)
    net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:251)
    servlets.ApriaServlet.service(ApriaServlet.java:131)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

 

When i check the source code of the JRProperties class, i see that there is no property defined for XMLA.

So i am wondering if the following line makes any sense :

parameterMap.put(JRXmlaQueryExecuterFactory.QUERY_EXECUTER_FACTORY_PREFIX,    "xmla-mdx");

Has anyone been able to successfully connect to a Microsoft SQL server 2008 Analysis Services database ?

Thanks for helping.

Code:
	Class.forName("org.olap4j.driver.xmla.XmlaOlap4jDriver");			Connection 	connection = DriverManager.getConnection(			        "jdbc:xmla:Server=http://localhost/olap/msmdpump.dll;"			       + "Catalog=Adventure Works DW 2008 SE");					HashMap parameterMap = new HashMap();			parameterMap.put(JRXmlaQueryExecuterFactory.QUERY_EXECUTER_FACTORY_PREFIX,	"xmla-mdx");						parameterMap.put(JRXmlaQueryExecuterFactory.PARAMETER_XMLA_URL,	"http://localhost/olap/msmdpump.dll");			parameterMap.put(JRXmlaQueryExecuterFactory.PARAMETER_XMLA_DATASOURCE,	"W2K8SQLVS");			parameterMap.put(JRXmlaQueryExecuterFactory.PARAMETER_XMLA_CATALOG,	"Adventure Works DW 2008 SE");						String reportFileName = context.getRealPath("/reports/report1.jasper");						net.sf.jasperreports.engine.util.JRProperties.setProperty("net.sf.jasperreports.query.executer." +					"factory.xmla-mdx", "net.sf.jasperreports.olap.xmla.JRXmlaQueryExecuterFactory");													//jasperPrint = JasperFillManager.fillReport(reportFileName, parameterMap);			 jasperPrint = JasperFillManager.fillReport(reportFileName, parameterMap, connection);						connection.close();
Link to comment
Share on other sites

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...