ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <vinod.na...@iflexsolutions.com>
Subject RE: war deploy
Date Wed, 12 May 2004 06:16:23 GMT
Hi Ivan,

It worked fine when I used delimiter option in SQL task.

Thanks!

-----Original Message-----
From: Vinod Rama Nayak-OP 
Sent: Wednesday, May 12, 2004 11:37 AM
To: user@ant.apache.org
Subject: RE: war deploy


Hi Ivan,

I modified the sql task as you suggested.

    <target name="initdb" description="Re-Compiles a procedure">
        <sql driver="${jdbc.mysql.driver}"
            classpathref="jdbc.driver.cp"
            url="${install.dburl}"
            userid="" password=""
            keepformat="true">
            <transaction src="procedure.sql"/>
        </sql>
    </target>

This is the error i get without verbose option.

db-update:
     [echo] Applying db patches.
      [sql] Executing file: /products/proj/pisars/dist/db/procedures.sql
      [sql] Failed to execute:
      [sql]
      [sql] CURSOR cur_sla IS SELECT system_name,sla_param FROM REPORT_QUALITY_METRICS_DATA
      [sql] WHERE auto_key=AutoKey AND system_name<>'CITIDIRECT'

BUILD FAILED
/products/proj/pisars/dist/build.xml:361: java.sql.SQLException: ORA-00900: invalid SQL statement


and this is with verbose -v option.

db-update:
     [echo] Applying db patches.
      [sql] connecting to jdbc:oracle:thin:@<oracle-host>:<port>:<sid>
      [sql] Loading oracle.jdbc.driver.OracleDriver using AntClassLoader with classpath /products/bea/610sp5/wlserver6.1/lib/cla
sses12.jar
      [sql] Executing file: /products/proj/pisars/dist/db/procedures.sql
      [sql] SQL:
      [sql] CREATE OR REPLACE PROCEDURE SP_WEEKLY_QUALITY_METRICS(
      [sql]     start_date IN VARCHAR2,
      [sql]     date_format IN VARCHAR2,
      [sql]     HOLIDAYS IN VARCHAR2,
      [sql]     AutoKey IN VARCHAR2) IS
      [sql]
      [sql] rep_start_date DATE := TO_DATE(start_date,date_format)
      [sql] 0 rows affected
      [sql] SQL:
      [sql]
      [sql] CURSOR cur_sla IS SELECT system_name,sla_param FROM REPORT_QUALITY_METRICS_DATA
      [sql] WHERE auto_key=AutoKey AND system_name<>'CITIDIRECT'
      [sql] Failed to execute:
      [sql]
      [sql] CURSOR cur_sla IS SELECT system_name,sla_param FROM REPORT_QUALITY_METRICS_DATA
      [sql] WHERE auto_key=AutoKey AND system_name<>'CITIDIRECT'

BUILD FAILED
/products/proj/pisars/dist/build.xml:361: java.sql.SQLException: ORA-00900: invalid SQL statement

        at org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:403)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:301)
        at org.apache.tools.ant.Target.performTasks(Target.java:328)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
        at org.apache.tools.ant.Main.runBuild(Main.java:632)
        at org.apache.tools.ant.Main.startAnt(Main.java:183)
        at org.apache.tools.ant.Main.start(Main.java:147)
        at org.apache.tools.ant.Main.main(Main.java:230)
--- Nested Exception ---
java.sql.SQLException: ORA-00900: invalid SQL statement

-----Original Message-----
From: Ivan Ivanov [mailto:rambiusparkisanius@yahoo.com]
Sent: Tuesday, May 11, 2004 9:47 PM
To: Ant Users List
Subject: RE: war deploy


Hi, Vinod,
can you tell me what db you are using and how exactly
your procedure fails. Also did you try starting ant
with verbose -v option? What does it output?

