No query executer factory registered for the ... language.

0

I am trying to create and install a custom data source for Jasper Reports Server 4.7.0.  According what I have been reading all I need to do is

  • Create implementations of the following:
    • JRDataSource
    • ReportDataSourceService
    • JRQueryExecuter
    • JRQueryExecuterFactory
  • Create a resource bundle (to be placed in .../WEB-INF/bundles) for the data source creation screen
  • Create an applicationContext-???.xml file (to be placed in .../WEB-INF) containing the following:
    •     <bean id="myCustomDataSource"
                class="com.jaspersoft.jasperserver.api.engine.jasperreports.util.CustomDataSourceDefinition">
              <property name="factory" ref="customDataSourceServiceFactory"/>
              <property name="name" value="myCustomDataSource"/>
              <property name="serviceClassName" value="....MyCustomDataSource"/>
              <property name="propertyDefinitions">
                  <list>
                      <map>
                          <entry key="name" value="property1"/>
                          <entry key="default" value="some value"/>
                      </map>
                      <map>
                          <entry key="name" value="property2"/>
                          <entry key="default" value="some other value"/>
                      </map>
                      <map>
                          <entry key="name" value="repository"/>
                          <entry key="hidden" value="true"/>
                          <entry key="default" value-ref="repositoryService"/>
                      </map>
                      <map>
                          <entry key="name" value="beanForInterfaceImplementationFactory"/>
                          <entry key="hidden" value="true"/>
                          <entry key="default" value-ref="dataSourceServiceFactories"/>
                      </map>
                  </list>
              </property>
              <property name="queryExecuterMap">
                  <map>
                      <entry key="Custom" value="....MyCustomDataSourceQueryExecuterFactory"/>
                  </map>
              </property>
          </bean>

    <bean class="com.jaspersoft.jasperserver.api.common.util.spring.GenericBeanUpdater">
        <property name="definition" ref="addMessageCatalog"/>
        <property name="value" value="WEB-INF/bundles/myCustomDataSource_messages"/>
        <property name="valueType" value="stringList"/>
    </bean>

After doing this and getting the files in the correct place on the server, I am able to create instances of my data source; however when I go to run a repor that uses my data source, I get

net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRRuntimeException: No query executer factory registered for the '...' language

The report unit in question has my custom data source as its configured data source, and the report template specified my custom language as the query language. 

Walking through the Jasper Reports Server souce code, I found that when attemting to get the relevant QueryExecuterFactory from net.sf.jasperreports.engine.util.JRQueryExecuterUtils.getExecuterFactory(...), my factory is not found. This is becuase my custom language is not in the relevant ExecuterFactoryBundle map. 

Can anyone shed some light as to what I need to do to get my custom laguage (and associated QueryExecuterFactory) into that bundle/map?

Thanks,

Rob

 

levas's picture
5
Joined: Dec 18 2008 - 7:53am
Last seen: 5 years 6 months ago
No answers... Is is that no one has been creating custom datasources, or no one has experienced the issue I am having?
levas - 6 years 9 months ago
Actually we only added a jar file to the lib folder, with the custom executer classes. and a line in the jasperreports.properties file.
waal - 6 years 9 months ago

1 Answer:

1

It seems like you haven't added a line to your jasperreports.properties file (in the classes directory). It should look something like this:
net.sf.jasperreports.query.executer.factory.CXS_SQL=net.sf.jasperreports.engine.query.JRConnexysJdbcQueryExecuterFactory

where CXS_SQL should be replaced by your own language name.

waal's picture
36
Joined: Nov 6 2012 - 2:22pm
Last seen: 5 years 2 weeks ago
You are exactly correct. I just found this a day or so ago in updated documentation I found on the JasperSoft support site. I meant to post this answer but got busy and planned to do so when I got a chance. Thanks, Rob
levas - 6 years 9 months ago
Feedback