cancel
Showing results for 
Search instead for 
Did you mean: 

Datasource not available for Java application

Former Member
0 Kudos

We are deploying a Java application on Netweaver 2004 SP 18 (clustered with 3 nodes) and 2004s SP 2 (non-clustered). Sometimes it occurs that the corresponding datasource (JDBC with Oracle and MySQL) is not available at startup of our application. The problem is that the datasource is essential at application startup to build indices and so on. The strange on that is that after startup the datasource is available after some minutes.

We have tried two things, according to <a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/bb/69da54d8aedc419d46d9ea074e4d41/frameset.htm">Creating a DataSource</a>:

- Registering a DataSource in the Visual Administrator

- Deploying DataSource with our Application

Both kinds of configuration show similar problems, occuring sometimes and sometimes not. Are their any possibilities to configure the starting order of our apllication and datasource? Are their dependencies that affect the work of the datasource?

Any help is welcome!

Thanks in advance

Christian

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

If further problems occur we will post again.

ankur_garg5
Active Contributor
0 Kudos

Hi Christian,

Couldn't exactly tell you what's going wrong, but have you installed the SQL drivers using your Visual Administrator?

See the following links:

Bye

Ankur

Reward points if it helps!!

Former Member
0 Kudos

Hi Ankur,

we have installed the needed SQL drivers correctly. When configuring the datasource in the VisualAdmin we have tested the functionality by sending some SQL through the debug windows offered there.

Our described problem definitively is not because of the functionality of the datasource; it seems more a problem of loading before our application?!?

Thanks

Christian

Former Member
0 Kudos

Hi to all,

the problem we had seems to be fixed with the following points:

- Defining a "hard" dependency between the database driver and our application in file META-INF/application-j2ee-engine.xml of our deployment. (see <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/28/c9a3a9606f434ea757a3536d220704/frameset.htm">Application References</a>)

- Defining a "hard" dependency between the datasource and our application.

As a result we had to remove the datasoure out of our deployment and configure it manually in the VisualAdmin.

See the following code to define the dependency:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application-j2ee-engine SYSTEM "application-j2ee-engine.dtd">
<application-j2ee-engine>
	<reference reference-type="hard">
		<reference-target 
			provider-name="sap.com" 
			target-type="library">mysql4-driver</reference-target>
	</reference>
	<reference reference-type="hard">
		<reference-target 
			provider-name="cosinex.de" 
			target-type="application">mysql4-datasource</reference-target>
	</reference>	
	<provider-name>cosinex.de</provider-name>
	<fail-over-enable mode="disable"/>
</application-j2ee-engine>

We are not finally sure if this fixes our problem of the availability of the datasoure for our application at startup (Servlet Init()), but until now all works fine. We explicitly had no luck with deploying the datasoure together with our application in one EAR file...