cancel
Showing results for 
Search instead for 
Did you mean: 

How to add external jar in web dynpro without going for DC

Former Member
0 Kudos

Hi,

We are using web dynpro to develop a couple of applications and we dont have set up any scenarios or anything. Source code is managed outside JDI.

For excel download, I need to have the POI jars available to my web dynpro project. Any easy way of refereeing the external jar files in the application and have it available on server?

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Parimal,

The JAR files will be required 2 times.

1) Design time

2) Run time

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

For Run time, 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)

Hope this helps,

Regards,

Mausam

Former Member
0 Kudos

How do you add JAR file onto WebAS for all EARs to use?

Former Member
0 Kudos

You can create a library and deploy that to the application server. Look into standard J2EE enterprise development, either in help.sap.com or in developer studio. Then you only need to reference the library at run time. In webdynpro you need to add the jar in your build class path and also add a reference to it for the run time deployment descriptor.

I would discourage embedding additional jars into webdynpro applications unless you are sure they are needed only there and there is a good reason for not letting others reuse them.

Another consideration is what your jar does. Suppose it has classes with some static initializers, some threads.... then you likely run into trouble if the classes in your jar are loaded several times. What will the classloader do with it? Where will your classes run? What will be their life cycle? Instead, if you have the jar deployed as a J2EE shared library it will be loaded only once and shared by all applications that use it.

Hope this helps

Kind Regards,

Vitaliano

Answers (5)

Answers (5)

Former Member
0 Kudos

I am on SP 15 and my app works fine.

Former Member
0 Kudos

Hi,

Thanks for your prompt response. I used Mausam Kakkad's solution of providing jars at desing and run time.

Thanks again

Former Member
0 Kudos

I have a similar situation.

I am using SP16, I don't see the added jar files in the ear and it fails with an exception.

Does your app work in SP16?

Thanks in advance!

Former Member
0 Kudos

Hi Bhatt,

I thought it is class path but when we need to add external jar files we need to follow procedure that is suggested by mahesh we need to go to Project--> properties --> add external.

Former Member
0 Kudos

Hi Bhatt,

when ever we need to set classpath or need to add(give reference) any jar files to our project we need to go Windows-->Preference > Java> ClassPath .

here we can add new jar files to our project using new. i think it helps u lot.

Former Member
0 Kudos

Hi,

1. Right click on the project and click the <b><u>properties</u></b> tab.

2. In that click on the <b><u>java build path</u></b> option.

3. Click on the <u><b>libraries</b></u> tab wherein you can find <b>Add External Jars</b> option.

regards,

Mahesh K.