cancel
Showing results for 
Search instead for 
Did you mean: 

Linking External Jars to WebDynPro

Former Member
0 Kudos

I’ve read many posts on this topic but for whatever reason I’m not able to get it to work. I wanted to make an available 4 jar files at Runtime to my WebDynPro application. My understanding is the only way to do this is to create another application and make expose these libraries as a “Public Part”. I believe I have done and have deployed the application however it doesn’t appear the *.class files make it over. The package structure does and so do the *.xml and *.properties but no classes. Below are the steps I followed.

1. Created WebDynpro application A (WebDynProA)

2. I linked in the 4 *.jar files by adding “External Jars” – This satisfied the compile time requirement.

2. Created New WebDynpro application B (WebDynProB)

3. In WebDynpro application B via Package Explorer I imported the 4 jar files using Import->Zip File

4. In WebDynProB created public part (Assembly) and added the 4 External jar files.

5. Deployed WebDynProB

/* As mentioned before I expected 
      WebDynProBwebdynpropubliclibapp.jar to contain the classes in the
      exposed jar files but only *.xml, *.properties and the package 
      structures but no classes. 
*/

6. In WebDynProA under DC MetaData->DC Definition ->Used DCs I added the WebDynProB and set “At RunTime”, “At Build Time”, “At Deploy Time” and “At Design Time” all equal true.

After deployment I still get a NoClassDefFoundError when running WebDynProA.

Any ideas what I’ve done wrong?

/Greg

Accepted Solutions (1)

Accepted Solutions (1)

former_member186016
Active Contributor
0 Kudos

Hi Greg,

You have to deploy the jars as libraries to be available at runtime.

Following blog will help you achieve that:

/people/valery.silaev/blog/2005/09/14/a-bit-of-impractical-scripting-for-web-dynpro

Hope it helps.

Best Regards,

Ashwani Kr Sharma

Former Member
0 Kudos

Ashwani,

I saw that blog but on your recommendation I went back and read it. It is what I needed. Not sure why an activity as simple as deploying jar files has to be so complicated.

Thanks again.

/Greg

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Do the following steps,

<b>Using JAR files in Webdynpro:</b>

The JAR files will be required 2 times.

1) Design time

2) Run time

<b>For Design time,</b> you can add those JAR files to the Project Build path ( Right click on Project -> properties -> JAVA Build Path -> Libraries -> Add External JAR )

<b>For Run time,</b> your JAR files must be present on the server or in the Web Dynpro EAR. So, it is not possible for everyone to have access to put JAR files on server. What you can do here is, put the required JAR in the "lib" folder of Web Dynpro Application. So, the JARS will included in EAR of WDP App.

( go to package explorer -> select your WDP project -> import JARs in "Lib" folder)

<b>Threads:</b>

<b>Inluding External libraries:</b>

http://help.sap.com/saphelp_nw70/helpdata/en/f9/ce747474574fdb8a79fed77ea075f8/frameset.htm

Former Member
0 Kudos

Suresh,

Thanks for the reply. I saw the recommened threads and they did not work for me as described. I must have missed something.

Thanks for the reply.

/Greg

Former Member
0 Kudos

If u wanted the jars to be available only to ur application u can simply put it in ur lib folder and set the classpath.