on 07-04-2012 2:44 PM
Hello,
I have a question concerning heavy resources in NetWeaver 7.3.
We want to use classes form the jersey lib in a portalapp on NetWeaver 7.3. When we reference it in the normal way, we get an exception with following cause:
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl.
This class resides in jersey-bundle-1.0.3.1.jar. We already figured out that this problem is due to the class loading mechanism of the NetWeaver Java Engine as explained in this document: http://scn.sap.com/docs/DOC-1349
We also created a new application (SAP EAR Java EE 5 Project) corresponding to this document and added our lib. Then we referenced to it from the
application-j2ee-engine.xml and SAP_MANIFEST.MF of the original application:
--------- START application-j2ee-engine.xml ---------
<?xml version="1.0" encoding="UTF-8"?>
<application-j2ee-engine xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="application-j2ee-engine.xsd">
<reference reference-type="hard" prepend="true">
<reference-target
target-type="application" provider-name="sap.com">de.hlp.pct.test</reference-target>
</reference>
<provider-name>sap.com</provider-name>
<fail-over-enable
mode="disable"
xsi:type="fail-over-enableType_disable"/>
<start-up mode="always"/>
</application-j2ee-engine>
--------- END application-j2ee-engine.xml ---------
--------- START SAP_MANIFEST.MF ---------
...
dependencies: <dependency Implementation-Title="de.hlp.pct.test" Implementation-Vendor-Id="sap.com" />
dependencylist: <dependency keyname="de.hlp.pct.test" keyvendor="sap.com" />
...
--------- END SAP_MANIFEST.MF ---------
The application which contains the jersey jar has the following structure:
EarContent
lib
jersey-bundle-1.0.3.1.jar
META-INF
application-j2ee-engine.xml
application-service.xml
application.xml
These descriptor files have the following content:
--------- START application-j2ee-engine.xml ---------
<?xml version="1.0" encoding="UTF-8"?>
<application-j2ee-engine xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="application-j2ee-engine.xsd">
</application-j2ee-engine>
--------- END application-j2ee-engine.xml ---------
--------- START application-service.xml ---------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application-service SYSTEM "application-service.dtd" >
<application-service>
</application-service>
--------- END application-service.xml ---------
--------- START application.xml ---------
<?xml version="1.0" encoding="ASCII"?>
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" version="5">
<display-name>de.hlp.pct.test</display-name>
<library-directory>lib</library-directory>
</application>
--------- END application.xml ---------
When I now create an EAR in Developer Studio 7.3 via context menu "export > SAP EAR File" and deploy it to the Server, I can find it with the nwa "Java Class Loader Viewer".
Here there are this two entries:
Compoonent Name Loader Name
sap.com/de.hlp.pct.test sap.com/de.hlp.pct.test
sap.com/de.hlp.pct.test sap.com/de.hlp.pct.test-library-loader
But still we get the above mentioned exception.
Is there maybe a descriptor file missing in the META-INF folder? Are the descriptor files ok like we have them, or does somebody maybe see a mistake?
I would appreciate any hint or other aproaches for solving this issue.
Thanks and regards
Tim
i see one issue with provider-name in application-j2ee-engine.xml , in the document (attached below) it is mentioned as
com.sap instead of sap.com
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Satish,
thanks for your reply.
I think in our case sap.com is right, as I used Developer Studio to create the "Library App". I used the context menu "export > SAP EAR File" to create the ear. By creating the ear this way obviously "sap.com" is generated as vendor.
When I change it to com.sap I get an:
com.sap.engine.services.dc.api.deploy.DeployException
Unresolved dependency:
name: 'de.hlp.pct.test', vendor: 'com.sap' ( not found in the admitted batch items and the repository)
But anyway, thank again for your help.
Regards
Tim
User | Count |
---|---|
79 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
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.