Jump to content
Changes to the Jaspersoft community edition download ×

Error when running report in JasperSoft Studio using RMI and Spring framework: org/springframework/context/ApplicationContext


BinaryMan

Recommended Posts

I'm trying to create a report in JasperSoft Studio, based on the CollectionsJavaBeans. In eclipse, I have created two projects, the first project lat's say it's called "Server", it's a simple server that provide a service ... The second project let's say it's called 'Client', this client will ask the server for the service, using the RMI, and the Spring framework ... I have created a simple client.java class to simply test my projects. The client.java:

 

import java.rmi.RemoteException;import org.springframework.context.ApplicationContext;import org.springframework.context.support.FileSystemXmlApplicationContext;import com.inter.test.TestRemote;public class Client {    public static void main(String[] args) throws RemoteException    {        String file = "D:\myworkspacepath...\src\client-beans.xml";        ApplicationContext context = new FileSystemXmlApplicationContext(file);        TheService remote = (TheService )context.getBean("TheService Bean");        System.out.println(remote.isLoginValid("ak"));        System.out.println(remote.isLoginValid("test"));    }}[/code]

I have launched the server, than I have launched the Client.java, and results is as shown below:

 

false
true

This result ensures that all worked successfully and no error has detected.

Well, after exporting for the 'Client' project, in JasperSoft Studio, I have created a new report and I have assigned data source to be the 'Client' project, be sure that I know very much how to create and use that kind of data source, since I have created a lot of projects based on same kind of data source ... And after designed my report, and when I have launched my report, I got this mistake error:

net.sf.jasperreports.engine.JRException: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext    at com.jaspersoft.studio.editor.preview.view.control.ReportControler.fillReport(ReportControler.java:482)    at com.jaspersoft.studio.editor.preview.view.control.ReportControler.access$18(ReportControler.java:457)    at com.jaspersoft.studio.editor.preview.view.control.ReportControler$4.run(ReportControler.java:347)    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext    at java.lang.Class.forName0(Native Method)    at java.lang.Class.forName(Unknown Source)    at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(JRClassLoader.java:157)    at net.sf.jasperreports.data.bean.BeanDataAdapterService.contributeParameters(BeanDataAdapterService.java:82)    at net.sf.jasperreports.engine.fill.JRFillDataset.contributeParameters(JRFillDataset.java:1017)    at net.sf.jasperreports.engine.fill.JRFillDataset.setParameterValues(JRFillDataset.java:627)    at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1280)    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:900)    at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFiller.run(BaseFillHandle.java:120)    at java.lang.Thread.run(Unknown Source)Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContext    at java.net.URLClassLoader$1.run(Unknown Source)    at java.net.URLClassLoader$1.run(Unknown Source)    at java.security.AccessController.doPrivileged(Native Method)    at java.net.URLClassLoader.findClass(Unknown Source)    at java.lang.ClassLoader.loadClass(Unknown Source)    at java.lang.ClassLoader.loadClass(Unknown Source)    ... 10 more[/code]

I googled a lot, I found much of posts here and in other forums such as (community.jasper), but I don't found any solutions to resolve this error, I hope someone can help me here and sorry if my english isn't good. Best regards.

Link to comment
Share on other sites

  • 8 months later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

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