5 Replies Latest reply on Sep 13, 2012 2:36 AM by Kalyan Pasupuleti-Oracle

    Datasource is not getting created with jndi name though ANT

      Please help me to come out of this problem. JDBC DATA SOURCE is getting created without jndi name when iam executing below ANT Script.

      <?xml version="1.0" ?>

           <project name="deploy" default="createDataSource" basedir=".">
           <property name="weblogic.jar" location="C:/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar"/>
           <property name="wls.username" value="weblogic" />
           <property name="wls.password" value="weblogic" />
           <property name="wls.url" value="t3://" />
           <property name="wls.targetServer" value="AdminServer" />
           <property name="wls.targetServer" value="soa_server1" />
           <property name="wls.domainName" value="SOA" />

           <property name="database.url" value="jdbc:oracle:thin:@" />
           <property name="database.driver" value="oracle.jdbc.xa.client.OracleXADataSource" />
           <property name="database.user" value="user" />
           <property name="database.password" value="password" />

           <taskdef name="wldeploy" classname="weblogic.ant.taskdefs.management.WLDeploy" classpath="${weblogic.jar}"/>
           <taskdef name="wlconfig" classname="weblogic.ant.taskdefs.management.WLConfig" classpath="${weblogic.jar}"/>
           <target name="createDataSource">
           <wlconfig username="weblogic" password="webfsaD1" url="t3://">
           <query domain="SOA" type="Server" name="AdminServer" property="x" />
           <create type="JDBCConnectionPool" name="TestScriptDS" >
           <set attribute="CapacityIncrement" value="1"/>
           <set attribute="DriverName" value="oracle.jdbc.xa.client.OracleXADataSource"/>
           <set attribute="InitialCapacity" value="1"/>
           <set attribute="MaxCapacity" value="10"/>
           <set attribute="Password" value="Password"/>
           <set attribute="Properties" value="user=user"/>
           <set attribute="RefreshMinutes" value="0"/>
           <set attribute="ShrinkPeriodMinutes" value="15"/>
           <set attribute="ShrinkingEnabled" value="true"/>
           <set attribute="TestConnectionsOnRelease" value="false"/>
           <set attribute="TestConnectionsOnReserve" value="false"/>
           <set attribute="TestTableName" value="SQL SELECT 1 FROM DUAL"/>
           <set attribute="URL" value="${database.url}"/>
           <set attribute="Targets" value="${x}" />
           <create type="JDBCTxDataSource" name="TestScriptDS">
           <set attribute="JNDINames" value="jdbc/testScriptDS"/>
           <set attribute="PoolName" value="TestScriptDS"/>
           <set attribute="Targets" value="${x}"/>

      Thanks in advance,
        • 1. Re: Datasource is not getting created with jndi name though ANT
          Kalyan Pasupuleti-Oracle

          set the following parameter with in the startup script like SetSOADomainEnv.sh file under java option and restart the server.


          • 2. Re: Datasource is not getting created with jndi name though ANT
            Hi kalyan... i tried with this but still iam getting the same issue :(
            • 3. Re: Datasource is not getting created with jndi name though ANT
              Kalyan Pasupuleti-Oracle
              can you give me the Ant verbose output plz...
              • 4. Re: Datasource is not getting created with jndi name though ANT
                Thank u very much for ur quick reply.

                C:\ANT_DataSource>ant -v
                Apache Ant(TM) version 1.8.2 compiled on December 20 2010
                Trying the default build file: build.xml
                Buildfile: C:\ANT_DataSource\build.xml
                Detected Java version: 1.6 in: C:\Oracle\Middleware\jdk160_24\jre
                Detected OS: Windows 7
                parsing buildfile C:\ANT_DataSource\build.xml with URI = file:/C:/ANT_DataSource/build.xml
                Project base dir set to: C:\ANT_DataSource
                parsing buildfile jar:file:/D:/ANT/apache-ant-1.8.2/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/D:/ANT/apache-ant-1.8.2/lib/ant.jar!/org/a
                pache/tools/ant/antlib.xml from a zip file
                Build sequence for target(s) `makeDataSource' is [makeDataSource]
                Complete build sequence is [makeDataSource, ]

                Property "AdminServer" has not been set
                Property "SoaServer" has not been set
                Property "AdminServer" has not been set
                Property "SoaServer" has not been set
                [wlconfig] QUERY -pattern SOA:*,Name=AdminServer,Type=Server
                [wlconfig] Set size is 1
                [wlconfig] QUERY -pattern SOA:*,Name=soa_server1,Type=Server
                [wlconfig] Set size is 1
                [wlconfig] Created MBEAN: SOA:Name=SampleDS,Type=JDBCConnectionPool
                [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Capa
                cityIncrement 1
                [wlconfig] Ok
                [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Driv
                erName oracle.jdbc.xa.client.OracleXADataSource
                [wlconfig] Ok
                [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Init
                ialCapacity 0
                [wlconfig] Ok
                [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property MaxC
                apacity 50
                [wlconfig] Ok
                [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Stat
                ementTimeout 600
                [wlconfig] Ok
                [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Pass
                word USER
                [wlconfig] Ok
                [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Prop
                erties user=PASSWORD
                [wlconfig] Ok
                [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Refr
                eshMinutes 0
                [wlconfig] Ok
                [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Shri
                nkPeriodMinutes 15
                [wlconfig] Ok
                [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Shri
                nkingEnabled true
                [wlconfig] Ok
                [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Test
                ConnectionsOnRelease false
                [wlconfig] Ok
                [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Test
                ConnectionsOnReserve false
                [wlconfig] Ok
                [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Test
                ConnectionsOnCreate true
                [wlconfig] Ok
                [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Test
                TableName SQL SELECT 1 FROM DUAL
                [wlconfig] Ok
                [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property URL
                [wlconfig] Ok
                [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Targ
                ets SOA:Name=AdminServer,Type=Server;SOA:Name=soa_server1,Type=Server
                [wlconfig] Ok
                [wlconfig] Created MBEAN: SOA:Name=SampleDS,Type=JDBCTxDataSource
                [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCTxDataSource -property JNDINa
                me jdbc/SampleDS
                [wlconfig] Ok
                [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCTxDataSource -property PoolNa
                me SampleDS
                [wlconfig] Ok
                [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCTxDataSource -property Target
                s SOA:Name=AdminServer,Type=Server;SOA:Name=soa_server1,Type=Server
                [wlconfig] Ok
                [wlconfig] QUERY -pattern SOA:*,Name=AdminServer,Type=WebServer
                [wlconfig] Set size is 1
                [wlconfig] SET -mbean SOA:Name=AdminServer,Type=WebServer,Server=AdminServer -p
                roperty LogFileName logs/access.log
                [wlconfig] Ok

                BUILD SUCCESSFUL
                Total time: 41 seconds

                Edited by: soa.dev on 12-Sep-2012 02:09
                • 5. Re: Datasource is not getting created with jndi name though ANT
                  Kalyan Pasupuleti-Oracle
                  Verbose looks good did you get a chance to check server logs.

                  if possible can you paste it here or upload it to here so that I can verify the problem.