cancel
Showing results for 
Search instead for 
Did you mean: 

Deploy J2EE library to the J2EE Engine failed!

Former Member
0 Kudos

I'm trying to create a J2EE Library DC that contains a few jar files that I want to deploy to the J2EE server for usage by a set of test classes.

I created an external library DC, imported a jar file into the libraries folder, and added the jar file to a public part that has selected option "provides an API for Developing/compiling". I then built the DC Successfully.

Then I created a J2EE Library DC, and added the external library DC as a used DC, with a build and run time dependancy, and I created an entity reference to the external library DC's public part.

When I build the J2EE Library DC, the jar file are not included in the SDA file. Nothing I've tried can get the jar file to be placed in the SDA file for deployment.

Why is the jar file not in the SDA? What am I doing wrong? I've spent the last while reading everything I can find on SDN about j2EE Library DCs, and it seems that I'm doing everything correctly - or am I?

I'm running 7.00 SP9 . Can someone verify that a) my procedure above is correct, and b) that this does work under 7.00 SP9 ?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Because the build result of an external library DC is a jar file (which could not deployed on the J2EE engine) you always have to create a public part of type assembly. This public part will then be packed in a deployable unit (e.g. in a J2EE Library DC which has a ear file as build result).

Some DCs have a defined public part. E.g. an EJB will always create the two public parts client and ejbjar, or in your case the J2EE library creates the public part defLib automatically.

As I find out (through long nights ) there is a bug in SP9, especially in the DI BUILD Tool, so that the pp of type assembly won't be packed in the deployable unit. Also in Dev Studio it doesn't work.

I use SP11 and every thing works as it should.

Regards,

Daniel

Former Member
0 Kudos

Hi,

Are you trying to depoy through SDM or visual admin?

SDM can recognize only SCA,SDA and ear files.

I think,you can do one thing,you can convert those jar files to ear format and deploy it through SDM or Visual admin.

You can do it this way,

Copy all those jar files into a folder .

For ex: if you have copied all those jar files into "new folder" in C:,

go to C:\newfolder in command prompt.

then run the command,

jar -cvf *

or

take each jar file and give command

jar -cvf nameofexe.exe *

then all the jar files will be converted into ear format and you can deploy through SDM or visualadmin.

reward points if helpful...........

Former Member
0 Kudos

Wang,

I noticed strange IDE behavior with respect to public libraries.

First, I where forced to create 2 public parts named <b>default</b> (purpose=compilation) and <b>ExternalLibs</b> (purpose=assembly). Only after this I get necessary "libs"generated for external library DC during build.

Then I added both public parts as Used DCs to J2EE library project. Here (and I don't remeber how it was created, manually or automatically), I get public part defLib with the following content (open defLib.pp using Java perspective and regular text editor):


<?xml version="1.0" encoding="UTF-8"?>
<public-part
  xmlns="http://xml.sap.com/2002/11/PublicPart"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://xml.sap.com/2002/11/PublicPart ppdef.xsd"
  version="1.0.2"
  xmlns:IDX="urn:sap.com:PublicPart:1.0">
  <name>defLib</name>
  <purpose>compilation</purpose>
  <caption></caption>
  <description></description>
  <entities>
    <entity>
      <name>yourcompany.com~com.yourcompany.lib</name>
      <entity-type>SERVER_COMPONENTS</entity-type>
    </entity>
  </entities>
</public-part>

Replace <entity> content with name of your J2EE Library project in same format.

After this steps build and deploy works correctly.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

P.S. NW 7.00 SP6