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

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 class to simply test my projects. The


import java.rmi.RemoteException;
import org.springframework.context.ApplicationContext;
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");

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


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
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(
    at net.sf.jasperreports.engine.fill.JRFillDataset.contributeParameters(
    at net.sf.jasperreports.engine.fill.JRFillDataset.setParameterValues(
    at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(
    at net.sf.jasperreports.engine.fill.BaseFillHandle$
    at Source)
Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContext
    at$ Source)
    at$ Source)
    at Method)
    at Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 10 more

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.

BinaryMan's picture
Joined: Oct 2 2014 - 6:58am
Last seen: 8 years 3 months ago

Are you working with Maven? If yes, try to add this to your pom.xml


RebeccaS. - 7 years 8 months ago

0 Answers:

No answers yet