levas Posted October 16, 2012 Share Posted October 16, 2012 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 getnet.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRRuntimeException: No query executer factory registered for the '...' languageThe 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 Link to comment Share on other sites More sharing options...
levas Posted November 5, 2012 Author Share Posted November 5, 2012 No answers... Is is that no one has been creating custom datasources, or no one has experienced the issue I am having? Link to comment Share on other sites More sharing options...
Solution waal Posted November 7, 2012 Solution Share Posted November 7, 2012 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.JRConnexysJdbcQueryExecuterFactorywhere CXS_SQL should be replaced by your own language name. Link to comment Share on other sites More sharing options...
waal Posted November 7, 2012 Share Posted November 7, 2012 Actually we only added a jar file to the lib folder, with the custom executer classes. and a line in the jasperreports.properties file. Link to comment Share on other sites More sharing options...
levas Posted November 7, 2012 Author Share Posted November 7, 2012 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now