cancel
Showing results for 
Search instead for 
Did you mean: 

java.lang.NoClassDefFoundError in WebDynpro Project

Former Member
0 Kudos

Hello,

I am trying to build a test application which should use a JavaBean model.

For that matter I created a JavaBean (according to the command bean pattern), DTO and a business delegate class.

All these classes are located in one DC.

I put a reference (Used DCs) to the WebDynpro project.

During design time I am able to create the model using the Java Bean class.

Modeling is ok, but when I try to deploy and run the application (on a remote server), I get a

java.lang.NoClassDefFoundError

The detailed trace shows

...

Caused by: java.lang.NoClassDefFoundError: com.camelot.cmeio.beans.material.command.MaterialBean

at com.camelot.test.app.wdp.InternalTestApp.<init>(InternalTestApp.java:45)

So, it seems during runtime the WebDynpro project doesn't find the command bean.

Any idea how to solve this problem?

I already tried to pack the Bean classes in a library which is deployed on the server.

Thanks,

Michael

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Dear..

if create Java bean model. you wrote some code as DTO.then you go to DC META DATA then create one Public part as any name...then go to next ..after that you will gwt somw option like..folder,tree,package..you choose any one of them .then you see all source related to your model DC

then Click finis..now yopur public part has been created for model DC..

after that..go to main Dc which you want to use model Dc,,,go to DC mEtadata->Used Dc--right click->

add Used Dc..>then you choose your model Dc->expand your model Dc-->you will get youe publipart which you have created at time of public part...

then choose public part as you asisigned that name..

Thne in below you will gate 4 check box ...you have to do check od build time and run time..two option you have to checked...

now all source of model Dc available in your parent DC...

finish..

then you build all Dc and deploy your server...now Your application does not show any error,,,,

Thanks

Sudhira kumar

Former Member
0 Kudos

well, that's what I did, BUT IT DOESN'T WORK.

The problem is that the DC which contains all my DTO and JavaBean definitions cannot be deployed since it is just a Java Project.

So, the missing part is just: how can I deploy the DTO and other Java classes from my Java project.

I understood from the whole thread that the only way is creating a library with external jars and deploy this,

Thanks,

Michael

Former Member
0 Kudos

Hi,

What I get is you have all the bean related classes in a DC project (probably EJB Module project). Do a DC build for this project.

Create an Enterprise Application DC project & add a reference to this bean DC project. Do a DC build, create archive & deploy for this project.

Now refer to this Enterprise Application DC project from your Web Dynpro DC project.

Hope this helps you.

Kind Regards,

Nitin

Former Member
0 Kudos

Hello,

it is not an EJB module in the DC, just plain old java objects...

Thanks,

Michael

Former Member
0 Kudos

Hi,

you need to add the jar files using external library DC.

follow the blog below for the same.

/people/marion.schlotte/blog/2007/12/19/simplify-dc-structures-for-external-libraries

Thanks,

Prasanthi.

Former Member
0 Kudos

Although this topic is also interesting, my problem is that my own classes are not found. So, is there really no other way than via an external library???

BTW: the solution showed in the blog does not work in my case either. I tried to create a libs folder, but the project in the NWDS just ignored this.

Thanks,

Michael

former_member185086
Active Contributor
0 Kudos

Hi

Use Publish as archive rather than publish as file for both compilation and assembly.

Define the uses relationship and Build it and then Deploy.

Best Regards

Satish Kumar

Edited by: satish jhariya on Mar 5, 2009 7:56 PM

Former Member
0 Kudos

What do you exacvtly mean by Publish as archive?

How will this solve my problem?

Like I said: the dependencies are maintained.

Has anybody faced a similar problem?

former_member185086
Active Contributor
0 Kudos

Hi

Even u maintained all the dependency still got java.lang.NoClassDefFoundError.

Let we consider some scenario

1. It might during runtime it found all the required dependency,but not the compiled classes.Jar classes are compiled classes once defined their uses they start serving to the component.

2.An External Library DC in Development is just like a Java DC (except that you don't have sources or do not want to compile them): It's a simple building block that is used during build. Maybe it has a specific "API" subset (in which case you could publish different Jar files in compilation/assembly public parts) or it hasn't (in which case the jars in compilation/assembly public parts would be identical). Anyway, public parts are relevant for build.

when u define the public part of user dc here u go for publish as archive.

To find this option (Tell me the version u r using of NWDS)

1.Select your External library Dc(if not then create that)---Under library folder put your jar files ---now select a that jar and right click --under development component --here u will find two option Publish as file and publish as archive select that and define Public Part for both compilation as well as assembly.

2 Build this Dc (No need to compile )

3.Define the uses relation-ship with your WebDynpro Component.

4.Build both the dc again

5.Compile and run your Webdynpro Dc only.

6. In this way Run time will find the physical reference of the used class

Hope I am bit clear this time?

Best Regards'

Satish Kumar

Former Member
0 Kudos

ok, thanks, that was the direction I was searching for. Since I don't have an EJB (early design decision), I need to deploy the Java classes otherwise.

So, I'll try this approach (although I was unlucky the first time with an external library. I couldn't create a libs folder in the library project. I will try again).

Thanks,

Michael

Former Member
0 Kudos

Hi,

Look the thread below.. Might help you

Thanks,

Prasanthi.

Former Member
0 Kudos

hi

I barely remember, but when you create the DC dependency you specify if it is going to be used at Design Time and at Run Time, check both and make sure the other DC is deployed before

Former Member
0 Kudos

yes, both is checked

Former Member
0 Kudos

Sorry, I misread the question first, Your bean class is not getting referenced? Am I right?

Edited by: Anagha Jawalekar on Mar 5, 2009 4:39 PM

Former Member
0 Kudos

yes, at runtime the bean classes are not found

Former Member
0 Kudos

To make the runtime interface reference could you try the following?

1) Right-click your WD project.

2) Select 'Properties' > 'Web Dynpro References'> 'Interface References'

3) Add class

4) Apply and OK

5) Build the project and run.

Former Member
0 Kudos

Here is what I think: the deployment of the WebDynpro project worked on the target application server, but the necessary classes were not deployed.

So, for me the question is: how can I deply the bean classes on the target machine?

Via library or is there a way to include jars or libraries in the WebDynpro projects?

Thanks,

Michael