Start of Content Area

Background documentation Startup of an Application with CMP Entity Beans Fails Locate the document in its SAP Library structure

Problem Description

The startup process of an application with entity beans with container-managed persistence has failed.

Scenario Type:

Error analysis

NetWeaver Component:

J2EE Engine

Validity:

J2EE Engine 6.40 and higher

Decision Roadmap

Prerequisites

-

Main Tools

Visual Administrator

Analysis

Note

In the examples below the application sap.com/PersonsApp is used.

Start the Visual Administrator and connect to the J2EE Engine. Choose Cluster ® Server ® Services ® Deploy. The Runtime tab displays all deployed applications.

Case 1

If the icon in front of the application name looks like This graphic is explained in the accompanying text, then the application is implicitly stopped. The main reason for such a problem is the use of a data source that does not exist.

This graphic is explained in the accompanying text 

To see the detailed message of the error, select the application, choose Start Application, and then select the book icon This graphic is explained in the accompanying text from the status bar.

     Error message:

If the application is implicitly stopped, then the error message is similar to the one below:

Error occurred on server 3305750 during startApp sap.com/PersonsApp : Application sap.com/PersonsApp cannot be started. Reason: it has a hard reference to resource BC_PERSONS1 with type javax.sql.DataSource, which is not active on the server.

This graphic is explained in the accompanying text

     Solution

The data source that has to be used for persisting the container-managed entity beans is not present. Create a data source with the given data source name. After it is successfully created, the application will be implicitly started. For more information how to create a data source, see Structure linkCreating a DataSource.

Case 2

If the icon in front of the application name looks like This graphic is explained in the accompanying text, then the application is stopped, but not implicitly. The main reason for such a problem is an error in the object-relational mapping.

This graphic is explained in the accompanying text

To see the detailed message of the error, select the application, choose Start Application, and then select the book icon This graphic is explained in the accompanying text from the status bar.

     Error message

The error message is similar to the one below:

Error occurred on server 3305750 during startApp sap.com/PersonsApp : According to the O/R mapping described in /META-INF/persistent.xml, a CMPBean intends to store its persistent information in table TMP_PERSONS1. Such table does not exist in the database. Create it before trying to start the application.

This graphic is explained in the accompanying text

     Solution

The reason for this error can be an incorrect object-relational mapping. In such a case an ORMappingVerificationException is thrown. The detailed message of the exception will tell you what the problem is.

For example, according to the exception above, you have to create a database table with the name TMP_PERSONS1. Then try to start the application again. See Structure linkObject/Relational Mapping Rules for more information about the object-relational mapping requirements.

 

In general, the described object-relational mapping (META-INF\persistent.xml) does not fit the tables in the underlying database model or such a model does not exist in the database. If the fix affects only the database schema (for example, creating or changing the definition of a database table), after you perform it, you only need to start the application. If the fix affects the application (for example, changing the O/R mapping description in file persistent.xml), then you have to redeploy the application.

Additional Information

-

 

End of Content Area