does jasper reports need grrovy in classpath

0

I am getting this exception

 

java.lang.NoClassDefFoundError: org/codehaus/groovy/control/CompilationFailedException

 

 

I am sure I am not using anything from grrovy , does jasper neds this  ?

 

here stack trace

 

java.lang.NoClassDefFoundError: org/codehaus/groovy/control/CompilationFailedException     at java.lang.Class.getDeclaredConstructors0(Native Method)     at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)     at java.lang.Class.getConstructor0(Class.java:2699)     at java.lang.Class.newInstance0(Class.java:326)     at java.lang.Class.newInstance(Class.java:308)     at net.sf.jasperreports.engine.JasperCompileManager.getCompiler(JasperCompileManager.java:476)     at net.sf.jasperreports.engine.JasperCompileManager.loadEvaluator(JasperCompileManager.java:242)     at net.sf.jasperreports.engine.fill.JRFillDataset.createCalculator(JRFillDataset.java:420)     at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:411)     at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:78)     at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:60)     at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:147)     at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:57)     at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:421)     at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:382)     at gov.hhs.acf.document.JasperFillManagerWrapper.getJasperPrint(JasperFillManagerWrapper.java:29)     at gov.hhs.acf.document.AuditDocumentService.generateMemo(AuditDocumentService.java:62)     at gov.hhs.acf.document.AuditDocumentService.generateAdl(AuditDocumentService.java:79)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)     at java.lang.reflect.Method.invoke(Method.java:597)     at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)     at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)     at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)     at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)     at $Proxy47.generateAdl(Unknown Source)     at gov.hhs.acf.ea.service.DefaultEaAuditProgramService.createAdl(DefaultEaAuditProgramService.java:200)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)     at java.lang.reflect.Method.invoke(Method.java:597)     at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)     at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)     at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)     at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)     at $Proxy49.createAdl(Unknown Source)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)     at java.lang.reflect.Method.invoke(Method.java:597)     at org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:416)     at org.apache.wicket.proxy.$Proxy77.createAdl(Unknown Source)     at gov.hhs.acf.web.pages.auditprogram.AdlListPage.createDocument(AdlListPage.java:33)     at gov.hhs.acf.web.pages.auditprogram.DocumentsListPage$1.onClick(DocumentsListPage.java:50)     at org.apache.wicket.ajax.markup.html.AjaxFallbackLink$1.onEvent(AjaxFallbackLink.java:73)     at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)     at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299)     at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:113)     at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)     at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)     at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)     at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)     at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)     at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:456)     at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:289)     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1112)     at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)     at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)     at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)     at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)     at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1112)     at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1112)     at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)     at org.mortbay.jetty.security.ConstraintsSecurityHandler.handle(ConstraintsSecurityHandler.java:220)     at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)     at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:822)     at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:305)     at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:229)     at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:113)     at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)     at org.mortbay.jetty.Server.handle(Server.java:324)     at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:550)     at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:876)     at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:535)     at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)     at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:407)     at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:421)     at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520) Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.control.CompilationFailedException     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)     at java.security.AccessController.doPrivileged(Native Method)     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)     at java.lang.ClassLoader.loadClass(ClassLoader.java:252)     at org.codehaus.plexus.classworlds.realm.ClassRealm.loadRealmClass(ClassRealm.java:174)     at org.codehaus.plexus.classworlds.strategy.DefaultStrategy.loadClass(DefaultStrategy.java:67)     at org.codehaus.plexus.classworlds.strategy.ForeignStrategy.loadClass(ForeignStrategy.java:39)     at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:201)     at org.codehaus.plexus.classworlds.strategy.DefaultStrategy.loadClass(DefaultStrategy.java:73)     at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:201)     at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:326)     at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:279)     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)     ... 86 more  

 

 

fachhoch's picture
Joined: May 1 2009 - 8:23am
Last seen: 6 months 3 weeks ago

9 Answers:

-1

I am getting exact same error. I compared it with a few sample projects and seems that I do have all the required jars but still get this error when the line

