7 Replies Latest reply: Oct 4, 2006 12:29 PM by Marc Wirth RSS

Create External Library DC

Currently Being Moderated

Hi,

I'm fairly new at this.

From what I can understand, I need to create an external library DC to make my third party jar files visible to my other DCs.  However, I can not find a way to create an external library DC.  It's not the list of DC type in the new project wizard page.  Where or How I can create this type of DCs or how can I make my external jars visible to my DCs.

I'm using NY NWDS with the following info (I believe it's the AP6 WS27):

Version: 7.1.0

Build id: 200606282258.

 

Thanks for your help,

Linh

  • Re: Create External Library DC
    Ayyapparaj KV
    Currently Being Moderated

    Hi,

     

    You have to add them to the NWDI as external Library DCs

    create one of these

    add the jars to the DC's lib directory

    once added, right click on the Jars and select Development Component > "Add To Public Part".

    Create an API type public part.

    Now you can reference this DC's public part from your java project.

     

    Hope this helps!

     

    Regards

    Ayyapparaj

    • Re: Create External Library DC
      Navneet Nair
      Currently Being Moderated

      hey there,

      Think im already late for this... but it may be useful to someone who reads this forum later.

       

      I am struggling with exactly the same problem for the past more than 24

      odd hours now. The sad part - Im sure I have seen this being done in a

      matter of a few minutes when my team mate had an older version on NWDS.

      (I am currently using SP16 NWDS). May be this indeed is a bug that SAP

      needs to fix in its SP16 NWDS release.

       

      I need to use the HSSF POI libraries for my webdynpro components and

      have been trying ALL possible options given out here on SDN. To mention a

      few, I have tried -

      1) Jarrod's method of making a Java DC and then declaring a usage

      dependency for it inside a J2EE Server (library) DC. It didnt work... it

      gave me a warning that an illegal reference has been made to the runtime

      public part. And the final SDA file generated in the J2EE server

      component DC DIDNOT contain the jar files that I had added to the public part

      of the Java DC. On investigating further, I found that there were NO

      entities present in BOTH the public parts of the Java DC, even though the

      folder actually contained all the required .jar files.

      2) Creating an External Library DC, adding the JAR files to the

      'libraries' folder. Creating two public parts, one for assembly and the second

      for compilation. Then adding this DC as a 'Used DC' into a J2EE Server

      (library) DC. Yet, the .sda file that is created on building the J2ee

      Server (library) DC DOESNOT contain the JAR files.

      3) Creating an external library DC, adding the JAR files to the

      'libraries' folder. Creating two public parts, one for assembly and the second

      for compilation. Then adding this DC as a 'Used  DC' into a webdynpro

      DC. On building this webdynpro DC, the .ear file DOESNOT contain the JAR

      files.

      4) Directly adding the JAR files to my own webdynpro component in the

      'src/packages' folder. This didnt work because on rebuilding the

      project, the JAR files get deleted on their own.

      5) Renaming my .JAR files to .ZIP, extracting the entire package

      structure into folders, copy pasting this entire folder structure along with

      its .class files into the src/packages folder. On rebuilding, the NWDS

      deletes these folders and files on its own / behaves erratically. Also

      copy pasted these .class files along with the proper package structure

      into the '/bin' directory of my webdynpro application, but it still

      didnt work.

       

      The only thing that I have to try yet is to shift to SP10 of NWDS,

      build this external library project and get the required JAR files put on

      the wendynpro server. After that I might choose to get back onto the

      SP16 version and hopefully continue productive work... !

       

      Regards,

      Navneet.

      • Re: Create External Library DC
        Marion Schlotte
        Currently Being Moderated

        Hi,

        this issue is described in note 935334. Please install Patch2 for SPS16. It should fix the problem that the jar files are not packaged within the EAR file.

        Regards,

        Marion

        • Re: Create External Library DC
          Marc Wirth
          Currently Being Moderated

          As an alternative (and not officially supported solution!):

           

          You can use a custom build script in the external library DC to work around some of the bugs. Create a "cfg" folder in the External Library DC if it doesn't exist. Create a "build.vm" file there with the following content:

           

          #StartProject("build" "build" ".")

          #StartTarget("build")

          #foreach ($pp in $dc_public_parts)

          #MkDir("$/${pp.getName()}/lib/java") #foreach ($dir in $dc_sourceDirsAsFiles) <copy todir="$/${pp.getName()}/lib/java">

              <fileset dir="$dir">

                  <include name="*.jar"/>

              </fileset>

          </copy>

          #end

          #end

          #EndTarget()

          #EndProject()

           

          This will just copy all *.jar files from all defined source folders to all defined public parts.

           

          Regards,

          Marc

          • Re: Create External Library DC
            Achim Hauck
            Currently Being Moderated

            Marc,

             

            I've used your cfg-file,built and deployed the External Library DC. But when I use it in my "J2EE Server-Components / Library DC", the jars still aren't added to the SDA.

             

            Does that mean, nobody was ever able to create J2EE-Library DCs before the above mentioned note was published? I hardly believe that...

             

            btw I'm using NWDS 7.0.8 and the in the note mentioned DI BUILD SCA for NW04s-SP08-P1.

             

            kr, achim

            • Re: Create External Library DC
              Marc Wirth
              Currently Being Moderated

              Hi Achim,

               

              I'm not sure I understand completely what you did. The file should ONLY be used in External Library DCs, it overwrites the default build logic! If you use it in your J2EE Library DC you will not get any SDA to deploy...!?

               

              Also, the file is only a workaround - the official SAP_BUILDT should work or should get patched. As such I found it useful in the past when things did not work as they should. If there are no problems to start with there is no need to use this hack.

               

              Regards,

              Marc

  • Re: Create External Library DC
    Rasmus Stokholm
    Currently Being Moderated

    The DC is called "External Library".

     

    Have a look at the <a href="http://download.yousendit.com/B642AF69464CC506">picture</a>.

Actions