cancel
Showing results for 
Search instead for 
Did you mean: 

Library Project

Former Member
0 Kudos

I am trying to create a library project so that I can inlcude all my non-SAP classes to the server once and then reference them within all my other applications. I am trying to follow the "Creating a Library Project", but when I get to adding the JARs, I get a popup that is blank and says "Select Jars to reference. Jars must be located in the workspace." I can not find any reference to adding JARs to my workspace.

Anybody?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Nathan,

Here, you can add only jar files contained in your other project's folder. So, there is workaround for that. Add these JAR files in your any one project using Add/remove additional libraries option. This step you need to do only to add these jars in your library project. After adding jars in library project you can revert back in this folder(you can remove these jar files).

Now, goto your library project. add Jars. It will show popup to add all required jars. Now, it will show that project in which you have added those jars. choose all Jars. Build this project and deploy on the server.

regards,

Bhavik

Former Member
0 Kudos

Bhavik,

Thanks again. While your explanation was not right on, it did get me there. The "Add/Remove additional Libraries" was not were I needed to go initially. It was "Import File". I was then able to see the jars in my "provider.xml" on my Java Server Component --> Library.

So just for posterity sake here is a step by step.

1. Create a “Web Module Project” call it “MainLib”

2. Within the project “MainLib” Right Click -> Import File

3. Pick directory with JAR you want using browse.

4. Check mark the JAR you want to add (repeat if necessary)

5. Create new J2EE Server Component -> Library Call it “AddtlLib”

6. Within Library Open "server/provider.xml"

7. Click on Jars tab at bottom

8. Highlight Jar and click Add.

9. Expand “MainLib” until you find JAR reference and check it.

10. Build and deploy MainLib.

11. Create “Web Module Project” call it “WebStuff”

12. Right Click “WebStuff” and choose “Add/Remove Additional Libraries”

13. Expand “Library Projects” until you see “AddtlLib” and check mark. (Note: it will mention something about the ear. Just follow below.)

14. Create new “EJB Project” call it “WebStuffProj” and reference “WebStuff” as the project.

15. Within “WebStufProj” open the “application-j2ee-engine.zml”

16. In the general tab highlight “References” and click add.

17. Click the “Select library/interface/service” button.

18. Expand Library Projects until you see “AddtlLib”

19. Check mark and click “OK” button

20. Make sure the “Reference Type” is hard. If that library is not there, you application is going to crash anyway.

21. Build and Deploy EAR.

Former Member
0 Kudos

Hi Nathan,

You gave nice explanation of each step. It will very helpful to others. Thank you very much to you also for giving nice explanation and points.

Regards,

Bhavik

Former Member
0 Kudos

Thanks Nathan, your Step-by-Step instructions were very helpful.

I agree with you that it could have been made very simple, only if SAP wanted.

Thanks Bhavik for the work-around. I'm not sure if this is a bug or expected behavior. Anyways, SAP help should mention that you can add only JAR files that have been imported in to your other Web Module or EJB Module Project.

thx

praveen

Answers (2)

Answers (2)

Former Member
0 Kudos

Let me add this, just in case somebody from SAP is reading.

Why not just add an "Import External JAR" in a J2EE Server Component -> Library?

Former Member
0 Kudos

Nathan,

Probably my weblog will be helpfull for you:

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

VS

Former Member
0 Kudos

Valery,

While your weblog was condescending, it looked promising. However, it did not resolve my problem. I normally scour the help that SAP provides, and always it is lacking. (But enough of my defense)

I am not using a Dynpro project, not sure if that matters, but when I tried to follow your steps in the weblog I was not able to create an ¡§External Library¡¨ in my ¡§Local DCs „³ My Components¡¨, because it was not in the list. My list looked similar to yours, but below ¡§Enterprise Portal¡¨ it jumped directly to ¡§J2EE¡¨. I noticed that your weblog was relatively new, but maybe we have different versions of the DS, so I looked through all the other choices and only found ¡§J2EE Component „³ Library¡¨. I noticed that is what you used for the second part, so I don¡¦t know what I am supposed to do now.

Your thoughts?