cancel
Showing results for 
Search instead for 
Did you mean: 

using external library DC

Former Member
0 Kudos

Hi,

i have created an external library DC for an external jar i want to use in another DC. I have added the external library DC to my other DC. But compiling failed, due to resloe problem on missing classes from the jar.

I have created public parts for the external library DC, one for compilation and another for assembly. Maybe there is something wrong within my Studio. I have read in another thread, that one of those public parts should be created automatically!? Also i can not see the external library DC in the Java DC Exlporer nor in the J2ee DC Explorer. I can only edit public parts within the development component perspective!

I am using SP12!

Thanx in advance

Christian

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

External Library DCs do indeed not show up in the explorers you mentioned. Use the Package explorer instead, that's where they do show up and where you can add your jars to the libraries folder and add them to the public parts (make sure you have one for assembly and one for compilation).

Then in the other DC, define the External Libs DC as a Used DC and also make sure that you have two public parts. When that's in place add the public parts of the External Libs DC to the <b>Entity References</b> of the public parts of the using DC.

Former Member
0 Kudos

Hi Pascal, Rahul

i tried your solution Pascal (thanx), but unfortunately i only receive compile errors. I also played around a little with the options design, build, deploy runtime, but nothing changes. Did you set a reference to your library JAR anywhere else?

I have created to public parts for my Java DC api / lib and added the public parts of External Libs DC as Entity references.

Any suggestions?

Christian

p.s.: Rahul, I would like to use the external library DC, but if this isn´t successful i will try your solution. Thank you anyway!

Former Member
0 Kudos

If you look at the DC that uses the External Libs DC from the Package Explorer, the included jars should be displayed in the tree and you should be able to expand them, showing you the classes that are inside.

Is this the case?

You shouldn't need to put references to the jars anywhere else.

Former Member
0 Kudos

Hi Pascal,

you are right, i can not see the library from the external Lib DC!

Does this lead you to a configuration failure in the External Libs DC?

Best regards

Christian

Former Member
0 Kudos

There must be something wrong in the definition of the DC Usage. Check that the libraries are listed in the Entity lists of the public parts of the External Libs DC. If so, try deleting and readding the DC from the Used DCs list of the using DC and readd the Entity References.

Former Member
0 Kudos

Hi Pascal,

i have checked the External Libs DC Public Part Entities. The library is listed there. One public part is for compilation, the other for assembly.

i readded the External Libs DC to the Java DC as Used DC with options design, build, deploy, runtime and readded the Entity references in the public parts after having removed everything.

I am sorry only having bad news for you, but i can´t compile anyway!

Former Member
0 Kudos

Can you give more information: the error that you get, the names of the DCs involved, etc?

Former Member
0 Kudos

Here is the error message after building ...

21.07.2005 13:51:19 /userOut/Development Component (com.sap.ide.eclipse.component.provider.listener.DevConfListener) [Thread[ModalContext,5,main]] ERROR: xml: Build failed for rwe/xml(MyComponents) in variant "default":

The Build terminated with errors

-


Build log -


Development Component Build (2005-07-21 13:51:18)

Component name: xml

Component vendor: rwe

SC compartment: MyComponents

Configuration: LocalDevelopment

Location: local

Source code location: cmuelder@webfed09

DC root folder: C:\Dokumente und Einstellungen\cmuelder\.dtc\LocalDevelopment\DCs\rwe\xml\_comp\

DC type: Java

Host: webfed09

DC Model check:

[dcmake] All used DCs are available locally

[dcmake] validating dependency to build plugin "sap.com/tc/bi/bp/javaLib"

[dcmake] validating dependency to used DC "rwe/dom4j"

[dcmake] validating entity reference from public part "api" to entity "dom4j-full.jar" of public part "api" of DC "rwe/dom4j"

[dcmake] validating entity reference from public part "lib" to entity "dom4j-full.jar" of public part "lib" of DC "rwe/dom4j"

[dcmake] DC model check OK

Start build plugin:

[dcmake] using build plugin: sap.com/tc/bi/bp/javaLib

[dcmake] starting build plugin from : E:\Apps\SAP\NWDS\eclipse\plugins\com.sap.tc.ap\comp\SAP_BUILDT\DCs\sap.com\tc\bi\bp\javaLib\_comp\gen\default\public\saplib\

Build plugin JavaPlugin

Building development component 'xml', vendor 'rwe', type 'Java'

software component 'MyComponents', vendor 'sap.com'.

location 'local'.

source code location 'cmuelder@webfed09'.

Starting build (wrapped)

Creating Ant build file..

Using velocity macro file: E:\Apps\SAP\NWDS\eclipse\plugins\com.sap.tc.ap\comp\SAP_BUILDT\DCs\sap.com\tc\bi\bp\javaLib\_comp\gen\default\public\saplib\macros\build.vm

Creating Ant build file C:\Dokumente und Einstellungen\cmuelder\.dtc\LocalDevelopment\DCs\rwe\xml\_comp\gen\default\logs\build.xml