--- vinod.nayak@iflexsolutions.com wrote:
> Thanks for your reply.
> 
> Actually there are absolutely no comments in the
> file.
> if the procedure.sql is a collection db
> insert/update statements
> it works fine. but if it is a db procedure it fails.
> 
> Rgds,
> Vinod
> 
> -----Original Message-----
> From: Ivan Ivanov
> [mailto:rambiusparkisanius@yahoo.com]
> Sent: Tuesday, May 11, 2004 6:52 PM
> To: Ant Users List
> Subject: RE: war deploy
> 
> 
> Hi Vinod,
> 
> I also had small difficulties with <sql> task -
> syntactically correct statements were not executed.
> The problem was fixed when I removed sql comments
> from
> my *.sql files. You can try these:
> - remove comments from your sql files with
> <striplinecomments>
> - add keepformat="yes" attribute to <sql> task
> HTH
> Ivan
> 
> P.S. There was some discussion in the list about
> comment symbols in sql files and ant developers
> opened
> bug 'Add "commentchars" attribute to Sql task'
>
(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=28394)
> If you want you can vote for this.
> 
> 
> --- vinod.nayak@iflexsolutions.com wrote:
> > Hi All,
> > 
> > I have similar task like this in my build.xml
> > 
> >     <target name="initdb" description="Re-Compiles
> a
> > procedure">
> >         <sql driver="${jdbc.mysql.driver}"
> >             classpathref="jdbc.driver.cp"
> >             url="${install.dburl}"
> >             userid="" password=""
> >             print="yes">
> >             <transaction src="procdure.sql"/>
> >         </sql>
> >     </target>
> > 
> > Though the procedure successfully gets compiled in
> > the SQL plus window
> > it does not through this Ant task.
> > 
> > Am I missing anything here.
> > It gives the SQL error at CURSOR declaration of
> the
> > procedure.
> > 
> > Regards,
> > Vinod.
> > 
> > -----Original Message-----
> > From: Ivan Ivanov
> > [mailto:rambiusparkisanius@yahoo.com]
> > Sent: Tuesday, May 11, 2004 2:55 PM
> > To: Ant Users List; pvalle@eprocess.fr
> > Subject: Re: war deploy
> > 
> > 
> > Hello Philippe,
> > 
> > a month ago I created a web app installion script,
> > which creates db for the app and deploys the war.
> I
> > am
> > sending you the whole script (it is small).
> "deploy"
> > target will be of interest of you. I do not use
> > tomcat
> > ant tasks, since deploying in tomcat is a matter
> of
> > single <copy>. 
> > 
> > Note also that my "deploy" target should be
> invoked
> > when tomcat is _started_. Of course, you can start
> > tomcat via your ant script too. If you want this
> > message me and I will send you more scripts.
> > 
> > Regards Ivan
> > 
> > ----  install.xml ----
> > <!DOCTYPE project [<!ENTITY package
> "iatinstall">]>
> > <project name="iatinstall" default="usage"
> > basedir=".">
> >     <description>IAT installation script; installs
> > IAT
> > distribution</description>
> > 
> >     <target name="usage">
> >     </target>
> > 
> >     <target name="-init" depends=""
> > description="Initializes the neccessary
> properties">
> >         <property environment="env"/>
> >         <!-- Servlet Container Property -->
> >         <property name="catalina.home"
> > value="${env.CATALINA_HOME}"/>
> >         <property name="jdbc.mysql.driver.lib"
> >
> value="mysql-connector-java-3.0.6-stable-bin.jar"/>
> >         <property name="jdbc.mysql.driver"
> > value="org.gjt.mm.mysql.Driver"/>
> >         <property name="install.lib"
> > value="${basedir}/lib"/>
> >         <property name="install.sql"
> > value="${basedir}/sql"/>
> >         <property name="install.dbname"
> > value="iatbonea"/>
> >         <property name="install.dburl"
> >
>
value="jdbc:mysql://localhost:3306/${install.dbname}"/>
> >         <property name="install.context"
> > value="iatbonea"/>
> >         <property name="install.port"
> value="8080"/>
> >         <property name="install.httpurl"
> >
>
value="http://localhost:${install.port}/${install.context}/index.jsp"/>
> >         <property name="project.name"
> > value="iatbonea"/>
> >         <path id="jdbc.driver.cp">
> >             <pathelement
> >
> location="${install.lib}/${jdbc.mysql.driver.lib}"/>
> >         </path>
> >     </target>
> > 
> >     <target name="initdb" depends="-init"
> > description="Creates and populates iat tables">
> >         <sql driver="${jdbc.mysql.driver}"
> >             classpathref="jdbc.driver.cp"
> >             url="${install.dburl}"
> >             userid="" password=""
> >             print="yes">
> >             <transaction
> > src="${install.sql}/create.sql"/>
> >             <transaction
> > src="${install.sql}/insert.sql"/>
> >         </sql>
> >     </target>
> > 
> >     <target name="deploy" depends="-init"
> > description="Deploys the IAT war">
> >         <copy
> file="${basedir}/${project.name}.war"
> > todir="${catalina.home}/webapps"/>
> >         <waitfor
> > timeoutproperty="time.out.property">
> >             <http url="${install.httpurl}"/>
> >         </waitfor>
> >         <fail if="time.out.property"
> > message="Deployment failed. Check whether Tomcat
> > Service is started and if not start it."/>
> >         <echo message="Deployment finished. IAT
> > application is ready to be accessed"/>
> >     </target>
> > 
> > </project>
> > 
> > 
> > 
> > --- Philippe Valle <pvalle@eprocess.fr> wrote:
> > > HI,
> > > 
> > > 
> > > how to deploy WAR file with ant 1.6.1 ( i use
> > tomcat
> > > 4.1.29 ) :
> > > 
> > > 
> > > this lines in build.xml file doesnt works :
> > > 
> > > <-- Configure the custom Ant tasks for the
> Manager
> > > application -->
> > >    <taskdef name="deploy"    
> > > classname="org.apache.catalina.ant.DeployTask"/>
> > >    <taskdef name="install"   
> > >
> classname="org.apache.catalina.ant.InstallTask"/>
> 
=== message truncated ===



	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message