Jump to content
JasperReports Library 7.0 is now available ×

Adding Custom Jar to JasperServer


CoffeeKid

Recommended Posts

Hello,

 

I've created a custom class called SecToTime that converts seconds (a long value) into a string formated in XX:XX:XX

 

So this would cause an long value of 209 to be come 00:02:29

 

I've made the jar file then added it to iReports, and used the following in a text field:

Code:

new SecToTime($V{variable}.longValue()).toString()

 

when i compile the report in Ireports, it works perfect, but trying to add the .jar file to jasper server has caused me some problems.

 

I've added the file to the common/lib dir in tomcat, even tried to modify tomcat's class path, all of which give me the following error:

 

Error Message:

org.springframework.webflow.engine.ActionExecutionException: Exception thrown executing [AnnotatedAction@1eaf25d targetAction = com.jaspersoft.jasperserver.war.action.ViewReportAction@10bfe2c, attributes = map[[empty]]] in state 'verifyData' of flow 'viewReportFlow' -- action execution attributes were 'map[[empty]]'; nested exception is com.jaspersoft.jasperserver.api.JSExceptionWrapper: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : new SecToTime($V{loginNum}.longValue()).toString()

Error Trace:

org.springframework.webflow.engine.ActionExecutionException: Exception thrown executing [AnnotatedAction@1eaf25d targetAction = com.jaspersoft.jasperserver.war.action.ViewReportAction@10bfe2c, attributes = map[[empty]]] in state 'verifyData' of flow 'viewReportFlow' -- action execution attributes were 'map[[empty]]'; nested exception is com.jaspersoft.jasperserver.api.JSExceptionWrapper: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : new SecToTime($V{loginNum}.longValue()).toString()

 

org.springframework.webflow.engine.ActionExecutionException: Exception thrown executing [AnnotatedAction@1eaf25d targetAction = com.jaspersoft.jasperserver.war.action.ViewReportAction@10bfe2c, attributes = map[[empty]]] in state 'verifyData' of flow 'viewReportFlow' -- action execution attributes were 'map[[empty]]'; nested exception is com.jaspersoft.jasperserver.api.JSExceptionWrapper: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression :

Source text : new SecToTime($V{loginNum}.longValue()).toString()

Caused by: com.jaspersoft.jasperserver.api.JSExceptionWrapper: java.lang.UnsupportedClassVersionError: Bad version number in .class file

at java.lang.ClassLoader.findBootstrapClass(Native Method)

at java.lang.ClassLoader.findBootstrapClass0(ClassLoader.java:891)

at java.lang.ClassLoader.loadClass(ClassLoader.java:301)

at java.lang.ClassLoader.loadClass(ClassLoader.java:299)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)

at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1270)

at java.lang.ClassLoader.loadClass(ClassLoader.java:299)

at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

at UserTimeStats_1186539169339_594747.evaluate(UserTimeStats_1186539169339_594747:275)

at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:186)

....

 

 

What am i doing wrong?

 

Thanks

CoffeeKid

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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