Jump to content

NoClassDefFoundError


burferd

Recommended Posts

Using Jasper Reports 1.3.2 in JSF web application.

 

 

I have two projects that use reports.

One works fine

The other gives a NoClassDefFoundError when I call

JasperFillManager.fillReport( rptPath, parameters, conn)

Unfortunately, there is no reference to what is causing the problem other than something in fillReport()

 

 

The reports work fine in iReport 1.3.2, so the stored procedure and report logic seems to be working.

The server and IDE are configured properly, since one works.

 

 

The question is why the other does not work.

 

 

I have no idea what the NoClassDefFoundError is referring to in this context. Usually it is a missing method in a library somewhere, but I am calling fillReport in both cases.

 

 

Here is a bit of the code I am using:

 

public boolean createDocumentRpt( int docId )

{

JasperPrint jp=null;

JasperReport jr = null;

try

{

String title = "Document Report;

Map parameters = new HashMap();

parameters.put( "p_title", title );

jp = JasperFillManager.fillReport( "C:/Reports/report.jasper", parameters, conn );

doPdfReport( jp, "DocumentReport");

}

catch( Exception e )

{

log( "<SessionBean1.createDocumentRpt> Error: "+ e.toString());

return false;

}

return true;

}

 

 

The connection conn is the one used in the rest of the application and seems to work fine.

 

 

Here is a portion of the error:

 

 

Description: An unhandled exception occurred during the execution of the web application. Please review the following stack trace for more information regarding the error.

 

Exception Details: java.lang.NoClassDefFoundError

org/apache/commons/javaflow/bytecode/Continuable

 

Possible Source of Error:

Class Name: java.lang.ClassLoader

File Name: ClassLoader.java

Method Name: defineClass1

Line Number: -2

 

Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.

 

 

Stack Trace:

 

java.lang.ClassLoader.defineClass1(ClassLoader.java:-2)

java.lang.ClassLoader.defineClass(ClassLoader.java:620)

java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)

org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1798)

org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:910)

org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1375)

org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1239)

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

net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:402)

net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:234)

evr.ReportSessionBean.createDocumentRpt(ReportSessionBean.java:186)

evr.DocumentRptPage.submitBtn_action(TagInfoRptPage.java:581)

sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

java.lang.reflect.Method.invoke(Method.java:585)

com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)

com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)

com.sun.rave.web.ui.appbase.faces.ActionListenerImpl.processAction(ActionListenerImpl.java:57)

javax.faces.component.UICommand.broadcast(UICommand.java:312)

Post edited by: burferd, at: 2007/10/15 17:36

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I have both the mentioned jar files.

 

 

I have the following jar files in library list

 

 

jasperreports-1.3.2-javaflow.jar

jasperreports-1.3.2.jar

commons-beanutils-1.7.jar

commons-collections-2.1.jar

commons-digester-1.7.jar

itext-1.3.1.jar

jfreechart-1.0.0,jar

poi-2.0-final-20040126.jar

 

 

Maybe there is a conflict between some of these and only one project strikes a nerve?

Link to comment
Share on other sites

I removed the reference to jasperreports-1.3.2-javaflow.jar from my library, did a clean and build for the project and I still get the same error.

 

 

I created a simple report that just displays a text field.

It takes no parameters and no database connection.

This also gives the same error.

Here is how I am calling the test report.

 

 

public boolean createTestRpt()

{

JasperPrint jp=null;

JasperReport jr = null;

try

{

Map parameters = new HashMap();

jp = JasperFillManager.fillReport( "C:/Reports/NoDbTest, parameters, new JREmptyDataSource() );

doPdfReport( jp, "Testrt");

}

catch( Exception e )

{

log( "<SessionBean1.createTestReport> "+ e.toString());

return false;

}

return true;

}

 

 

It still fails in JasperFillManager.fillReport.

Link to comment
Share on other sites

So you don't have jasperreports-1.3.2-javaflow.jar on your application's classpath, but still get NoClassDefFoundError for org/apache/commons/javaflow/bytecode/Continuable.

 

I'm afraid I can't explain why would this happen. Maybe others have some clues..

 

Regards,

Lucian

Link to comment
Share on other sites

Just as an FYI.

The solution you suggested, removng the javaflow jar file, works.

 

For some reason, when I removed it from my library list, it still got added to the war file.

When I removed it from the war file, the reports print.

 

Thanks.

Link to comment
Share on other sites

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