cancel
Showing results for 
Search instead for 
Did you mean: 

Problem Web Dynpro Java applications using JasperReports

Former Member
0 Kudos

Hello all,

We have followed the footsteps of these blogs but we can not make it work.

Part I -->

Part II -->

Part III -->

Details system: 7.02 SP3

We believe that the problem is in the library, because it finds them.

1) We created project as a DC external library with *.jars

2) Public part DC external library.

3) Add public part of DC Library into new project DC WebDynpro Java.

4) Development Component -> Build is OK

5) Development Component -> Deploy is OK

6) Test app ERROR.

When we run the application shows the error:


The initial exception that caused the request to fail, was:

   java.lang.NoClassDefFoundError: net/sf/jasperreports/engine/JRDataSource 

    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:141)
    at com.unisys.tmb.View01.onActiongenerarPDF(View01.java:161)
    at com.unisys.tmb.wdp.InternalView01.wdInvokeEventHandler(InternalView01.java:140)
    at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
    ... 28 more


See full exception chain for details. 

Regards,

Luis.

Accepted Solutions (0)

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos

you are missing some step regarding how to use external lib

you just covered the design time.

you are missing runtime reference.

follow this blog

you can also search regarding how to use external lib

Former Member
0 Kudos

Hello John,

Thanks for the link. We have performed the steps in this blog:

1) Create DC Project "External Library" with name js/jars:

- Add *.jars in folder Libraries.[Screenshot Libraries|http://img846.imageshack.us/img846/8395/jsjars.jpg]

- Add archives (*.jar) to public part with name ExternalLib. Which option to choose?

a- Provides an API for developing/compiling other DCs (Option chosen)

b- Can be packaged into other build results (eg SDAs)

- Development Component -> Build

Step 1 is OK.

2) Create "J2EE Server Component / Library" DC with name js/lib:

- Add Used DC -> public part project ExternalLibrary -> "ExternalLib"

- Specify both build time and run-time dependency here and strong.

- Generated SDA file in <var>gen/default/deploy</var> How do we check that it contains <var>js.jar</var>?

- folder gen/default/plublic/defLib/lib/java then you meet *.jars files again. is OK.

- Development Component -> Deploy.

- Go to Visual Administrator. We found the library js/lib, but has no associated *. jar. It is the problem.[Screenshot Visual Administrator|http://img542.imageshack.us/img542/5537/visualadminlib.jpg]

3) Create "WebDynpro" DC with name pdf_jasper

- Add used DC (defLib) to WebDynpro DC with option "Build time".

- WebDynpro References -> Library references --> add <var>jslib

- Deploy

- Run error: java.lang.NoClassDefFoundError: net/sf/jasperreports/engine/JRDataSource

Regards,

Luis.

junwu
Active Contributor
0 Kudos

you have to create two public part.

i don't know if you have any knowledge abut CE

This blog has more screenshot, but it is for ce platform.

the difference is you have to create ear project in ce, in nw7 you will create jee lib project to deploy the lib dc..

junwu
Active Contributor
0 Kudos

have a look at this one.

Former Member
0 Kudos

Hi John Wu,

I'm facing the same issue. I followed all the steps mentioned above but no succes. When clicking the button to generate the HelloReport class shows up the following error:

java.lang.NoClassDefFoundError: net/sf/jasperreports/engine/JRDataSource

The code lines are:

HashMap data = new HashMap();

data.put("NAME", wdContext.currentContextElement().getName());

ArrayList dataList = new ArrayList();

dataList.add(data);

HelloReport report = new HelloReport(dataList);

In the HelloReport.java:

public HelloReport(ArrayList dataList)

{

dataSourceMap = new JRMapCollectionDataSource(dataList);

}

Do you have any suggestions?

Thanks in advance.