on 07-08-2009 9:21 AM
I am using SAP NetWeaver 2004s Sp 09.I have to use external jar in my project .I followed the following steps:
1.Created a External Library DC and added the jars in its libraries folder.
2.Created two public parts api and sda .
3.Exposed the jars to the public part.
4.Created a J2EE Server Component Library DC and added the sda of external library Dc to its used DC.
5.Deployed the Library.
When I was using the library in my web Dc ,I followed the following steps:
1.Added the api in my web module DC
2.Added the run-time reference of the library in my EAR
but i found an exception "ClassNotFoundException".The application was unable to find the jar at runtime.So please help me out.
Hi,
You have created two public parts right? One for sda and one for api.
you are deploying sda using J2EE Library DC.
Instead of that try deploying the sda public part as part of EJB Ear dc(Throgh which you are deploying the Web Module DC). Do this by adding this public part to J2EE Ear DC.
Regards,
Charan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
It is important to find out which class generates the ClassNotFoundException. It could well be that a class in one of the jars is using (e.g. implementing an interface) which is not available in that jar. That will also generate a ClassNotFoundException.
So have a very close look at the actual error message, or post it here.
Kind regards,
Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jayant!
I've faced with similar problem too. The only different was that I've used needed jars in WD app which produced EAR-file. Please read it to the end before try:
1) open directory of your External Library DC, go to subdirectory "def" and open assembly.pp and compile.pp with Notepad (these are just XML files)
These files should contains something like this (let's assume that we want to use jxl.jar):
Assembly.pp:
<?xml version="1.0" encoding="UTF-8"?>
<public-part
xmlns="http://xml.sap.com/2002/11/PublicPart"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xml.sap.com/2002/11/PublicPart ppdef.xsd"
version="1.0.4"
xmlns:IDX="urn:sap.com:PublicPart:1.0">
<name>assembly</name>
<purpose>assembly</purpose>
<caption></caption>
<entities>
<entity>
<name>jxl.jar</name>
<package></package>
<caption>jxl.jar</caption>
<description></description>
<entity-type>Archive</entity-type>
<entity-sub-type>Java Library</entity-sub-type>
</entity>
</entities>
</public-part>
Compile.pp:
<?xml version="1.0" encoding="UTF-8"?>
<public-part
xmlns="http://xml.sap.com/2002/11/PublicPart"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xml.sap.com/2002/11/PublicPart ppdef.xsd"
version="1.0.4"
xmlns:IDX="urn:sap.com:PublicPart:1.0">
<name>compile</name>
<purpose>compilation</purpose>
<caption></caption>
<entities>
<entity>
<name>jxl.jar</name>
<package></package>
<caption>jxl.jar</caption>
<description></description>
<entity-type>Archive</entity-type>
<entity-sub-type>Java Library</entity-sub-type>
</entity>
</entities>
</public-part>
Save these files.
2) Rebuild your External Library DC
3) Add Assembly PP of External Lib DC to your J2EE Server Component Library DC. Add it for Build time and Run time (run time qualifier is "strong")
4) build and deploy J2EE Server Component Library
5) Add both PPs of External Lib and PP of J2EE Server Component to your web DC
Hope this help.
Regards, Lev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.