cancel
Showing results for 
Search instead for 
Did you mean: 

Using JARs from Enterprise Application

Former Member
0 Kudos

Hello!

I've created a Enterprise Application in NWDS consisting of 2 EJB-Modules and 1 Web Module.

Therefore I've created the appropriate projects in NWDS. After deployment to WEB AS the application worked fine.

Now I'm trying to outsource some global utility classes, that should be used by all modules. Therefore I created an additional Java project and the approriate classes and put it all together in one JAR. All references are set, build in NWDS works and the EAR file contains that JAR.

But after deployment, the application fails with a NoClassDefFoundError, when one of the modules tries to access those utility classes.

Does anybody has an idea, what went wrong?

Maybe, a project of type "J2EE Server Component -> Library" is the solution. But I haven't found any documentation about this.

Help is highly appreciated. Thanks in advance!

Regards,

Matthias

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hi Matthias,

Are you familiar with this /people/valery.silaev/blog/2005/09/14/a-bit-of-impractical-scripting-for-web-dynpro ?

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

Thanks Maksim, for your quick answer. Your solution is for server-wide libraries, isn't it?

But in my case, the library should be only visible application-wide. (And also deployable within the application).

Thank you,

Matthias

pravesh_verma
Active Contributor
0 Kudos

Hi Mattihas,

I hope you must have added the jar file as an external jar. If not then follow these steps:

<b>Project-> Properties -> Java Build Path -> Add External Jar</b>

<a href="http://img207.imageshack.us/img207/2314/jar4om.jpg">Jar in Build Path</a>

After that include the .jar file in the lib folder of your project as well. See this pic for a clear idea.

<a href="http://img142.imageshack.us/img142/8168/solution4gy.jpg">.Jar in the lib folder</a>

I hope this should solve your problem.

Regards

Pravesh

PS: Please consider rewarding points if solved and helpful.

Former Member
0 Kudos

Pravesh,

thanks for your answer. According to your description, I've added a lib folder to the project's META-INF folder, and copied the jar to it. (I have no PORTAL-INF, because it's an EJB application). And it works!

The only problem is, that I have to publish changes in this lib manually to all module projects.

I tried also a second thing, that finally worked out as well (and I'm sure, that I tried it already before 😞

Within the properties of the EAR project, there is a page called "Archive Build Info". There you can specify libraries form other projects, that will be included during EAR generation. So this solution fits better for me.

Thank you all for your answers!!!

Cheers,

Matthias

Answers (0)