In my case, the solution below works fine for me.
I created a "Generic project" in Eclipse called "Resources". Inside this project I created a file dataSource.xml
with following content:
<server>
<dataSource id="ccm" jndiName="jdbc/ccm" type="javax.sql.DataSource">
<jdbcDriver id="oracle-driver" libraryRef="oracle-lib"/>
<connectionManager id="ConnectionManager" minPoolSize="1" numConnectionsPerThreadLocal="10"/>
<properties.oracle password="password" url="jdbc:oracle:thin:@128.1.30.150:1521:ccmdes" user="ccm"/>
</dataSource>
<library id="oracle-lib">
<fileset dir="C:\Oracle\product\10.1.0\Client_1\jdbc\lib" includes="ojdbc14_g.jar"/>
</library>
<jdbcDriver id="oracle" libraryRef="oracle-lib"/>
</server>
And I drag and drop this file for server configuration in Eclipse or create the line in server.xml
:
<include location="${shared.config.dir}/dataSource.xml"/>
The file server.xml
was like this:
<server description="new server">
<!-- Enable features -->
<featureManager>
<feature>jsp-2.3</feature>
<feature>adminCenter-1.0</feature>
<feature>jdbc-4.1</feature>
<feature>jndi-1.0</feature>
<feature>servlet-3.1</feature>
</featureManager>
<httpEndpoint host="localhost" httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/>
<applicationMonitor updateTrigger="mbean"/>
<!-- Define your admin user name and password -->
<quickStartSecurity userName="admin" userPassword="password"/>
<!-- Define a keystore for the HTTPS port -->
<keyStore id="defaultKeyStore" password="Liberty"/>
<!-- Allows remote file access for config changes -->
<remoteFileAccess>
<writeDir>${server.config.dir}</writeDir>
</remoteFileAccess>
<!-- <applicationMonitor updateTrigger="mbean"/> -->
<webApplication id="TestPage" location="TestPage.war" name="TestPage"/>
<webApplication id="MonitoriaAtendimento" location="MonitoriaAtendimento.war" name="MonitoriaAtendimento"/>
<include location="${shared.config.dir}/dataSource.xml"/>
</server>