cancel
Showing results for 
Search instead for 
Did you mean: 

import a external jar in web dynpro project

Former Member
0 Kudos

Hi experts.

I've tried to export a external jar in my web dynpro component.

i found in forum some thread about that, for example this thread:

Link: [https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2361] [original link is broken] [original link is broken] [original link is broken];

this is my steps:

1 - create a new component External Lybrary.

2 - put the jar file in the libraries directory

3 - create the public part

4 - make the build

5 - in my web dynpro project i create the used component dependency.

In design, build and deploy all is OK, but in Runtime happen a exception. All the classes that i have in jar file, the web dynpro component don't found and cause a ClassNotFoundException in runtime.

Can anyone help me?

Marcos

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hii,

While u add the external jar file in ur 'Used Dc's ' refernce make sure u tick only build time and not runtime .choose only the build time option.

Hope ur issue will get resolved with this.

Thanks,

Parama.

former_member185086
Active Contributor
0 Kudos

Hi,

Do the same as explain by jay only one thing additionally you have to do that is rather than publish it as file you have to do like this

1. Compile part : Publish as Archive

2 Assembly part : Publish as Archive

Once defined the uses relationship you have to build it and then compile.

Hope it will help you.

Best Regards

Satish Kumar

Former Member
0 Kudos

Hi Peoples...

Actualy, i use NWDS 7.1 EHP, and don't have some option that you describe above. It's a little different.

I've created the public parts adding it in Development Infrastructure perspective, but this never worked. Than i tried to do what satish jhariya post above. In my External Library DC i publish as archive the jar files, one as compilation and other as assemply. Then my component works.

Thanks for all the replies.

There are some difference about the way that you include a public part?

Answers (3)

Answers (3)

chander_kararia4
Contributor
0 Kudos

Hi Marcos,

In addition to the above, do this also.

- Right click on the project. Select Properties.

- Select 'Web Dynpro References'

- Select 'Sharing Reference'

- Click on Add & add a sharing reference.

Hope that should help you.

Regards

Chander Kararia

# Please close the thread once get the correct answer. Give rewards for answers.

Former Member
0 Kudos

Please look at the below thread for help

Former Member
0 Kudos

hi,

u have to add two Public Parts one for assembly and one for Compile,.

chk this out,

/people/bala.krishnan2/blog/2006/09/25/bid-adieu-to-bots--using-captchas

1. Create an External Library DC

2. Copy all of the Jars needed to the libraries folder of this DC

3. Create two Public Parts (right click on the jar files in Package Explorer)

i) compilePart (with purpose compilation)

ii) assemblyPart (with purpose assembly)

4 Create a new DC of type J2EE Server Component / Library

5. Add a Used DC to the J2EE Library, reference the compilePart from previous step, and set Dependency type to Build

6. Add another Used DC, reference the assemblePart, this time select both Build and Runtime Dependency Types

7. Build and deploy.

Regards

Jay