Jump to content
We've recently updated our Privacy Statement, available here ×

rmiller

Members
  • Posts

    64
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by rmiller

  1. IssueThe inheritance tab in the properties pane of Jaspersoft Sudio is a very powerful feature that allows the report designer to view and modify an elements inheritance. However, depending on screen size and resolution it (and other tabs) may not appear in the properties pane as illustrated in this screenshot: There are two options to access the hidden Inheritance tab: ResolutionClick the widget on the right side of the tab bar to access a drop down menu. Or increase the width of the properties pane to reveal the Inheritance tab.
  2. Using the HTTP API to display reports is much easier that using REST, so you may want to go that route. Having said that, there is sample code at the bottom of the "Getting Started with the REST Web Service API" page. You'll have to download and install Maven to run it but otherwise it's pretty straight forward. You can also find sample client code in the samples folder in the distribution.
  3. Thinking about your comment above where you say that when you lose the parameters when you click the refresh (reset) button, it makes sense because the server knows nothing about the parmeters sent in the URL and when you click on reset it just uses the default parameters. You will have to override the refresh button in your application to send the parameters again. You can remove the refresh button from the tool bar by editing /WEB-INF/jsp/modules/viewReport/ViewReport.jsp and comment out the following line: <ul class="list buttonSet"> <!-- <li class="leaf"><button id="dataRefreshButton" type="submit" title="<spring:message code="jasper.report.view.button.data.refresh" javaScriptEscape="true"/>" class="button capsule up"><span class="wrap"><span class="icon"></span></span></button></li> --> </ul>
  4. You can use the REST API to display a report. This page will help you get started, http://community.jaspersoft.com/wiki/jaspersoft-web-services-reference. Also, download the Web Services Guide from the Docs tab.
  5. http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.export.xls.sheet.names.{arbitrary_name}
  6. Did you install a font extension on the 5.5 server? If not, here is an article about how to do so, http://mdahlman.wordpress.com/2010/05/28/jaspersoft-v3-7-font-extensions.
  7. It doesn't make much sense to run it from a headless Linux machine. You'll have to run xterm, etc. You're better off installing it on your desktop machine.
  8. Yes, you must create a Hadoop-Hive data source on the server and point your published report to it. Right-click on a folder where you want to store the data source and choose Add Resource->Data Source, then choose Hadoopt-Hive.
  9. Click on the XML tab and look at line 226, column 37 to see what the error might be. Another tip is to change the language from the default Groovy to Java, which sometimes gives a more detailed error giving you a better clue as to what's wrong. To change the language click on the main report node in the Report Inspector and click on the Language menu in the properties (near the bottom) and change the language to Java.
  10. Strickly speaking MD5 is not an encryption algorithm but is a cryptographic hash function. However, since common terminology calls it encryption we will use that term. End-Of-LifeAccording to an article in ZDNet by Zack Whittaker, MD5 password encryption is considered too vunerable to attack because of increasingly powerful hardware and attack techniques, "The original author of the MD5 password hash algorithm has publicly declared his software end-of-life and is 'no longer considered safe' to use on commercial websites. 'I implore everybody to migrate to a stronger password scrambler without undue delay," he wrote in a blog post.'" Here is another article that goes into considerable detail on the MD5 security vulnerablities. While JasperReports Server and library support MD5 encryption, Jaspersoft highly encourages our users to consider another more secure encryption technology such as SHA-256, SHA-512 or Triple DES, which is the default encryption method in JasperReports. Here is an Password Storage Cheat Sheet that spells out proper password hashing techniques. Also, Threat Model for Secure Password Storage.
  11. Issue:A customer wants to import reports to their production machine, but the organization id on the production machine is different from the one on the development machine. So, the customer used the the technique found in the Driving Reports from Development to Production Tutorial. The customer replaced the tenant id in the export from the development machine with the tenant id on the production machine and attempted to import the reports, but the import failed with the message: "Folder with the uri /organizations/ORGANIZATION1/Reports is attached to not existing organization. Not imported" Resolution:The tenant id on the target machine used all lower case, "organization1," but when they replaced the tenant id in the export, they used all upper case, "ORGANIZATION1." The tenant id is case sensitive, so when the id was changed to lower case, the import succeeded.
  12. SOAP and RESTv1 are being depricated. RESTv2 is the web service API currently under development. IIt's difficult to answer what it doesn't include, but you can get a good idea of what is included in the Web Services Guide here: http://community.jaspersoft.com/sites/default/files/docs/jasperreports-server-web-services-guide_0.pdf.
  13. The Sample DB is shipped with both iReport and Jaspersoft Studio. In iR you will find it in the datasource menu in the upper left of the UI above the Repository Navigator and Report Inspector. In JSS is is located in the Repository Explorer->Data Adaptor.
  14. Issue:It is common practice to use the java:com.jaspersoft.ireport.jasperserver.ws.CommonsHTTPSender class to send SOAP requests from portlets or external applications. In versions 4.7 and greater there is a bug in this class that causes socket connections to get stuck in CLOSE_WAIT state indefinitely and never close. Eventually all available file descriptors are consumed which can only be remedied by rebooting the server. [toc]The iReport Designer CommonsHTTPSender has a memory/heap leak due to the IReportManager.getPreferences().addPreferenceChangeListener() call. That call stores a hard reference to the CommonsHTTPSender instance in a "global" object, which causes all CommonsHTTPSender instances to accumulate in memory. CommonsHTTPSender has references to MultiThreadedHttpConnectionManager and its connection pool, therefore the pooled connection objects are never garbage collected. This way the memory leak leads to an open socket leak. Note that the objects are small so the memory leak is not easily apparent, but it's there nonetheless. The Axis CommonsHTTPSender does not have this problem, therefore when using it pooled connection objects eventually get garbage collected which results in the sockets getting closed. The connections get closed with a delay that comes from the garbage collection; since the objects are relatively small the garbage collection would not necessarily run very often so the connections can stay open for a while. Resolution:A workaround is to switch to the Axis CommonsHTTPSender class, java:org.apache.axis.transport.http.CommonsHTTPSender. Uncomment this class in client-config.wsdd and comment the iReport Designer CommonsHTTPSender class.
  15. This issue is caused when using WSClient class in conjunction with the iReport CommonsHTTPSender class for SOAP web service calls. The iR CommonsHTTPSender actually has a memory/heap leak due to the IReportManager.getPreferences().addPreferenceChangeListener() call. That call stores a hard reference to the CommonsHTTPSender instance in a "global" object, which causes all CommonsHTTPSender instances to accumulate in memory. CommonsHTTPSender has references to MultiThreadedHttpConnectionManager and its connection pool, therefore the pooled connection objects are never garbage collected. This way the memory leak leads to an open socket leak. Note that the objects are small so the memory leak is not easily apparent, but it's there nonetheless. The Axis CommonsHTTPSender does not have this problem, therefore when using it pooled connection objects eventually get garbage collected which results in the sockets getting closed. The connections get closed with a delay that comes from the garbage collection; since the objects are relatively small the garbage collection would not necessarily run very often so the connections can stay open for a while. A workaround is to switch to the Axis CommonsHTTPSender class in client-config.wsdd, java:org.apache.axis.transport.http.CommonsHTTPSender.
  16. When troubleshooting external authentication issues the following log4j loggers are useful: ######### external auth loggers ##########log4j.logger.org.jasig.cas=DEBUG, stdout, fileout#log4j.logger.org.springframework.security.providers.cas=DEBUG, stdout, fileout#log4j.logger.com.jaspersoft.jasperserver.api.security.externalAuth.cas.CasJDBCUserDetailsService=DEBUG, stdout, fileout#log4j.logger.com.jaspersoft.jasperserver.api.metadata.user.service.impl.UserDetailsServiceImpl=DEBUG, stdout, fileout#log4j.logger.org.springframework.security=DEBUG ### caution, this will create a 1 MB log file on first login#log4j.logger.org.springframework.jdbc.datasource=DEBUG, stdout, fileout#log4j.logger.org.springframework.security.ldap=DEBUG, stdout, fileout#log4j.logger.com.jaspersoft.jasperserver.api.security.externalAuth=DEBUG, stdout, fileout#log4j.logger.com.jaspersoft.jasperserver.multipleTenancy.security.externalAuth=DEBUG, stdout, fileout#log4j.logger.com.jaspersoft.jasperserver.multipleTenancy.ldap=DEBUG, stdout, fileout#log4j.logger.com.jaspersoft.jasperserver.multipleTenancy.MTDaoAuthenticationProvider=DEBUG#log4j.logger.com.jaspersoft.jasperserver.multipleTenancy.security.externalAuth.db.MTExternalJDBCUserDetailsService=DEBUG######### end external auth loggers #########[/code]
  17. By default passwords are stored in the repository database with Triple DES encoding, thus the default passwordEncoder/passwordValidator is for Triple DES encoding. If you are authenticating from and external database and store passwords using MD5 or SHA here's how to configure JasperReports Server for those encryption algorithms: For pre-v5.1 versions the password encryption configuration is in .../jasperserver-pro/WEB-INF/applicationContext-security.xml. Starting with v5.1 the configuration moved one of two sample files located in jasperreports-server-5.x-bin/samples/externalAuth-sample-config, sample-applicationContext-externalAuth-db-mt.xml or sample-applicationContext-externalAuth-CAS-db-mt.xml (see External Database Authentication for complete documentation of current external database authentication). Prior to v5.1 the bean to configure was passwordEncoder, starting with v5.1 it is named passwordValidator. Other than the file and bean name changes the procedure is exactly the same. I'll describe >v5.1 procedure. Select one of the two sample configuration files, remove "sample-" from the file name and move it to the .../jasperserver-pro/WEB-INF folder. Search for the passwordValidator bean and comment it out. Copy and paste the appropriate MD5 or SHA passwordValitor bean and save the file. The configuration will look similar to this: <bean class="com.jaspersoft.jasperserver.multipleTenancy.security.externalAuth.db.MTExternalDaoAuthenticationProvider" id="externalDaoAuthenticationProvider"> <property name="userDetailsService"> <ref bean="externalUserTenantDetailsService"></ref> </property> <property name="passwordValidator"> <ref local="passwordValidator"></ref> </property> </bean> <!-- <bean id="passwordValidator" class="com.jaspersoft.jasperserver.api.metadata.common.service.impl.PasswordValidator" lazy-init="false"> <property name="keyInPlainText"> <value>false</value> </property> <property name="secretKey"> <value>0xC8 0x43 0x29 0x49 0xAE 0x25 0x2F 0xA1 0xC1 0xF2 0xC8 0xD9 0x31 0x01 0x2C 0x52 0x54 0x0B 0x5E 0xEA 0x9E 0x37 0xA8 0x61</value> </property> <property name="secretKeyAlgorithm"> <value>DESede</value> </property> <property name="cipherTransformation"> <value>DESede/CBC/PKCS5Padding</value> </property> </bean> --> <!-- MD5 --> <bean class="org.springframework.security.providers.encoding.Md5PasswordEncoder" id="passwordValidator"> <property name="encodeHashAsBase64"> <value>false</value> </property> </bean> <!-- or for SHA --> <bean class="org.springframework.security.providers.encoding.ShaPasswordEncoder" id="passwordValidator"> <property name="encodeHashAsBase64"> <value>false</value> </property> </bean>
  18. IntroductionA Java thread dump is a snapshot what every thread in the JVM is doing at a particular point in time. Each thread in the JVM is listed with it's name and id, it's current state and the Java call stack showing what monitor it has locked or is waiting on. This is especially useful if your Java application sometimes seems to hang when running under load, as an analysis of the dump will show where the threads are stuck, either by deadlock or other thread contention. How to get a thread dumpUnix:On most flavors of Unix kill -3 <pid> will generate a thread dump. To get the java process pid use ps -ef | grep java. The dump is directed to stdout so redirecting to a file is neccessary. Since 1.6 the Sun/Oracle JDK and openJDK has the jstack utility to do the same thing, run it from the command line and redirect to a file. Windows:If the application was started from a command window you can select the window and use CTRL+Breakbut the output will likely overflow the window. Jstack is available if your using the Sun/Oracle JDK and openJDK. Otherwise use PsExec.exe to execute SendSignal.exe. Also, if Tomcat is started as a service it is necessary to use SendSignal. How many thread dumps do I needOften a single thread dump will reveal the problem, this is especially true with deadlocks where two or more threads are waiting for locks obtained by each other. But in other cases, such as threads waiting on other processes, like IO from a database, you won't be able to detect it with a single thread dump. In this case multiple thread dumps taken over time will show the same thread waiting for the process to complete during that time span. The scripts attached at the bottom of this article will generate multiple thread dumps over time. Running the script from the command line, the default is 10 thread dumps with a 60 second delay between each dump, this is configurable from the command line. If there is only one Java process running on the machine the script will detect it and get the pid, otherwise you will have to uncomment the pid variable in the script and enter the pid at the command line. Sometimes the issue is intermitent, occurring at random times. Since you want to gather the series of thread dumps before the issue pops up you can create a cron job on Unix systems or use the Task Scheduler on windows to run the script at regular intervals to obtain a two hour window of thread dumps (the script deletes any dump file older than two hours so it will not fill up the file system). A sample cron job is included with the scripts. Analyzing the thread dumpsYou can read a thread dump with a text editor, and many people use only this. Thread Dump Analyzer is a useful tool to aid in the process. It is a Java Swing application for analyzing thread dumps. It provides statistics about the thread dump, displays individual threads and gives information about locked monitors and waiting threads, flagging monitors that have many threads waiting on it. https://java.net/projects/tda. A detailed description of how to analyze thread dumps is beyond the scope of this article. However, there are a host of good articles on the web that expain the process in great detail. Here are two sources that I like: http://javaeesupportpatterns.blogspot.com/p/thread-dump-analysis.htmlhttp://web.archive.org/web/20130214060723/http://www.cubrid.org/blog/dev-platform/how-to-analyze-java-thread-dumps/
  19. There are three main components to backup Jaspersoft before uprading your JasperReports Server or for a General backup. JRS war file, Jaspersoft Repo and Jasperserver DB. Backup jasperserver-pro App Directory-{War file}: Copy the JasperServer-pro application directory from the web application to a location outside of the web application. In a typical Tomcat installation, this would be <apacheTomcatDir>/webapps/JasperServer-pro. Note: The default application name is jasperserver-pro. Here is JRS folder structure for your reference: Export the JasperReport Server Repository {Repo}: There are a few methods you can take an export of the Jaspersoft Server Repository: 1. Export using the Jasperserver Web UI: Login to your Jasperserver instance using SysAdmin credentials (superuser) Navigate to Manage > Server Settings > Export File properties: provide a descriptive name like JRSRepo_full_export.zip Then click on Export at the bottom. (You can include Audit and monitoring if you want to back those Audit and Monitoring events too). 2. Export using the Command Prompt: This is another method to take a backup of the entire report using the buildomatic scripts. The export file produced in this step will contain all of the report objects and JRS users in the repository. In a terminal window, navigate to the .../jasperreports-server-x.x-bin/buildomatic directory. Issue the following command: ./js-export --output-zip Entirerepo_filename.zip --everything Store the zip file with the application server backup. Backup the Repository Database {DB}: By default, the repository database is named jasperserver. Use the database vendor's tools to make a dump of this schema. Store with the other files. Since Jaspersoft, the bundled installer comes with PostgreSQL. Please see the below steps to take a backup of the Jasperserver PostgreSQL database. PostgreSQL provides the pg_dump utility to simplify backing up a single database. Open windows Command prompt and Navigate PostgreSQL installation folder: postgresqlbin Run the following command: pg_dump.exe -U postgres Enter the password when prompted for postgres user password Dump the contents of a database to a file by running the following command. pg_dump jasperserver > jasperserver.bak The resulting backup file, jasperserver.bak, can be transferred to another host with scp or stored locally for later use as backup.
  20. The ability to suppress various headers and footers in report exports has been avalable since version 3.x by enabling export filters in .../jasperserver-pro/WEB-INF/classes/jasperserver.properties. The generic format for these properties is: [toc]net.sf.jasperreports.export.{format}.exclude.origin.{suffix}.{arbitrary_name}net.sf.jasperreports.export.{format}.exclude.origin.keep.first.{suffix}.{arbitrary_name} These properties are explained in detail here: How can I suppress page headers and footers when exporting to XLS? Beginning with version 5.0A new wild card property must be added for suppressing column headers in CSV exports (exports to non-paginated Excel do not require this additional property): net.sf.jasperreports.export.csv.exclude.origin.keep.first.report.3=* The following properties will keep the column header and page header on the first band and suppress all others: net.sf.jasperreports.export.csv.exclude.origin.keep.first.band.1=pageHeadernet.sf.jasperreports.export.csv.exclude.origin.band.2=pageFooternet.sf.jasperreports.export.csv.exclude.origin.keep.first.band.3=columnHeadernet.sf.jasperreports.export.csv.exclude.origin.keep.first.band.4=columnHeadernet.sf.jasperreports.export.csv.exclude.origin.keep.first.report.4=*net.sf.jasperreports.export.csv.exclude.origin.band.5=columnFooter#entry #4 and the 4* both make the setting apply to all subreports
  21. Issue:In JasperReports Server v5.1, when configuring LDAP authentication usling the applicationContext-externalAuth-LDAP-mt.xml sample file, with no multitenant license, users get the following error on the login screen: "Invalid credentials supplied.Could not login to JasperReports Server. " With this configuration, the JasperReports Server is assuming multitenancy and attempts to map the organization hierarchy which results in the invalid credentials error message. Resolution:The ldapExternalTenantProcessor bean must be configured to ignore multitenancy. The new JasperReports Server Authentication Cookbook v5.2, section 3.7.1, "Mapping to a Single Organization" (found in our Docs Area) shows the proper configuration for this bean when using a single organization (see also attached sample-applicationContext-externalAuth-LDAP-pro-nomt.xml). The bean should be configured as follows: <bean class="com.jaspersoft.jasperserver.multipleTenancy.security.externalAuth.processors.ldap.LdapExternalTenantProcessor" id="ldapExternalTenantProcessor" parent="abstractExternalProcessor"> <property name="ldapContextSource" ref="ldapContextSource" /> <property name="multiTenancyService"><ref bean="internalMultiTenancyService"></ref></property> <property name="excludeRootDn" value="true" /> <!-- only following LDAP attributes will be used in creation of organization hierarchy. Eg. cn=Smith,ou=Developement,o=Jaspersoft will produce tanant Development as child of tenant Jaspersoft (if excludeRootDn=false) as child of default tenant organization_1 --> <property name="organizationRDNs"><list /></property> <property name="rootOrganizationId" value="organization_1" /> <property name="defaultOrganization" value="organization_1" /></bean>[/code]Note the excludeRootDn property is set to "true," the organizationRDNs list is empty, and the defaultOrganization property has been added with value, "organization_1." Please review JasperReports Server Authentication Cookbook v5.2, for more implementation details. ReferencesJasperReports Server Authentication Cookbook v5.2 (HTML)JasperReports Server Authentication Cookbook v5.1 (PDF)JasperReports Server Authentication Cookbook v4.7 (PDF)jasperreportsserver-auth-cookbook-4.0.pdf v4.0 (PDF)
  22. Issue:A customer has a dashboard with 9 reports that was taking 40+ seconds to render. When they clicked on the dashboard link the screen went blank for the first 16 seconds until the dashboard frames appeared, then they saw the rotating wait icons for the balance of the time until the reports eventually rendered. This was was too slow, so they asked for our help to improve the performance. The environment:JasperReports Server v4.7.1Red Hat Linux 2.6JBoss 6 EAPOpentJDK 1.7FireFox browser was the customer's defaultResolution:The customer's goal was to render the dashboard in 15 seconds or less. We began by configuring the cache control filter to elliminate the HTTP 304 responses for static resources such as .js, .css, .png, etc. (see Setting up a cache filter in Tomcat or JBoss for static files). This reduced the rendering time to 24 seconds, including 7 seconds to render the dashboard frames. A big improvemnet but still not fast enough. Some server-side optimizations brought the time down to 21 seconds, but we could do no more without completely refactoring the dashboard framework (look for this in a release due out in the winter of 2013). The largest part of the problem was that each report was requesting and processing its own resources, and most of these were identical to the other eight reports. There were 35 distinct JavaScript files, so the browser had to process and parse nine copies of each of the 35 JavaScript files. This consumed a lot of time and CPU cycles on the client. The final solution was to create a main report with nine sub reports, laid out in the same manner as the dashboard. In iReport all the bands in the main report were deleted except for the Summary band, which was sized the same as the dashboard, then the original reports were added as sub reports. The time to render this report was 6 seconds, a 21% improvemnet! Instead of requesting 426 resources from the server the new report requested 94, and the JavaScript files were all distinct, elliminating the multiple processing of the same resources by the browser. The downside was that they lost the ability to refresh the individual reports in the dashboard, but they could still drill down into each report using hyperlinks in the sub reports. This was a minor inconvenience compared to the slow performance of the dashboard.
  23. In JasperReports Server 5.1 when CAS creates a user using roles from an external datasource it will create the roles in the default organization where the user is created. For security reasons ROLE_ADMINISTRATOR from an external datasource will not have have administrator permissions unless the following change is made in the security configuration. In applicationContext-externalAuth-CAS-db-mt.xml in the organizationRoleMap propery of the mtExternalUserSetupProcessor bean change the key value "ROLE_ADMIN_EXTERNAL_ORGANIZATION" to "ROLE_ADMINISTRATOR" and remove the "|*" from entry value. The configuration will now look like the following snippet: <property name="organizationRoleMap"> <map> <!-- Example of mapping customer roles to JRS roles --> <entry> <key> <value>ROLE_ADMINISTRATOR</value> </key> <!-- JRS role that the <key> external role is mapped to--> <!--<value>ROLE_ADMINISTRATOR</value>--> <value>ROLE_ADMINISTRATOR</value> </entry> </map></property> The externally defined user with ROLE_ADMINISTRATOR will now be mapped to the internal ROLE_ADMINISTRATOR and will have full administrator permissions.
  24. Beginning with JasperReports Server 5.1, CAS and LDAP configuration uses sample configuration files for several standard configurations. These files will be found in jasperreports-server-5.1-bin/samples/externalAuth-sample-config. Unfortunately the sample file for static roles is missing from the distribution as of April 30, 2013. The sample file is attached to this article.
×
×
  • Create New...