Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp.
ID: 3538983 • Letter: M
Question
Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:Documents and Settingskworkman>cd Desktop C:Documents and SettingskworkmanDesktop>cd "JDBC Tutorials" C:Documents and SettingskworkmanDesktopJDBC Tutorials>cd JDBCTutorial C:Documents and SettingskworkmanDesktopJDBC TutorialsJDBCTutorial>ant jar Buildfile: C:Documents and SettingskworkmanDesktopJDBC TutorialsJDBCTutorialuild.xml compile: [echo] JDBC Tutorial is using C:/Program Files/Java/jdk1.6.0_29/bin/javac as Java compiler [javac] C:Documents and SettingskworkmanDesktopJDBC TutorialsJDBCTutorialuild.xml:59: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds jar: BUILD SUCCESSFUL Total time: 0 seconds C:Documents and SettingskworkmanDesktopJDBC TutorialsJDBCTutorial>ant setup Buildfile: C:Documents and SettingskworkmanDesktopJDBC TutorialsJDBCTutorialuild.xml setup: drop-tables: [sql] Executing resource: C:Documents and SettingskworkmanDesktopJDBCTutorialsJDBCTutorialsqlderbydrop-tables.sql [sql] 0 of 0 SQL statements executed successfully build-tables: [sql] Executing resource: C:Documents and SettingskworkmanDesktopJDBCTutorialsJDBCTutorialsqlderbycreate-tables.sql [sql] 0 of 0 SQL statements executed successfully populate-tables: [sql] Executing resource: C:Documents and SettingskworkmanDesktopJDBCTutorialsJDBCTutorialsqlderbypopulate-tables.sql [sql] 0 of 0 SQL statements executed successfully BUILD SUCCESSFUL Total time: 0 seconds C:Documents and SettingskworkmanDesktopJDBC TutorialsJDBCTutorial>ant javadb-create-procedure Buildfile: C:Documents and SettingskworkmanDesktopJDBC TutorialsJDBCTutorialuild.xml javadb-create-procedure: [sql] Executing commands [sql] Failed to execute: drop procedure SHOW_SUPPLIERS BUILD FAILED C:Documents and SettingskworkmanDesktopJDBC TutorialsJDBCTutorialuild.xml:108: java.sql.SQLSyntaxErrorException: 'DROP PROCEDURE' cannot be performed on'SHOW_SUPPLIERS' because it does not exist. at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source) at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) at org.apache.tools.ant.taskdefs.SQLExec.execSQL(SQLExec.java:775) at org.apache.tools.ant.taskdefs.SQLExec.runStatements(SQLExec.java:745) at org.apache.tools.ant.taskdefs.SQLExec$Transaction.runTransaction(SQLExec.java:1043) at org.apache.tools.ant.taskdefs.SQLExec$Transaction.access$000(SQLExec.java:985) at org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:653) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:390) at org.apache.tools.ant.Target.performTasks(Target.java:411) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399) at org.apache.tools.ant.Project.executeTarget(Project.java:1368) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1251) at org.apache.tools.ant.Main.runBuild(Main.java:809) at org.apache.tools.ant.Main.startAnt(Main.java:217) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) Caused by: java.sql.SQLException: 'DROP PROCEDURE' cannot be performed on 'SHOW_SUPPLIERS' because it does not exist. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source) ... 29 more Caused by: ERROR 42Y55: 'DROP PROCEDURE' cannot be performed on 'SHOW_SUPPLIERS' because it does not exist. at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) at org.apache.derby.impl.sql.compile.DropAliasNode.bindStatement(Unknown Source) at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source) at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source) at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepa reInternalStatement(Unknown Source) ... 23 more Total time: 0 secondsExplanation / Answer
Never been through this tutorial myself, but just took a quick look. Don't have time right now to test, but try the following: in the build.xml file, within the code: //yadayadayada Change all of the onerror="abort" to onerror="continue" and see if this helps. Reasoning (again on quick review): the ant task is trying to drop the procedures, and if they don't exist it exits with an error - but they can't exist unless they have been created in the first place. Note that with this change, if the build is run again and the procedures are created but an error occurs on the drop the script will continue (possible resulting in another error down the line)