Ant build file created in 0.331 seconds

Starting Ant with build file C:\Dokumente und Einstellungen\cmuelder\.dtc\LocalDevelopment\DCs\rwe\xml\_comp\gen\default\logs\build.xml, target build

Using temporary directory C:\Dokumente und Einstellungen\cmuelder\.dtc\LocalDevelopment\t\48E339D9449E007745912FF67A96E3CF

Ant build started at 2005-07-21 13:51:18 GMT+01:00 (CET)

prepare:

[mkdir] Created dir: C:\Dokumente und Einstellungen\cmuelder\.dtc\LocalDevelopment\DCs\rwe\xml\_comp\gen\default\deploy

compile:

[mkdir] Created dir: C:\Dokumente und Einstellungen\cmuelder\.dtc\LocalDevelopment\t\48E339D9449E007745912FF67A96E3CF\classes

[javac] Compiling 4 source files to C:\Dokumente und Einstellungen\cmuelder\.dtc\LocalDevelopment\t\48E339D9449E007745912FF67A96E3CF\classes

C:\Dokumente und Einstellungen\cmuelder\.dtc\LocalDevelopment\DCs\rwe\xml\_comp\src\packages\com\rwe\kmonitoring\listener\xml\XMLHandler.java:12: package org.dom4j does not exist

import org.dom4j.Document;

^

...

C:\Dokumente und Einstellungen\cmuelder\.dtc\LocalDevelopment\DCs\rwe\xml\_comp\src\packages\com\rwe\kmonitoring\listener\xml\XMLHandler.java:93: cannot resolve symbol

symbol : class Element

location: class com.rwe.kmonitoring.listener.xml.XMLHandler

Element childElelement = (Element)element.elements().toArray()[l.size() -1 ];

^

26 errors

Ant build finished with ERRORS

file:C:/Dokumente und Einstellungen/cmuelder/.dtc/LocalDevelopment/DCs/rwe/xml/_comp/gen/default/logs/build.xml:29: Compile failed; see the compiler error output for details.

Ant build finished at 2005-07-21 13:51:19 GMT+01:00 (CET), Duration: 0.491 seconds

Cleaning up.

I have deleted some compilation errors to save space!

The External Library DCs name : dom4j (LocalDevelopment_rwe_dom4j);

The Java DCs name : xml (LocalDevelopment_rwekep_xml)

Former Member
0 Kudos

Since you're building a Java DC, you actually don't need Public parts for assembly (in both DCs), since the Java DC itself does not result in a deployable result anyway. Also the Entity References are not necessary in this case. You can also remove both public parts from the using DC. Having only a public part for compilation, containing dom4j-full.jar, in the External Library DC must be sufficient.

You can try one last thing: Select the using DC, rightclick it and select Sync Used DCs.

PS. Note 833415 says that from SP12 public parts must be created manually for External Lib DCs as for all other DCs.

Former Member
0 Kudos

Hi Pascal,

i don´t get your last point. The Java DC does not result in a deployable item! From this Java DC i want to build a J2ee Library DC to use my code in another DC (maybe WebDynpro). So at the end it will be deployed! I thought i would need some kind of configuration for runtime also. Otherwise how will my Java DC code get its needed library.

I will try your hint tomorrow, becasue i am not at my pc anymore!

Former Member
0 Kudos

As the documentation says a Java DC does not results in a deployable item. This means that it does not generate an SDA. Instead, if you want to use classes from this Java DC in other DCs, you must add these to both public parts, so they will be available during compilation and to make sure that the jar for your Java DC gets package in the SDA of the DC that uses it.

I did some investigation on NWDS SP12 myself as well:

- I created an external library dc

- Created a public part for compilation

- Added a jar to the libraries folder

- Added the jar to the public part for compilation

- Created a Java DC

- Added the External Lib DC as Used DC

- Checked the Package Explorer: the jar is not showing up

- Build the External Lib DC: the jar is showing up in the Package Explorer

Did you build the External Library DC?

Former Member
0 Kudos

Hi Pascal,

thanx for your perserving support on this!

I have tried the "sync used dcs" but without any effect.

And i also created a new external library dc and a new java dc as you did investigating, but for me it stays the same. i can not see the jar in the package explorer even though i rebuilded the external library dc.

Former Member
0 Kudos

Then I can only suggest you reinstall NWDS, since it's working fine over here...

Former Member
0 Kudos

Hi Pascal,

yes i think i will do that as soon as i have finished my project. Thanks again for your help!

Former Member
0 Kudos

Good luck!

Former Member
0 Kudos

Hey Christian, any news?

Former Member
0 Kudos

folks, thank you for this thread, it helped me indeed.

Answers (1)

Answers (1)

guru_subramanianb
Active Contributor
0 Kudos
Former Member
0 Kudos

Hi Guru,

thank you for your fast answer! I have read the document behind the link and i think i have done things as they said. But my external library DC can not help to compile my other Java DC.

Any further hints?

Best regards,

Christian