cancel
Showing results for 
Search instead for 
Did you mean: 

Addition of new external jar to Webdynpro

Former Member
0 Kudos

Hi,

If i need to use an external jar file in a Webdynpro application and i add the same thro the application > properties> java settings , the same addition is missing the next time i compile the project.

So every time i do a compile i have to add the jar.

Moreover, sometime when the build time is very long like 5 minutes, the external jar goes missing halfway thro the compilation and gives me a build error that the file is missing.

Is there some work around for this?

Regards,

Balaji

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hey,

this was kinda tough! We were trying for ages to add the Oracle database driver classes12.jar to a Web Dynpro-DC and finally - with your suggestions - it worked!

We did the following:

1. We extracted the jar file into src / packages

I didnt try it with an extra DC that wraps the jar, maybe at a later stage. I'm so glad it works now...

The problems was that we're on SP09 which means there's no "External Library"-DC available, and none of the other workarounds worked (the ones you find on SDN).

Anyways, be sure to proceed as follows:

1. Development Component -> deploy

2. Web Dynpro > Applications -> Run

"Deploy new archive and run" somehow doesn't work!

Cheers!

Former Member
0 Kudos

<b>It's as easy as importing the necesary jar files to the "lib" folder of your project in the navigator window.</b>

There's no need to create additional components, or extract the jar's source files to the src/Packages foldaer.

Regards,

Homer.

Former Member
0 Kudos

How do you do that? There's not an option to import a JAR file in the Navigator is there?

Nigel

Former Member
0 Kudos

For development components, you need to declare a new Java library component that wraps the jar files. I created one for all my build time libraries. Then it will work properly.

Former Member
0 Kudos

How do you add the jar file to the Java Library component? I only see one XML file with no options for adding. Also, when you add the jar file to this project does it automatically add the jar to the DTR? After you add it to the java library DC, then do you create PP's to both use during compilation and deployment?

Thanks,

Dustin

Former Member
0 Kudos

There is a tab that says external jar files in the java library projects. But this only appears when you are building a non-DTR local project, IIRC.

This might have changed for the later service packs, where you might be able to add external jars in some magical way.

For our development in stack 3, however, our solution was to unpack entire jar file(s) into a folder using winRar. We then create a development component around this folder, making one public part for all the jars contained in this folder ( using the folder tree option). This set of includes can be made more granular.

When the development component gets compiled, it will generate a jar file that is identical to the external jar file's original format. You can then check in this whole beast into the DTR. The advantage of this approach is that you can decide if you want to put your jar files as another web dynpro component, or include them into your ear files.

Former Member
0 Kudos

Hi,

I'm glad to find an answer of my problemns in the SDN. But I'm an WebDynpro-Newbie. Could you please send me an example for the solution. I tried to implementan 2 jar files. But it doesn't work. I've no idea any more.

Could you pleas help me.

Thy a lot

Sascha Buhmann

Former Member
0 Kudos

Hi Sascha

1. Create a new development component.

2. Extract the Jars in to src/Packages folder of your component.

3. Expose these folders as public part.

Use this DC in other DC's where you need these jars.

Kishore

Former Member
0 Kudos

Thank you very match NagaKishore,

step by step to success

I could code my syntax in my web-dynpro-component without syntax errors, but when I'm going to deploy and start my application, I got this error:

com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Failed to create delegate for view net.stauff.ActivitiesView. (Hint: Is the corresponding DC deployed correctly? Does the DC contain the component?)

at com.sap.tc.webdynpro.progmodel.generation.ControllerHelper.createDelegate(ControllerHelper.java:110)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.<init>(DelegatingView.java:41)

at com.sap.tc.webdynpro.progmodel.view.ViewManager.createUninitializedView(ViewManager.java:487)

at com.sap.tc.webdynpro.progmodel.view.ViewManager.getView(ViewManager.java:524)

at com.sap.tc.webdynpro.progmodel.view.ViewManager.bindRoot(ViewManager.java:422)

at com.sap.tc.webdynpro.progmodel.view.ViewManager.init(ViewManager.java:130)

at com.sap.tc.webdynpro.progmodel.view.InterfaceView.initController(InterfaceView.java:41)

...

What is wrong with my component ?

thx a lot.

greetings

sascha

Former Member
0 Kudos

How did you deploy the DCs?

Armin

Former Member
0 Kudos

wow, das ging schnell !!

I deployed the Application with "right mous click" on my App. --> then "Deploy New Archive and Run"

thy a lot

Sascha

Former Member
0 Kudos

Try this: Use the context menu DC->deploy to deploy both DCs and then use "Run" to start the application.

Armin

Former Member
0 Kudos

My first fault was, that I wrapped the Jar's in a normal Java-Component, so I could not deploy it. ;-(

Now I put the Jars in a Web-Dynpro-Component. My Coding in the view is the same and correct, but the error I described, is the same.

Should I do something in my Application component ?

Thats the class:

Caused by: java.lang.NoClassDefFoundError: org/apache/poi/poifs/filesystem/POIFSFileSystem

thx a lot

armin

Message was edited by: Sascha Buhmann

Former Member
0 Kudos

Could you successfully deploy both DCs? In Eclipse, open the "Deploy output" view and look at the messages.

Don't use "Deploy new application and run", use only "Run".

Armin

Former Member
0 Kudos

Deployment ok!

Result

=> successfully deployed : file:/C:/DOKUME1/sbuhmann/LOKALE1/Temp/temp28376stauff.net~msoffice.ear

all Components have this result.

I used only "run".

any other ideas ?

thx.

do you know dr.stefan ehret (SAP) ?

Former Member
0 Kudos

Did you extract the jar-file into the right folder in the DC (src/packages)?

Armin

P.S. No

Former Member
0 Kudos

Yes, I think so.

I extract the jar-file in to the standard folder structure (C:\org\....). Then I imported in the component this files, with "Import/Files/..."

Result in the Package Explorer:

src/packages

org.apache.poi.ddf

org.apache.poi.dev

org.apache.poi.poifs.filesystem

...

thx a lot

Former Member
0 Kudos

And you defined the public part in DC1 such that it contains all these packages, and in DC2, you defined the usage of this public part from DC1?

Sorry for asking all these (stupid) questions.

Armin

Former Member
0 Kudos

could i write you an email ?

Former Member
0 Kudos

Ok, I just sent you a mail with my e-mail address. Makes things simpler.

Armin

Former Member
0 Kudos

Extracting external jars into a source catalog is in my opinion a nasty workaround.

I usually do the following:

1) Put the jar file in the lib folder inside the WebDynpro project

2) Add the jar to the project classpath by right clicking on the project and choose Properties/Java Build Path/Libraries/Add JARs

This makes the classes inside the jar available at compile time as well as runtime.

Former Member
0 Kudos

Hi Armin!

I read the post and this is exactly the problem I am having. Can you please send me the solution for this problem as well?

Thank you in advance!

Best regards, Peter

Former Member
0 Kudos

All of you with NWDS sp11, should look at SNote 833415.

Best regards, Peter

Former Member
0 Kudos

Hi Brian,

The solution that you sugested unfortunatly works only for Webdynpro projects not for Webdynpro DCs.

In case of DC projects, if you unpack the .ear file you will see that the .jar file is not inside.

Former Member
0 Kudos

And this problem does not occur as long as i use the Rebuild project.

But when i use DC Build then it resets/removes the external jars that have been added.

Regards,

Balaji