Jump to content
Changes to the Jaspersoft community edition download ×

sbyrne

Members
  • Posts

    20
  • Joined

  • Last visited

sbyrne's Achievements

  1. My static method does this: CustomReportDataSource ds = (CustomReportDataSource) RepositoryUtil .getThreadRepositoryContext().getRepository().getResource( null, dataSourceUri, null );Map properties = ds.getPropertyMap();MyDataSourceService service = new MyDataSourceService(); // implements ReportDataSourceService// cut - Read properties from the map and set them to service via it's settersMap params = new HashMap();// cut - Set params from args to static methodservice.setReportParameterValues( params );return params.get( JRParameter.REPORT_DATA_SOURCE );[/code]If I had a better way to get the subreport parameters, I could make this completely generic (for any ReportDataSourceService implementation, not just MyDataSourceService). I figured that Jasper server probably had a method that did just this - give it the URI to the data source, and it creates the ReportDataSourceService, sets the properties, and creates a JRDataSource via setReportParameterValues(Map), but I couldn't find it. So I figured I would write my own, but I cannot find access to the subreport parameters generically.
  2. I am using datasourceExpression to call a static method that builds my custom data source. It there a way to access the subreportParameter map from my static method? Instead of this: <subreport> <dataSourceExpression><![CDATA[com.example.MyDataSourceUtil.createDataSource($F{myField},$P{myParam})]]></dataSourceExpression></subreport>[/code]I would like to do this: <subreport> <subreportParameter name="myField"> <subreportParameterExpression><![CDATA[$F{myField}]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="myParam"> <subreportParameterExpression><![CDATA[$P{myParam}]]></subreportParameterExpression> </subreportParameter> <dataSourceExpression><![CDATA[com.example.MyDataSourceUtil.createDataSource()]]></dataSourceExpression></subreport> [/code]and access he parameter map somehow inside createDataSource().
  3. I have a report that uses a custom data source using ReportDataSourceService. It works fine. I have another report that uses JDBC for its data source. I want to add a subreport to that report that uses my custom ReportDataSourceService data source. I can run arbitrary code by using datasourceExpression, but I do not know how to get access to my ReportDataSourceService. Is it possibly to get access to it from the RepositoryService returned by RepositoryUtil.getThreadRepositoryContext().getRepository()? I am not sure what I should pass as the URI to RepositoryService.getResource(ExecutionContext,String uri).
  4. I got the same InvalidKeySpecException doing something else. The workaround is to use Oracle's JRE 1.7.0 instead of OpenJDK.
  5. I got the same InvalidKeySpecException doing something else. The workaround is to use Oracle's JRE 1.7.0 instead of OpenJDK.
  6. Using Oracle's 1.7.0_72 fixed this issue. I tried using OpenJDK 1.8.0_31, but that led to the following error: 2015-04-01 12:46:46,183 ERROR ContextLoader,localhost-startStop-1:331 - Context initialization failedorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'actionModelService' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:633) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5524) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1245) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1895) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)Caused by: java.lang.ExceptionInInitializerError at com.jaspersoft.jasperserver.api.engine.common.service.impl.ActionModel.generateActionModelDocument(ActionModel.java:193) at com.jaspersoft.jasperserver.api.engine.common.service.impl.ActionModelServiceImpl.generateActionModelMenus(ActionModelServiceImpl.java:112) at com.jaspersoft.jasperserver.api.engine.common.service.impl.ActionModelServiceImpl.afterPropertiesSet(ActionModelServiceImpl.java:80) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509) ... 25 moreCaused by: java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: java.util.ServiceConfigurationError: javax.xml.xpath.XPathFactory: jar:file:/var/lib/tomcat7/webapps/jasperserver-pro/WEB-INF/lib/saxonhe-9.2.1.5.jar!/META-INF/services/javax.xml.xpath.XPathFactory:2: Illegal configuration-file syntax at javax.xml.xpath.XPathFactory.newInstance(XPathFactory.java:102) at com.jaspersoft.jasperserver.core.util.XMLUtil.(XMLUtil.java:46) ... 30 more
  7. I am developing a custom JRDataSource that hits a REST service using TLS using jersey-client. I have test code that works when run on the AWS instance using the same JVM that tomcat uses, using a classpath of "/usr/share/tomcat7/webapps/jasperserver-pro/WEB-INF/lib/*". (The test code is in the jar with my custom JRDataSource in that directory.) At report generation time in jasper, I get this error: com.sun.jersey.api.client.ClientHandlerException: javax.net.ssl.SSLException: Server key at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:151) at com.sun.jersey.api.client.filter.HTTPBasicAuthFilter.handle(HTTPBasicAuthFilter.java:81) at com.sun.jersey.api.client.filter.GZIPContentEncodingFilter.handle(GZIPContentEncodingFilter.java:120) at com.sun.jersey.api.client.Client.handle(Client.java:648) at com.sun.jersey.api.client.WebResource.handle(WebResource.java:680) at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74) at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:507) at com.mycompany.jasper.MyDaoImplJersey1.getData(MyDaoImplJersey1.java:87) at com.mycompany.jasper.MyDataSourceService.setReportParameterValues(MyDataSourceService.java:56) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.fillReport(EngineServiceImpl.java:1721) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runWithDataSource(EngineServiceImpl.java:1082) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runReport(EngineServiceImpl.java:1011) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportRunnable.run(EngineServiceImpl.java:904) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)Caused by: javax.net.ssl.SSLException: Server key at sun.security.ssl.Handshaker.throwSSLException(Handshaker.java:1212) at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:279) at sun.security.ssl.Handshaker.processLoop(Handshaker.java:878) at sun.security.ssl.Handshaker.process_record(Handshaker.java:814) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1016) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323) at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1300) at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338) at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:249) at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:149) ... 15 moreCaused by: java.security.spec.InvalidKeySpecException: key spec not recognised at org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi.engineGeneratePublic(Unknown Source) at org.bouncycastle.jcajce.provider.asymmetric.ec.KeyFactorySpi.engineGeneratePublic(Unknown Source) at java.security.KeyFactory.generatePublic(KeyFactory.java:334) at sun.security.ssl.HandshakeMessage$ECDH_ServerKeyExchange.(HandshakeMessage.java:1057) at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:274) ... 28 moreObviously it is not an issue of the US_export_policy.jar, because my test code works fine with the same JVM.
  8. Although using STARTTLS on port 587 is preferred, you can do it on port 25, and many mail servers do.
  9. Studio 6.0.x includes jersey-client and jersey-common 2.4.1. Jasper Server 6.0.x includes jersey-core 1.13. Really TIBCO!? Be warned if you are trying to write a custom data source using jersey client.
  10. I am not saying that Studio is having a problem talking to Server, but that the API available to hook into Server for customization is different from that on Studio.
  11. I am trying to implement a custom JRDataSource to get data from a webservice. I modeled it on the webscraper example (https://community.jaspersoft.com/documentation/tibco-jasperreports-server-ultimate-guide/v60/custom-data-source-examples). I have an implementation of ReportDataSourceService with property definitions defined in the applicationContext-X.xml, where I define the base URL, username, and password for the data source. I then define report parameters in the JRXML for the query parameters for the specific report. I create a new JRDataSource instance each time MyReportDataSourceService.setReportParameterValues(Map) is called. This all works great. Now I want to use my custom JRDataSource in Studio Pro. I want to use a JRDataSourceProvider (as shown here: http://community.jaspersoft.com/wiki/how-create-and-use-jrdatasourceprovider-adapter) so I can implement getFields(JasperReport) so the report builders do not have to type in all the fields manually. But that interface gives me no way to configure my properties like I can with my ReportDataSourceService implementation, nor does it give me access to the report parameters at run time, which makes JRDataSourceProvider seem pretty useless. So, despite that I have no actual query, I implemented a QueryExecuterFactory. I put the properties in a file on the local file system, which is slightly inconvenient, but it works. So now the report builder needs to: define a Data Adapter using my custom JRDataSourceProviderselect the JRDataSourceProvider-based Data Adapter and click "Read Fields".select the "Domain JRS" data adapter.select my custom language, and leave the query box blank This seems convoluted. There is a disconnect between the server API and studio API. What am I missing? Is there something analogous to ReportDataSourceService for Studio that I am not aware of?
  12. Oh yeah. That would not help me anyway, because I do not have access to the JasperReportsContext from the JRDataSourceProvider. I do not need a query, I just need parameters. Do I have to make a QueryExecuterFactory just to get the JasperReportsContext?
  13. I created a custom JRDataSource, that is created by a custom ReportDataSourceService in Jaspersoft Server AWS, so I defined my properties in the applicationContext-x.xml and configured them for the data sources on the server. For Jaspersoft Studio Professional, I created a custom JRDataSourceProvider. How do I set my properties so I can get them from the JasperReport instance passed to JRDataSourceProvider.create(JasperReport)?
×
×
  • Create New...