Tutorial 2: Step 2 – Creating a J2EE Java Library DC

The component appl/tax/calc created in step 1 is a simple Java library and can therefore not be directly deployed to the SAP NetWeaver J2EE Engine. In this step, USER 1 continues to wrap his or her library in an SAP J2EE Java Library.

Create a new DC

You started the SAP NetWeaver Developer Studio and are logged on to the development infrastructure.


       1.      In the perspective Development Configuration, switch to the Inactive DCs view.

       2.      Open the node of your development configuration Appl_dev.

       3.      Select the entry example.org_application and in the context menu, choose Create New DC.

       4.      In the Development Component Project wizard enter the following:

                            a.      Vendor: example.org 

                            b.      Name:

                                                  i.       (prefix from selection list): appl/

                                                ii.       (text input): tax

                            c.      Caption: Tax Calculator J2EE Library

                            d.      Domain: Financial Services, if available

                            e.      Type: J2EE Server Component ® Library.

       5.      Choose Next.

The dialog window DTR Activity appears.

       6.      When prompted for an activity, choose New to create a new activity.

This activity is used to record the creation of the component in the DTR.

       7.      Enter New J2EE Library as display name of the new activity and choose OK.

The dialog window DTR Activity appears again.

       8.      Select your new activity and choose Next.

The dialog window J2EE Library Project appears again.

       9.      To create the DC, choose Finish.

The J2EE Development perspective appears and you should see a new project for your component in the J2EE DC Explorer view.

The new component has no coding of its own except a special deployment identifier in the META-INF folder under the Project node ®DC MetaData ®DC Definition ®Folders ®META-INF.

Declare the Use of Another DC

You are in the J2EE perspective in the J2EE DC Explorer view.


       1.      Open your J2EE Library DC node

       2.      Select the entry DC MetaData ® DC Definition ® Used DCs and from the context menu, choose Add Used DC...

A dialog window Add Dependency appears.

A DC can use parts of another DC only, if a use dependency was declared.

       3.      Select tab page Inactive.

       4.      Choose in the path Appl_dev ® example.org_application ® appl/tax/calc ® DC MetaData ® Public Parts ® tax.

You can select different nodes in the hierarchy. The selected node and its child nodes are then available to the using DC.

       5.      Select the dependency type:

                            a.      In the section Dependency Type select the entries Build-Time and Runtime.

                            b.      Unselect the checkbox Deploy Time.

If the used DC (as in our example) is of type Java, then the check whether the DC is deployed would always result in an error, because this DC type is not deployable. (For this reason, you created a public part of purpose assembly in the previous step, which enables you to wrap the DC in another deployable DC.)

       6.      Choose Finish.

A use dependency to component application/tax/calculator is created.

Build and Deployment

You are in the J2EE perspective in the J2EE DC Explorer view.

DC Build


       1.      In the context menu of your J2EE Library DC, choose Development Component ® Build...

The dialog window Build Development Components appears, which contains two entries.

       2.      Select both entries (if necessary) and confirm with OK.

The component build now creates a deployable archive named example.org~appl~tax.sda, which wraps the archive example.org~appl~tax~calc~tax.jar of component appl/tax/calc.



       1.      Select example.org~appl~tax.sda in the J2EE DC Explorer view.

       2.      From the context menu, choose Deploy to J2EE engine.

This will deploy the library to the configured runtime system.

      3.      Monitor the ongoing process in the Deploy Outputand General User Output views.

For the deployment, the J2EE engine must be running. For more information, see Scenario 2: Preparation (Configure the Runtime System in the SAP NetWeaver Developer Studio).

Check in Your Changes to the DTR


       1.      Switch to the Development Configuration perspective.

       2.      In the Open Activities view, open the node of the development configuration and the workspace node.

       3.      Select activity New J2EE Library.

       4.      In the context menu of the activity, choose Checkin.

       5.      Enter a description of your changes if you like.

       6.      To check in your activity, choose OK.

A dialog window Activation appears.

       7.      To build your DC at a later time in the CBS, choose Cancel.

Your changes are written to the DTR.

The activity state is now closed. It cannot be changed from now on. For further changes of your files in this activity, you have to create a new activity.