cancel
Showing results for 
Search instead for 
Did you mean: 

external library DC vs J2EE Server Component - Library DC

Former Member
0 Kudos

Hi all,

I have been developing where I used jars through the public part of an external library DC and it worked fine, but I'm wondering:

What is actually the difference between a external library DC and a J2EE Server Component - Library DC ?

When do i use the external library DC and when do i use the J2EE library DC?

Kind regards,

J.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Joren,

an "External Library" is just a wrapper for some Jars (i.e. plain Java)

A "J2EE Server Component Library" creates a deployable wrapper to have some Jars available at runtime on the J2EE server.

E.g. you could use an external library to wrap some Jar file from another vendor, use a Java DC to write Java code that uses that library and then assemble both into a single J2EE Server Library to have that functionality available within your runtime environment.

Regards,

Marc

Former Member
0 Kudos

Hello Mark,

thx for your reply.

But if i wrap some jars in an external library, it's also possible to refer to those jars in a web dynpro dc for example...so i have the functionality from the jars available at runtime (assembly public part in extrenal library DC) because i can run my web dynpro's without errors....

Am i missing something here?

Kind regards,

Joren

Former Member
0 Kudos

Hello Joren,

are you assembling the jar from the external library directly into the web dynpro application? (Or does the jar from the external library exist already on the engine somehow?)

That is also possible if you need the Jar file only once. If you have multiple web dynpro dcs it might be more efficient to pack the Jar into an external library, wrap that into a J2EE server library and then just reference the J2EE library from the webdynpro. The difference is simply how often the same jar exists at runtime (loaded by potentially different classloaders).

Regards,

Marc

Former Member
0 Kudos

Hello Mark,

I tried what you said in the following scenario:

I created Proxy classes for Enterprise Connector for a BAPI from a backend system.

Those classes where put in a jar. That jar is put in a external library DC with an assembly public part and a compilation public part.

From that i tried two method:

Method 1: i referenced the public parts (assembly and compilation) from external library DC in my web dynpro DC and it worked fine.

Method 2: I referenced the public parts (assembly and compilation) in a J2EE library DC ( for compilation: build time ; for assembly: build time and runtime with strong). In my Web Dynpro DC i referenced the compilation public part from my external library. And in the properties of my web dynpro project i added the reference to my j2ee library (that was also deployed; i can see it in my visual administrator). When running my application, i get the following error:

<i>java.lang.NoClassDefFoundError: com/sap/aii/proxy/framework/core/AbstractProxy -


Loader Info -


ClassLoader name: [gtsc.jnj.com/testapptestwdp] 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:tcsecssl 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: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/tcwddispwda sap.com/cafeugpapiwd sap.com/tcwdcorecomp service:webdynpro service:sld library:tcddicddicservices library:com.sap.aii.proxy.framework library:tcgraphicsigs library:tcwdwslib library:com.sap.mw.jco library:com.sap.lcr.api.cimclient library:sapxmltoolkit library:com.sap.aii.util.rb library:cafeugpapi library:com.sap.util.monitor.jarm library:tcddicddicruntime library:com.sap.aii.util.xml library:gtsc.jnj.comjcrauweltestr3proxieslibrary library:com.sap.aii.util.misc library:tccmi Resources: C:\usr\sap\NDW\JC01\j2ee\cluster\server0\apps\gtsc.jnj.com\testapptestwdp\src.zip C:\usr\sap\NDW\JC01\j2ee\cluster\server0\apps\gtsc.jnj.com\testapptestwdp\webdynpro\public\lib\commons-collections-2.1.1.jar C:\usr\sap\NDW\JC01\j2ee\cluster\server0\apps\gtsc.jnj.com\testapptestwdp\webdynpro\public\lib\cglib-2.1.3.jar C:\usr\sap\NDW\JC01\j2ee\cluster\server0\apps\gtsc.jnj.com\testapptestwdp\webdynpro\public\lib\asm-attrs.jar C:\usr\sap\NDW\JC01\j2ee\cluster\server0\apps\gtsc.jnj.com\testapptestwdp\webdynpro\public\lib\gtsc.jnj.comtestapptestwdp.jar C:\usr\sap\NDW\JC01\j2ee\cluster\server0\apps\gtsc.jnj.com\testapptestwdp\webdynpro\public\lib\dom4j-1.6.1.jar C:\usr\sap\NDW\JC01\j2ee\cluster\server0\apps\gtsc.jnj.com\testapptestwdp\webdynpro\public\lib\hibernate3.jar C:\usr\sap\NDW\JC01\j2ee\cluster\server0\apps\gtsc.jnj.com\testapptestwdp\webdynpro\public\lib\commons-logging-1.0.4.jar C:\usr\sap\NDW\JC01\j2ee\cluster\server0\apps\gtsc.jnj.com\testapptestwdp\webdynpro\public\lib\asm.jar Loading model: {parent,references,local} -


The error occurred while trying to load "com.jnj.gtsc.im.jcrauwel.proxies.MyR3Proxies_PortType".</i>

Any idea what i'm doing wrong?

Kind regards,

J.

Former Member
0 Kudos

Hello Joren,

minor note: to assemble the external library into the J2EE library you only need a build-time dependency on the assembly public part (At runtime the Jar will be part of the J2EE Library so no need for a reference and if you don't have Java sources in the J2EE library there's also no point in the dependency on the compilation public part). This will not solve the NoClassDefFoundError, though.

I suspect that you are missing a runtime reference from your J2EE Library DC to whatever provides the AbstractProxy class (I'd guess "com.sap.aii.proxy.framework" in JTECHS) and that WebDynpro components by default have that dependency.

Regards,

Marc

Former Member
0 Kudos

Hi,

The jar i am trying contains proxies (java classes) for a bapi in my R3 backend. So i guess i do need to set build time dependency for the compilation lib? Or do i only have to set build time dependency when i reference to it in my web dynpro dc?

About the classloader error. On help.sap.com it says that i need an mdi jar, and that jar is contained in the dc sap.com.mdi. However, when i watn to reference that DC, i get the message:

Illegal dependency: Access list does not allow use of sap.com/com.sap.mdi for my dc.

Kind regards,

Joren

Former Member
0 Kudos

Hi,

sometimes I wonder if Joseph Heller ever worked at SAP...

Open a CSS message, I've heard before that ACLs on DCs were too restrictive and that they were corrected after being reported.

Regards,

Marc

Former Member
0 Kudos

Hi,

I'm not really following on the Joseph Heller part

About the ACL, in my NWDS i can see that acl on the DC i need is set to be used by vendor sap.com and test.sap.com only...

I dont know if they still want this restriction or not and i dont know if it will solve my runtime error either...

Kind regards,

J.

Former Member
0 Kudos

Hi,

ah, so you've never read (or watched) "Catch 22" ?

I've seen that ACL on SP09, but it did not exist in SP07. I suspect that SAP simply introduced those ACLs and went a bit too far on some DCs.

You could try locally to just remove the ACL from the .dcdef file of com.sap.mdi, build your DC locally and then deploy it. If that works I'd ask SAP why the ACL was introduced if their own documentation says that you should use the Jar included in that DC.

Regards,

Marc

Former Member
0 Kudos

Hi,

Nope, never read ( or watched) "Catch 22"/

Thx for the information on the DC and acl.

Kind regards,

J.

Answers (0)