JasperPrint jsprint = JasperFillManager.fillReport(jasperReport, params, datasource); is executed. I am using jasperreports-3.6.0.

If you do find a the issue please post it.

Thanks

fdost's picture
20
Joined: Oct 13 2009 - 9:14am
Last seen: 5 years 1 month ago
2
fdost's picture
20
Joined: Oct 13 2009 - 9:14am
Last seen: 5 years 1 month ago
0

I am using ireports in java application.when i am compliling the jrxml file in jasper reports it was showing an exception

Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/groovy/control/CompilationFailedException

at java.lang.Class.forName0(

at java.lang.Class.forName(Unknown Source)

at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(

at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForName(

at net.sf.jasperreports.engine.JasperCompileManager.getCompiler(

at net.sf.jasperreports.engine.JasperCompileManager.compileReport(

at net.sf.jasperreports.engine.JasperCompileManager.compileReport(

at integrate_report.generate_report(

at integrate_report.main(

Caused by:

Native Method)JRClassLoader.java:157)JRClassLoader.java:115)JasperCompileManager.java:511)JasperCompileManager.java:215)JasperCompileManager.java:148)integrate_report.java:34)integrate_report.java:48)java.lang.ClassNotFoundException: org.codehaus.groovy.control.CompilationFailedException

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)

... 9 more

Native Method)

I am not using any groovy............ The jars used in my application are jasper-reports 3.7.2.jar, commons logging-1.0.4.jar, itext 2.1.7.jar, commons-beanutils-1.8.0.jar, commons collections 2.1.1.jar, commonc-collections-2.1.1.jar, common-digest -1.7.jar, ojdbc14.jar.  Do i need to use any more...............

vispi3's picture
9
Joined: Apr 29 2010 - 11:39pm
Last seen: 4 years 6 months ago
4

Whenever you create a jrxml using ireport, the default template language is GROOVY. When this isn't changed for a report and you try to run this in your application, you get the exception. Such cases, Jasper Engine requires groovy jar to be a project dependency (available in the class-path). In your case, you need to change report language to JAVA (as you do no't want groovy support) and then start running the report from your application. You can change your default template language to either JAVA, GROOVY or JAVASCRIPT by navigating to Tools > General Tab > Restore Defaults Tab > Language in iReport.

Revert back in case you have any queries.

Provide Karma points if the above information is useful

rakeshenoch's picture
Joined: Oct 14 2009 - 12:19pm
Last seen: 5 years 1 month ago
0

Hi

I had chaged the language as java but i got the same exception.

I am using jasperassistant plugin in eclipse and running my java application.

I had designed my jrxml in ireport and using in eclipse.

 

Can any one please help me in this....

vispi3's picture
9
Joined: Apr 29 2010 - 11:39pm
Last seen: 4 years 6 months ago
0
Just to be sure, are you sure you've removed all references to "groovy" in your .jrxml files, and have no old .jasper files that were created before removing those references? However, I suggest keeping Groovy because it's way more powerful and concise than Java. If you're using Maven, you can use this in your pom.xml file: org.codehaus.groovygroovy-all1.7.2 I think it should be possible to specify runtime scope (runtime), but when I tried, it didn't work. - Keith
keithrbennett's picture
Joined: May 28 2010 - 3:06pm
Last seen: 4 years 5 months ago
1

the current report properties should change to  language = java

 

Components panel

hongyang070's picture
Joined: Aug 5 2010 - 10:17pm
Last seen: 4 years 3 months ago
0

Hi,

 

If you like to edit/design your reports inside Eclipse IDE, you should consider trying the Jaspersoft Studio plugin:

http://jasperforge.org/projects/jaspersoftstudio

 

This new desiger for JasperReports has support for Groovy reports.

 

I hope this helps. Teodor

teodord's picture
2885
Joined: Jun 30 2006 - 9:00am
Last seen: 6 days 7 hours ago
1

 Open your report xml or from notbad than remove language="groovy"

yaseralhs's picture
Joined: Jun 6 2011 - 11:55pm
Last seen: 3 years 5 months ago
Feedback
randomness