cancel
Showing results for 
Search instead for 
Did you mean: 

Heavy Resources with jersey in NetWeaver 7.3

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

satishra
Product and Topic Expert
Product and Topic Expert
0 Kudos

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

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60642a88-95fe-2b10-d387-a245d48fc...

Former Member
0 Kudos

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