How to add reference to SAP provided JARs in PDK, Web Dynpro JAVA on NWDS 7.3
It’s never too late:
As the famous quote goes, I am starting off with the same belief. I have been a member of SCN Community for close to 8 years!!! And this is going to be my First BLOG. I can’t believe all this time I have been so much of an ACTIVE Listener & Passive Contributor on SCN. Though I used to contribute to the Portal, WDJ forums but it was minimal – partially because of my inertia and partly because of time constraint.
The day the new SCN was launched few months back, it instantly caught my eye and I immediately started exploring the new features and all. I got lot of bumpy roads and issues even reported some of the issues to SCN Support (scn.sap.com/thread/3143114). I felt I could help improving the SCN even though it’s very small by contributing/reporting actively in any way. That sort of gave me a new meaning and the zeal of Contributing to SCN.
Since then I was kind of regularly helping out people on Discussion Forums in Web Dynpro Java, KM, Portal, BPM etc etc and now here I am writing off my very first blog on SCN, hope it will be a smooth ride and will be accepted by the community. I am thrilled and apprehensive at the same time about writing this stuff on SCN.
There is always THE First Time.
This blog shows how to reference external JAR files (provided by SAP) in WDJ/PDK project developed in NWDS 7.3 platform. Off late I have been seen lot of queries regarding moving the Portal PDK, WD Java Custom applications to the new Portal 7.3 Platforms. Lot of issues regarding porting the applications to the new server, JAR files are not referenced, Class Not found exceptions, API not compatible issue and all.
There are few excellent blogs already written on how to get started on 7.3 Development by @Kumar Prashant, my blog just complements it by showing the details steps on how to add the dependency for SAP JARs.
Though, you can always reference external JAR files provided by SAP (e.g. com.sap.security.api.jar, ) by putting them in the LIB folder of your project source files (probably you have done that way in 7.0). However, this is not an optimal solution and more so when SAP provides all these JAR in the form of DC Public Parts. So all you need to do is just add the Public Part reference for these Jar files, and you are good to go for the development.
This is how you can add the dependencies to the JARs.
Open up the DC project,
It looks to have reference issue with UME API which is available in com.sap.security.api.JAR file. I can get the Jar file from Server add it in the LIB folder, and fix the issue. This may not be possible always since lot of APIs have changed or removed in 7.3 platforms. So a better way would be to look for if SAP DC is available.
Go to Development Infrastructure Perspective and Component Browser
Ths This will list down your local SCAs and also the default ones provided by SAP. These SCA contain the indivisual DCs, JARs which required for different kind of Developments e.g. Portal, WDJ, BPM, Security, AII, KM, GP, at all.
Right Click on your custom DC and hit Component Properties
Click on the Dependencies Tab on top, and click Add
This is THE place to find all your JARs, DCs and dependencies. For my case, I need to look for com.sap.security.api.jar
I know the above required JAR file is contained in the following DC – tc/je/usermanagement/api
Click Finish and then OK on the next Pop-up
That’s all, you are done. Now go back to your custom DC perspective to see it you really can refer the com.sap.security.api JAR. Hit CTRL+SPACE, and I can refer to the required Classes indeed.
Use the SAP DCs where ever possible for JAR reference, makes life easier. Only when there are Non SAP JARs (POI, JXL) , you can go for a LIB folder approach or a custom Library DC approach.
I hope you liked reading it and it will be useful to you. Any comments & suggestions on the technology topic or my blogging style are accepted.
I aim to become an ACTIVE Contributor, Try contributing as much I can to the community which has done so many Positive Things to my Professional Career over the last 8.5+ years.
Cheers to SCN!!! Long Live….