Entering content frame

Procedure documentation Scenario 2+: Step 2 – Creating a J2EE Java Library Locate the document in its SAP Library structure

The component application/tax/calculator that has been created in step 1 is a simple Java library and therefore cannot directly be deployed to the SAP NetWeaver J2EE engine. Developer 1 in this step continues wrapping his library with a SAP J2EE Java Library component.

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: application/tax 

                            c.      Caption: Tax Calculator J2EE Library

                            d.      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.

Note

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.

Note

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.

Note

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 ® application/tax/calculator ® DC MetaData ® Public Parts ® tax.

Note

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.

Caution

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~application~tax.sda wrapping the example.org~application~tax~calculator~tax.jar archive of the component application/tax/calculator.

Deployment

...

       1.      Select example.org~application~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 Output and General User Output views.

Note

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.

Note

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.

 

 

 

 

Leaving content frame