cancel
Showing results for 
Search instead for 
Did you mean: 

Setting startup order of J2EE applications or Datasource

Former Member
0 Kudos

We are developing a custom J2EE application onto Netweaver 7.0. It uses three datasources that was created with the Visual Admin console.

Since its a development environment, Netweaver tends to restart itself periodically. The problem comes during these restarts of Netweaver. The application comes up before the datasources do, panics and doesnt continue to start up. Once the datasources are started, a simple restart of the app fixes the problem. With a total of 5 Netweaver environments and deploys happening daily to some of them, it is a nightmare to manage, not too mention time consuming to restart the application each time.

Is there a way one can force the datasourcea to start up first or the application to start up last to avoid this issue? Or any other suggestions to overcome this problem?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Graham,

Thanks for pointing me in the right direction.

I finally got it working, in the file application-j2ee-engine.xml that appears in the META-INF folder of the ear file, you add the following code:


<reference reference-type="hard">
        <reference-target provider-name="sap.com" target-type="application">DatasourceApplicationName</reference-target>
</reference>

So when the application is about to start up, it waits for the datasource to start up. The DatasourceApplicationName is the Application Name in Netweaver, just note this is not the same as the datasource name or the datasource alias.

For the cause as to why the J2EE engine is restarting is unknown at this time. It occurs usually once or twice a day on the server if it is beign used for testing.

Each instance of Netweaver has max heap size of 2GB. Our application is deployed as an SCA file which is currently 180MB in size.

There might be some memory leaks in application, and it is one of the things we are looking into currently. But not to have to restart the application is huge time saver allready.

Edited by: Johann Muller on Jun 24, 2008 3:04 PM

Former Member
0 Kudos

Hi Johann,

if it starts itself periodically you have one of the following (in order of the popularity I have seen)

1. A significant lack of memory (J2EE's should not page)

2. A bad development or 2

3. A SAP bug

regardless, if you are getting a wrong starting order then perhaps you have not specified adequate "Reference Properties"

You can make hard references to other applications for example that will stop startup until the application is running

Have a look at Application References in the architecture manual.... to quote...

If the referenced component or application is not started (or not loaded for libraries), the application will not be started at all.

I hope that is the golden goose you were after

regards

Graham