on 03-09-2012 4:06 PM
I'm using SAP NetWeaver Developer Studio Version: 7.01.06 Build id: 201001061835
I need to make an External Library with some JARs inside. I've made an External Library component and I've created Assembly and Compilation public parts. After A LOT of attempts to make things work, I've resorted to using a custom build script to copy the JAR in the public part output folders. I've added the Compilation public part dependency in my Web Dynpro's Used DC list.
The Web Dynpro builds without errors.
Now the problem is that when I run the Web Dynpro application it gives me a ClassNotFound Error.
I've followed the instructions of many different guides and no one worked. I've found thousands of different procedures all to make the same thing and all of them differed in crucial parts. I'm stuck here with no ideas on how to make this **** IDE to work.
I've tried to create an J2EE Server Component Library to which I've added the Assembly public part of the External Library but the GEN folder of the public part directory of J2EE SCL is empty! I have NO application*.xml files inside the J2EE SCL to edit.
If you're reading this and you're kind enough to help me, thank you.
Remember I have version 7.01.06.
Thank you again,
Pietro
Hi
Just out of curiosity, is your project of type DC?
If it is DC allow me to quote Mr Walter Kahn
:
The solution using DC's is very simple.
As a first step, undo all the stuff you have done up to now in this thread, including removing any build-time references, and deleting anything you entered in the application-xml files. When you are back to a "clean" Web Dynpro DC, do the following:
Step 1: Create an External Library Development Component
1.1) Switch to Development Infrastructure perspective.
1.2) Create a new dc of type External Library (eg. mycompany.com/downloadexcel/lib)
1.3) Switch to the Resource perspective when prompted and copy your JAR's to the libraries folder of the project.
1.4) View the Component Properties (Window -> Show View -> Component Properties)
1.5) Click the tab "Public Parts".
1.6) Add two public parts, one for COMPILATION and one for ASSEMBLY. Give them names likeexport_excel_comp and export_excel_asbly
1.7) Right-click each public part, then click Manage Entities -> Archive and select all the JAR's presented for selection.
1.8) Click the Permissions tab, and check Entity Forwarding Allowed.
Step 2: Create an Enterprise Application Development Component
2.1) Switch to Development Infrastructure perspective.2.
2.2) Create a new dc of type J2EE -> Enterprise Application (eg.mycompany.com/downloadexcel/ear)
2.3) Switch to the JavaEE perspective when prompted.
2.4) View the Component Properties (Window -> Show View -> Component Properties)
2.5) Click the Dependencies tab, and add a dependency to the DC created in Step 1. Do not change any of the default options.
2.6) Click the Permissions tab, and check Entity Forwarding Allowed.
2.7) Click the Public Parts tab and create a new Public Part of type COMPILATION. Give it a name, eg. pp_export_excel
2.8) Right-click this public part, choose Reference Entities and select the COMPILATION public part defined in step 1.6 above.
2.9) Right-click this dc, and do Development Component -> Build.
Step 3: Using the External Library in Your Web Dynpro Application
3.1) Switch to Web Dynpro perspetive.
3.2) View the Component Properties (Window -> Show View -> Component Properties)
3.3) Highlight your Web Dypro dc, and then in the Component Properties window select theDependencies tab.
3.4) Add a dependency to the dc created in Step 2. Accept all default options.
3.5) Build and deploy the Web Dynpro dc. If you have not changed any of the default options along the way, you will notice that the EAR of Step 2 also gets deployed.
Your Web Dypro dc should now compile correctly and also run on the server as expected.
Quoted from here.
You may also refer to my blog where I use external jars ....
regards
Yuval
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pietro,
I guess you have not followed this blog [http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/4512] [original link is broken];.
The Compilation PP is for build time and the Assembly PP are used during run time.
So add the Assembly PP also to your Web Dynpro DC and also have a look into the blog i have given, as you need to use ONLY DC Builds to create the deployable archive if you work with assembly public parts.
Regards,
Vishweshwara P.K.M.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vishweshwara,
I've followed that blog too and it does not work.
Problem #1:
When I build the External Library the Public parts folder (Assembly and Compilation) contains a single "container" JAR file that includes inside all the JARs that I've put in the LIBRARY folder.
The Web Dynpro DOESN'T SEE the JARs inside the container JAR. The build terminates with errors.
Workaround: Custom build script that copies the single JARs inside the Public Part Folders.
Effect: The Web Dynpro see the single JARs and it builds without error.
<--- That's why the procedures you and John suggested me doesn't work in the first place. Is this a bug of my particular version of NWDS?
Problem #2:
I don't know how to "deploy the JARs" to the server in order to avoid the ClassNotFoundError.
My Web Dynpro is setup as follows:
- Compilation Public Part dependency (Build, Deploy)
- Assembly Public Part dependency (Deploy, Runtime)
Thank you,
Pietro
Hi Pietro,
I am not sure about your first problem, as i have not tried it. Below is the answer to your second problem
1. You need not explicitly deploy the external library DC. Just build the external library DC by choosing Development Component --> Build after you are done with creation of public parts and adding JARs to them.
2. Add both the External Library public parts to the WD DC as used DCs. Care must be taken to ensure that only the Build Time dependency is established, because one need not manipulate the dependency types as we already have two pulic parts: one each for Runtime and Build Time.
3. Now build your WD DC by choosing Development Component' --> Build, and perform the DC Deploy by choosing Development Component --> Deploy, this will make sure that your external library is also archived along with WD DC and is deployed into the server. Then simply Run the WD application by choosing Run from the context menu of the WD application.
Please make sure you are not using Deploy new archive and run option to deploy your WD DC.
Regards,
Vishweshwara P.K.M.
Hi Vishweshwara,
I've followed your instructions but I still get the ClassNotFound exception.
I've tried opening my Web Dynpro's EAR file and I found the JARs inside the directory EARFile\WDAFile\PORTAL-INF\lib. I don't know what to do.
------------------------- Loader Info -------------------------
ClassLoader name: [bi.com/hr~massimalecontr]
Parent loader name: [Frame ClassLoader]
References:
common:service:http;service:servlet_jsp
service:ejb
common:service:iiop;service:naming;service:p4;service:ts
service:jmsconnector
library:jsse
library:servlet
common:library:IAIKSecurity;library:activation;library:mail;library:tc~sec~ssl
library:ejb20
library:j2eeca
library:jms
library:opensql
common:library:com.sap.security.api.sda;library:com.sap.security.core.sda;library:security.class;library:signature_lib;library:webservices_lib;service:adminadapter;service:basicadmin;service:com.sap.security.core.ume.service;service:configuration;service:connector;service:dbpool;service:deploy;service:jmx;service:jmx_notification;service:keystore;service:security;service:userstore
interface:resourcecontext_api
interface:webservices
interface:cross
interface:ejbserialization
sap.com/com.sap.km.application
sap.com/tc~wd~dispwda
bi.com/hr~massimalecontrmodel
sap.com/tc~wd~corecomp
service:webdynpro
service:sld
library:tc~ddic~ddicservices
library:com.sap.aii.proxy.framework
library:tc~graphics~igs
library:com.sap.mw.jco
library:com.sap.lcr.api.cimclient
library:sapxmltoolkit
library:com.sap.aii.util.rb
library:com.sap.util.monitor.jarm
library:tc~ddic~ddicruntime
library:com.sap.aii.util.xml
library:com.sap.aii.util.misc
library:tc~cmi
Resources:
/usr/sap/EPD/JC00/j2ee/cluster/server0/apps/bi.com/hr~massimalecontr/webdynpro/public/lib/bc.rf.framework_api.jar
/usr/sap/EPD/JC00/j2ee/cluster/server0/apps/bi.com/hr~massimalecontr/webdynpro/public/lib/bc.rf.global.service.notificator_api.jar
/usr/sap/EPD/JC00/j2ee/cluster/server0/apps/bi.com/hr~massimalecontr/webdynpro/public/lib/com.sap.security.api.ep5.jar
/usr/sap/EPD/JC00/j2ee/cluster/server0/apps/bi.com/hr~massimalecontr/webdynpro/public/lib/bc.util.public_api.jar
/usr/sap/EPD/JC00/j2ee/cluster/server0/apps/bi.com/hr~massimalecontr/webdynpro/public/lib/bc.sf.framework_api.jar
/usr/sap/EPD/JC00/j2ee/cluster/server0/apps/bi.com/hr~massimalecontr/webdynpro/public/lib/bc.util.private_api.jar
/usr/sap/EPD/JC00/j2ee/cluster/server0/apps/bi.com/hr~massimalecontr/webdynpro/public/lib/bi.com~hr~massimalecontr.jar
/usr/sap/EPD/JC00/j2ee/cluster/server0/apps/bi.com/hr~massimalecontr/src.zip
Thank you,
Pietro
Also you can refer to below document...
It does not use Web Dynpro Java...but it might point to problem areas.
when you create the two public part, have you added the jar into it?
you can try to add dependency to the assembly part from you web dynpro dc. it should work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John,
about your first question: yes, I've tried adding them one by one, I've tried adding the whole folder...
The problem seems to be that NWDS makes a single JAR containing the other JARs. The client WebDynpro CAN'T reference the JARs inside the "container JAR" and so the build does not work!
I don't understand your second sentence: I should try to add the Assembly public part of the External Library to my Web Dynpro? With Build and Deploy dependencies?
Please be as specific as you can be.
Thank you,
Pietro
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.