1

以下は、一連のテーブルを作成し、特定のデータベースのデータをロードする i2b2 データベース セットアップ チュートリアルのコマンドです。以前は、SQL Server Management Studio (SSMS) で *.sql コマンドを手動で (新しいクエリ ウィンドウで) 実行しただけでした。これは Java から実行する必要がありますか、それともどこかのコマンド プロンプトから直接実行できますか? もしそうなら、必要な手順を手伝ってもらえますか?(つまり、サードパーティのアセンブリを参照する必要がありますか、データベース接続文字列を構成する必要があると思います..)

ant –f data_build.xml create_workdata_tables_release_1-6

ant –f data_build.xml db_workdata_load_data

「ant」(StackOverflow タグ)にカーソルを合わせると、Java ツールのように見えます。

「Apache Ant (以前の Jakarta Ant) は、Java プロジェクト用の宣言型の XML ベースのビルド ツールです。javac を使用したコンパイル、アーカイブのビルド、テストの実行など、最も一般的なビルド操作を実行するための標準タスクの豊富なセットを提供します。Ant の機能カスタム タスクとマクロを使用して拡張できます。」

これを Windows のコマンド プロンプトから実行しようとしましたが、エラーが発生しました。

C:\Source\i2b2\i2b2createdb-1602\edu.harvard.i2b2.data\Release_1-6\NewInstall\Metadata>ant -f data_build.xml create_crcdata_tables_release_1-6
'ant' is not recognized as an internal or external command,
operable program or batch file.

実際の *.sql ファイルが XML ファイルにリストされているのを確認しました。これらのファイルは特定の方法で並べられているため、関連する (主キーを含む) データが最初にロードされ、ブリッジ/親/所有者/base テーブル (外部キーを含む) は、関連付けられたテーブルに依存しているため、最後に実行されます。他のすべてが失敗した場合は、リストされている順序で SSMS からこれらのコマンドを直接実行することもできますが、この「ant」コマンドを試してみたいと思っています。

セットアップ手順:

http://www.i2b2.org

「i2b2createdb-1602.zip」をダウンロードして解凍します。

「i2b2core-doc-1602.zip」をダウンロードして解凍します (インストール手順については、これらの PDF ドキュメントを使用してください)。

=====================================

XML ファイル内で定義されている変数を定義する必要があるようです。

<?xml version="1.0" encoding="UTF-8"?>
<!--
$Id: data_build.xml,v 1.5 2010/06/04 15:33:06 lcp5 Exp $
-->
<project name="Ontology/Metadata data" basedir=".">

    <property environment="env" />

    <property file="./db.properties" />

    <!-- =================================================================== -->
    <!--                                INIT                                 -->
    <!-- =================================================================== -->
    <target name="init"  description="Prepare for build">
        <path id="classpath">
            <pathelement location="../ojdbc14.jar" />
            <pathelement location="../sqljdbc.jar"/>
        </path>
    </target>



    <!-- =================================================================== -->
    <!--            DATABASE SETUP TARGETS                                   -->
    <!-- =================================================================== -->
    <target name="db_create_user" depends="init">
        <sql driver="${db.driver}" url="${db.url}" userid="${db.username}" password="${db.password}" classpathref="classpath" onerror="continue" print="true">
                    CREATE USER  i2b2metadata IDENTIFIED BY   i2b2metadata;
                </sql>
    </target>

    <target name="create_metadata_tables_release_1-6" depends="init">
        <sql driver="${db.driver}" url="${db.url}" userid="${db.username}" password="${db.password}" classpathref="classpath" onerror="continue" print="true">
            <transaction src="./scripts/create_${db.type}_i2b2metadata_tables.sql" />
        </sql>
    </target>

    <target name="db_metadata_load_data" depends="init">
        <echo message="Loading metadata -- may take a while; over 10 min" />
        <sql driver="${db.driver}" url="${db.url}" userid="${db.username}" password="${db.password}" classpathref="classpath" onerror="continue" print="true">
            <transaction src="./${db.project}/scripts/schemes_insert_data.sql" />
            <transaction src="./${db.project}/scripts/table_access_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/birn_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/custom_meta_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_demographics_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_diagnoses_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_expressions_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_labtests_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_medications_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_modifiers_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_procedures_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_providers_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_reports_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_visitDetails_insert_data.sql" />
        </sql>
    </target>

</project>

=====================================

2012 年 5 月 6 日午前 6 時 52 分更新:

SQL Server Management Studio のセットアップ:

  • SQL Server Management Studio > 「i2b2_demo」という名前の新しいデータベースを作成

Oracle JDK をインストールします。

Apache Ant をインストールします。

  • http://ant.apache.org/でバイナリ ファイルをダウンロードします。
  • インストール手順については、次のパスに移動してください: マニュアル > Apache Ant のインストール > Ant の取得 > ..follow instructions
  • 抽出したフォルダー (bin フォルダーを含む) をC:\source_code\apache-ant-1.8.3\%ANT_HOME% 環境変数で使用されるディレクトリまたはディレクトリ内に移動します。

Java および Ant 用の Windows 7 環境変数のセットアップ:

Windows 7 > コントロール パネル > システム > [環境変数] ボタンをクリック >

(末尾の「\」を忘れないでください) *[ MacGyver 2012 年 5 月 6 日 @2:45pm - これを無視してください...末尾の「\」文字を削除してください...質問の下の私のコメントを参照してください]

[システム変数] セクションで、[追加] > [変数名] をクリックします:JAVA_HOME 変数値:C:\Program Files\Java\jdk1.7.0_02\

[システム変数] セクションで、[追加] > [変数名] をクリックします:ANT_HOME 変数値:C:\source_code\apache-ant-1.8.3\

[システム変数] セクションで、[パス] 環境変数をクリックし、[編集] > [変数名] をクリックします:Path 変数値:{value before editing};%JAVA_HOME%\bin;%ANT_HOME%\bin;

  • コマンド プロンプトを再起動します (管理者として実行)

  • C:\source_code\i2b2\i2b2createdb-1602\edu.harvard.i2b2.data\Release_1-6\NewInstall\{folder}\db.properties各ファイルを適切な値に置き換えます。交換 "?" 正しい値で。

「db.properties」ファイル:

db.type=sqlserver
db.username=?
db.password=?
db.server=LAPTOP-INSPIRON\SQLEXPRESS
db.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
db.url=jdbc:sqlserver:LAPTOP-INSPIRON\SQLEXPRESS;databasename=i2b2_demo
db.project=demo

このエラーの取得:

C:\source_code\i2b2\i2b2createdb-1602\edu.harvard.i2b2.data\Release_1-6\NewInsta
ll\Crcdata>ant -f data_build.xml upgrade_metadata_tables_release_1-6
Buildfile: build.xml does not exist!
Build failed

=====================================

2012 年 5 月 6 日午前 7 時 33 分に更新 ... このページにそのエラーが見つかりました ...

Ant のインストール:

これをクリックしてください: http://ant.apache.org/manual/index.html

また...

http://ant.apache.org/に移動> マニュアル > Apache Ant のインストール > Ant のインストール >

C:\source_code\apache-ant-1.8.3>ant -version
Apache Ant(TM) version 1.8.3 compiled on February 26 2012

C:\source_code\apache-ant-1.8.3>ant -f fetch.xml
Buildfile: C:\source_code\apache-ant-1.8.3\fetch.xml

pick-dest:

BUILD FAILED
C:\source_code\apache-ant-1.8.3\fetch.xml:70: ERROR
Set -Ddest=LOCATION on the command line
  -Ddest=user     user lib dir  C:\Users\Keith/.ant/lib
  -Ddest=system   ant lib dir   C:\source_code\apache-ant-1.8.3/lib
  -Ddest=optional optional dir  ${basedir}/lib/optional  (for Ant developers)

Total time: 0 seconds

C:\source_code\apache-ant-1.8.3>build install
'build' is not recognized as an internal or external command,
operable program or batch file.

......その後、コマンドのパラメーターを見逃していることに気付きました..それでも失敗します!

C:\source_code\apache-ant-1.8.3>ant -f fetch.xml -Ddest=system
Buildfile: C:\source_code\apache-ant-1.8.3\fetch.xml

pick-dest:
     [echo] Downloading to C:\source_code\apache-ant-1.8.3\lib

probe-m2:

download-m2:
     [echo] Downloading to C:\source_code\apache-ant-1.8.3\lib
      [get] Getting: http://repo1.maven.org/maven2/org/apache/maven/maven-artifa
ct-ant/2.0.4/maven-artifact-ant-2.0.4-dep.jar
      [get] To: C:\source_code\apache-ant-1.8.3\lib\maven-artifact-ant-2.0.4-dep
.jar
      [get] ...................................

dont-validate-m2-checksum:

validate-m2-checksum:

checksum-mismatch:

checksum-match:

get-m2:

macros:

init:

logging:
[artifact:dependencies] Downloading: log4j/log4j/1.2.14/log4j-1.2.14.pom
[artifact:dependencies] Transferring 2K
[artifact:dependencies] Downloading: log4j/log4j/1.2.14/log4j-1.2.14.jar
[artifact:dependencies] Transferring 358K
     [copy] Copying 1 file to C:\source_code\apache-ant-1.8.3\lib
[artifact:dependencies] Downloading: commons-logging/commons-logging-api/1.1/com
mons-logging-api-1.1.pom
[artifact:dependencies] Transferring 5K
[artifact:dependencies] Downloading: commons-logging/commons-logging-api/1.1/com
mons-logging-api-1.1.jar
[artifact:dependencies] Transferring 43K
     [copy] Copying 1 file to C:\source_code\apache-ant-1.8.3\lib

junit:
[artifact:dependencies] Downloading: junit/junit/4.8.1/junit-4.8.1.pom
[artifact:dependencies] Transferring 0K
[artifact:dependencies] Downloading: junit/junit/4.8.1/junit-4.8.1.jar
[artifact:dependencies] Transferring 231K
     [copy] Copying 1 file to C:\source_code\apache-ant-1.8.3\lib

xml:
[artifact:dependencies] Downloading: xalan/xalan/2.7.1/xalan-2.7.1.pom
[artifact:dependencies] Transferring 1K
[artifact:dependencies] Downloading: org/apache/apache/4/apache-4.pom
[artifact:dependencies] Transferring 4K
[artifact:dependencies] Downloading: xalan/serializer/2.7.1/serializer-2.7.1.pom

[artifact:dependencies] Transferring 1K
[artifact:dependencies] Downloading: xml-apis/xml-apis/1.3.04/xml-apis-1.3.04.po
m
[artifact:dependencies] Transferring 1K
[artifact:dependencies] Downloading: org/apache/apache/3/apache-3.pom
[artifact:dependencies] Transferring 3K
[artifact:dependencies] Downloading: xml-apis/xml-apis/1.3.04/xml-apis-1.3.04.ja
r
[artifact:dependencies] Transferring 189K
[artifact:dependencies] Downloading: xalan/serializer/2.7.1/serializer-2.7.1.jar

[artifact:dependencies] Transferring 271K
[artifact:dependencies] Downloading: xalan/xalan/2.7.1/xalan-2.7.1.jar
[artifact:dependencies] Transferring 3101K
     [copy] Copying 3 files to C:\source_code\apache-ant-1.8.3\lib
[artifact:dependencies] Downloading: xml-resolver/xml-resolver/1.2/xml-resolver-
1.2.pom
[artifact:dependencies] Transferring 1K
[artifact:dependencies] Downloading: xml-resolver/xml-resolver/1.2/xml-resolver-
1.2.jar
[artifact:dependencies] Transferring 82K
     [copy] Copying 1 file to C:\source_code\apache-ant-1.8.3\lib

networking:
[artifact:dependencies] Downloading: commons-net/commons-net/1.4.1/commons-net-1
.4.1.pom
[artifact:dependencies] Transferring 4K
[artifact:dependencies] Downloading: oro/oro/2.0.8/oro-2.0.8.pom
[artifact:dependencies] Transferring 0K
[artifact:dependencies] Downloading: oro/oro/2.0.8/oro-2.0.8.jar
[artifact:dependencies] Transferring 63K
[artifact:dependencies] Downloading: commons-net/commons-net/1.4.1/commons-net-1
.4.1.jar
[artifact:dependencies] Transferring 176K
     [copy] Copying 2 files to C:\source_code\apache-ant-1.8.3\lib
[artifact:dependencies] Downloading: com/jcraft/jsch/0.1.42/jsch-0.1.42.pom
[artifact:dependencies] Transferring 0K
[artifact:dependencies] Downloading: com/jcraft/jsch/0.1.42/jsch-0.1.42.jar
[artifact:dependencies] Transferring 181K
     [copy] Copying 1 file to C:\source_code\apache-ant-1.8.3\lib

regexp:
[artifact:dependencies] Downloading: regexp/regexp/1.3/regexp-1.3.pom
[artifact:dependencies] Transferring 0K
[artifact:dependencies] Downloading: regexp/regexp/1.3/regexp-1.3.jar
[artifact:dependencies] Transferring 24K
     [copy] Copying 1 file to C:\source_code\apache-ant-1.8.3\lib

antlr:
[artifact:dependencies] Downloading: antlr/antlr/2.7.7/antlr-2.7.7.pom
[artifact:dependencies] Transferring 0K
[artifact:dependencies] Downloading: antlr/antlr/2.7.7/antlr-2.7.7.jar
[artifact:dependencies] Transferring 434K
     [copy] Copying 1 file to C:\source_code\apache-ant-1.8.3\lib

bcel:
[artifact:dependencies] Downloading: bcel/bcel/5.1/bcel-5.1.pom
[artifact:dependencies] Transferring 0K
[artifact:dependencies] Downloading: regexp/regexp/1.2/regexp-1.2.pom
[artifact:dependencies] Transferring 0K
[artifact:dependencies] Downloading: regexp/regexp/1.2/regexp-1.2.jar
[artifact:dependencies] Transferring 29K
[artifact:dependencies] Downloading: bcel/bcel/5.1/bcel-5.1.jar
[artifact:dependencies] Transferring 503K
     [copy] Copying 2 files to C:\source_code\apache-ant-1.8.3\lib

jdepend:
[artifact:dependencies] Downloading: jdepend/jdepend/2.9.1/jdepend-2.9.1.pom
[artifact:dependencies] Transferring 0K
[artifact:dependencies] Downloading: jdepend/jdepend/2.9.1/jdepend-2.9.1.jar
[artifact:dependencies] Transferring 56K
     [copy] Copying 1 file to C:\source_code\apache-ant-1.8.3\lib

bsf:
[artifact:dependencies] Downloading: bsf/bsf/2.4.0/bsf-2.4.0.pom
[artifact:dependencies] Transferring 1K
[artifact:dependencies] Downloading: commons-logging/commons-logging/1.0.4/commo
ns-logging-1.0.4.pom
[artifact:dependencies] Transferring 5K
[artifact:dependencies] Downloading: commons-logging/commons-logging/1.0.4/commo
ns-logging-1.0.4.jar
[artifact:dependencies] Transferring 37K
[artifact:dependencies] Downloading: bsf/bsf/2.4.0/bsf-2.4.0.jar
[artifact:dependencies] Transferring 110K
     [copy] Copying 2 files to C:\source_code\apache-ant-1.8.3\lib

debugging:
[artifact:dependencies] Downloading: which/which/1.0/which-1.0.pom
[artifact:dependencies] Transferring 0K
[artifact:dependencies] Downloading: which/which/1.0/which-1.0.jar
[artifact:dependencies] Transferring 16K
     [copy] Copying 1 file to C:\source_code\apache-ant-1.8.3\lib

jruby:
[artifact:dependencies] Downloading: org/jruby/jruby/0.9.8/jruby-0.9.8.pom
[artifact:dependencies] Transferring 5K
[artifact:dependencies] Downloading: org/jruby/shared/0.9.8/shared-0.9.8.pom
[artifact:dependencies] Transferring 4K
[artifact:dependencies] Downloading: asm/asm-commons/2.2.3/asm-commons-2.2.3.pom

[artifact:dependencies] Transferring 0K
[artifact:dependencies] Downloading: asm/asm-parent/2.2.3/asm-parent-2.2.3.pom
[artifact:dependencies] Transferring 2K
[artifact:dependencies] Downloading: asm/asm-tree/2.2.3/asm-tree-2.2.3.pom
[artifact:dependencies] Transferring 0K
[artifact:dependencies] Downloading: asm/asm/2.2.3/asm-2.2.3.pom
[artifact:dependencies] Transferring 0K
[artifact:dependencies] Downloading: asm/asm-commons/2.2.3/asm-commons-2.2.3.jar

[artifact:dependencies] Transferring 14K
[artifact:dependencies] Downloading: org/jruby/jruby/0.9.8/jruby-0.9.8.jar
[artifact:dependencies] Transferring 1644K
[artifact:dependencies] Downloading: asm/asm/2.2.3/asm-2.2.3.jar
[artifact:dependencies] Transferring 34K
[artifact:dependencies] Downloading: asm/asm-tree/2.2.3/asm-tree-2.2.3.jar
[artifact:dependencies] Transferring 15K
     [copy] Copying 4 files to C:\source_code\apache-ant-1.8.3\lib

beanshell:
[artifact:dependencies] Downloading: org/beanshell/bsh/2.0b4/bsh-2.0b4.pom
[artifact:dependencies] Transferring 1K
[artifact:dependencies] Downloading: org/beanshell/beanshell/2.0b4/beanshell-2.0
b4.pom
[artifact:dependencies] Transferring 1K
[artifact:dependencies] Downloading: org/beanshell/bsh/2.0b4/bsh-2.0b4.jar
[artifact:dependencies] Transferring 275K
     [copy] Copying 1 file to C:\source_code\apache-ant-1.8.3\lib
[artifact:dependencies] Downloading: org/beanshell/bsh-core/2.0b4/bsh-core-2.0b4
.pom
[artifact:dependencies] Transferring 0K
[artifact:dependencies] Downloading: org/beanshell/bsh-core/2.0b4/bsh-core-2.0b4
.jar
[artifact:dependencies] Transferring 140K
     [copy] Copying 1 file to C:\source_code\apache-ant-1.8.3\lib

rhino:
[artifact:dependencies] Downloading: rhino/js/1.6R7/js-1.6R7.pom
[artifact:dependencies] Transferring 0K
[artifact:dependencies] Downloading: rhino/js/1.6R7/js-1.6R7.jar
[artifact:dependencies] Transferring 794K
     [copy] Copying 1 file to C:\source_code\apache-ant-1.8.3\lib

script:

javamail:
[artifact:dependencies] Downloading: javax/mail/mail/1.4/mail-1.4.pom
[artifact:dependencies] Transferring 0K
[artifact:dependencies] Downloading: javax/activation/activation/1.1/activation-
1.1.pom
[artifact:dependencies] Transferring 1K
[artifact:dependencies] Downloading: javax/mail/mail/1.4/mail-1.4.jar
[artifact:dependencies] Transferring 379K
[artifact:dependencies] Downloading: javax/activation/activation/1.1/activation-
1.1.jar
[artifact:dependencies] Transferring 61K
     [copy] Copying 2 files to C:\source_code\apache-ant-1.8.3\lib

jspc:
[artifact:dependencies] Downloading: tomcat/jasper-compiler/4.1.36/jasper-compil
er-4.1.36.pom
[artifact:dependencies] [WARNING] Unable to get resource from repository remote
(http://repo1.maven.org/maven2/)
[artifact:dependencies] Downloading: tomcat/jasper-compiler/4.1.36/jasper-compil
er-4.1.36.pom
[artifact:dependencies] [WARNING] Unable to get resource from repository central
 (http://repo1.maven.org/maven2)
[artifact:dependencies] Downloading: tomcat/jasper-compiler/4.1.36/jasper-compil
er-4.1.36.jar
[artifact:dependencies] Transferring 179K
     [copy] Copying 1 file to C:\source_code\apache-ant-1.8.3\lib
[artifact:dependencies] Downloading: tomcat/jasper-runtime/4.1.36/jasper-runtime
-4.1.36.pom
[artifact:dependencies] [WARNING] Unable to get resource from repository remote
(http://repo1.maven.org/maven2/)
[artifact:dependencies] Downloading: tomcat/jasper-runtime/4.1.36/jasper-runtime
-4.1.36.pom
[artifact:dependencies] [WARNING] Unable to get resource from repository central
 (http://repo1.maven.org/maven2)
[artifact:dependencies] Downloading: tomcat/jasper-runtime/4.1.36/jasper-runtime
-4.1.36.jar
[artifact:dependencies] Transferring 70K
     [copy] Copying 1 file to C:\source_code\apache-ant-1.8.3\lib
[artifact:dependencies] Downloading: javax/servlet/servlet-api/2.3/servlet-api-2
.3.pom
[artifact:dependencies] Transferring 0K
[artifact:dependencies] Downloading: javax/servlet/servlet-api/2.3/servlet-api-2
.3.jar
[artifact:dependencies] Transferring 76K
     [copy] Copying 1 file to C:\source_code\apache-ant-1.8.3\lib

jai:
[artifact:dependencies] Downloading: javax/media/jai-core/1.1.3/jai-core-1.1.3.p
om
[artifact:dependencies] Transferring 1K
[artifact:dependencies] Downloading: javax/media/jai-core/1.1.3/jai-core-1.1.3.j
ar
[artifact:dependencies] Transferring 1856K
     [copy] Copying 1 file to C:\source_code\apache-ant-1.8.3\lib
[artifact:dependencies] Downloading: com/sun/media/jai-codec/1.1.3/jai-codec-1.1
.3.pom
[artifact:dependencies] Transferring 1K
[artifact:dependencies] Downloading: com/sun/media/jai-codec/1.1.3/jai-codec-1.1
.3.jar
[artifact:dependencies] Transferring 252K
     [copy] Copying 1 file to C:\source_code\apache-ant-1.8.3\lib

nonm2-macros:

init-no-m2:

init-cache:

-setup-temp-cache:
    [mkdir] Created dir: C:\Users\{user name}\.ant\tempcache

-fetch-netrexx:

-fetch-netrexx-no-commons-net:
      [get] Getting: ftp://ftp.software.ibm.com/software/awdtools/netrexx/NetRex
x.zip
      [get] To: C:\Users\{user name}\.ant\tempcache\NetRexx.zip
      [get] Error opening connection java.net.SocketException: Permission denied
: recv failed
      [get] Error opening connection java.net.SocketException: Connection reset
      [get] Error opening connection java.net.SocketException: Connection reset
      [get] Can't get ftp://ftp.software.ibm.com/software/awdtools/netrexx/NetRe
xx.zip to C:\Users\{user name}\.ant\tempcache\NetRexx.zip

BUILD FAILED
C:\source_code\apache-ant-1.8.3\fetch.xml:328: Can't get ftp://ftp.software.ibm.
com/software/awdtools/netrexx/NetRexx.zip to C:\Users\{user name}\.ant\tempcache\NetRe
xx.zip

Total time: 49 seconds

=====================================

2012 年 5 月 6 日 13:33 更新

このスニペットを読んで、2 つの環境変数 (ANT_HOME と JAVA_HOME) の末尾に「\」を付けたことに気付きました。あなたにはそれができないと思います。私の悪い。

Windows 注:

「ant.bat スクリプトは、ANT_HOME、CLASSPATH、および JAVA_HOME の 3 つの環境変数を使用します。ANT_HOME および JAVA_HOME 変数が設定されていること、およびそれらに引用符 (' または ") が含まれていないこと、および \ またはで終わっていないことを確認してください。 /。CLASSPATH は設定されていないか空である必要があります。」

  • 環境変数を変更したため、Windows の「cmd」ウィンドウを再度開く必要がありました。

以前の方がうまくいったようです。以下ではあまり機能していないことに注意してください。それはまだ失敗しています。または、前回の実行時にそれらが見つかったため、それらを必要としない可能性があります。

C:\Windows\system32>cd %ANT_HOME%

C:\source_code\apache-ant-1.8.3>ant -f fetch.xml -Ddest=system
Buildfile: C:\source_code\apache-ant-1.8.3\fetch.xml

pick-dest:
     [echo] Downloading to C:\source_code\apache-ant-1.8.3\lib

probe-m2:

download-m2:

dont-validate-m2-checksum:

validate-m2-checksum:

checksum-mismatch:

checksum-match:

get-m2:

macros:

init:

logging:

junit:

xml:

networking:

regexp:

antlr:

bcel:

jdepend:

bsf:

debugging:

jruby:

beanshell:

rhino:

script:

javamail:

jspc:
[artifact:dependencies] Downloading: tomcat/jasper-compiler/4.1.36/jasper-compil
er-4.1.36.pom
[artifact:dependencies] [WARNING] Unable to get resource from repository remote
(http://repo1.maven.org/maven2/)
[artifact:dependencies] Downloading: tomcat/jasper-compiler/4.1.36/jasper-compil
er-4.1.36.pom
[artifact:dependencies] [WARNING] Unable to get resource from repository central
 (http://repo1.maven.org/maven2)
[artifact:dependencies] Downloading: tomcat/jasper-runtime/4.1.36/jasper-runtime
-4.1.36.pom
[artifact:dependencies] [WARNING] Unable to get resource from repository remote
(http://repo1.maven.org/maven2/)
[artifact:dependencies] Downloading: tomcat/jasper-runtime/4.1.36/jasper-runtime
-4.1.36.pom
[artifact:dependencies] [WARNING] Unable to get resource from repository central
 (http://repo1.maven.org/maven2)

jai:

nonm2-macros:

init-no-m2:

init-cache:

-setup-temp-cache:

-fetch-netrexx:
      [ftp] getting files

BUILD FAILED
C:\source_code\apache-ant-1.8.3\fetch.xml:325: The following error occurred whil
e executing this line:
C:\source_code\apache-ant-1.8.3\fetch.xml:144: java.net.SocketException: Permiss
ion denied: recv failed
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:150)
        at java.net.SocketInputStream.read(SocketInputStream.java:121)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:273)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
        at org.apache.commons.net.telnet.TelnetInputStream.__read(TelnetInputStr
eam.java:114)
        at org.apache.commons.net.telnet.TelnetInputStream.run(TelnetInputStream
.java:535)
        at java.lang.Thread.run(Thread.java:722)

Total time: 4 seconds
4

2 に答える 2

1

Apache Ant は、実際のスタック トレースをうまく表示できません。そのため、Java でも実行できる Ant の問題のトラブルシューティングについては、Java からデバッグします。私の例では、このコードを実行することでトラブルシューティングを行うことができました。これを機能させるには、「sqljdbc_auth.dll」を実行ディレクトリに配置する必要があります。これは、i2b2 ユーザーのアクセス許可を許可していることを前提としています。

import java.sql.*;

public class TestConnection
{
    public static void main(String[] args)
    {
        DB db = new DB();
        db.dbConnect("jdbc:sqlserver://LAPTOP-INSPIRON\\SQLEXPRESS:1435;databaseName=i2b2_demo;integratedSecurity=true;","i2b2","i2b2");
    }
}

class DB
{
    public DB() {}

    public void dbConnect(String db_connect_string, String db_userid, String db_password)
    {
        try
        {
            Connection conn = DriverManager.getConnection(db_connect_string, db_userid, db_password);
            System.out.println("connected");
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }
};

i2b2 オントロジー データベースを構築するために必要な手順:

(1) すべてのプログラム > SQL Server 2008 R2 Express > 構成ツール > SQL Server 構成マネージャー (SSCM) > インスタンス TCP/IP プロトコルを右クリック > 有効化を選択

(2) SSCM - TCP/IP プロパティ > IP アドレス (タブ) > IP2 を設定 (セクション) > IP アドレスをローカル IP アドレス (例: 192.168.1.101)

(3) SSCM - TCP/IP プロパティ > IP アドレス (タブ) > IPAll (セクション) > 動的ポートの削除

(4) SSCM - TCP/IP プロパティ > IP アドレス (タブ) > IPAll (セクション) > 1435 の静的ポートを追加 (デフォルトは 1433 ですが、そこに 2 つのインスタンスがありました)

(5) JDBC - SQL Server 2008 に接続する場合は、JDBC に apache ant jar ファイルを使用しないでください。代わりに、JDBC バージョン 4 をダウンロードし、「sqljdbc.jar」を使用してから、それを build.xml クラスパス jar リストで使用します。

(6) JDBC - 「sqljdbc_auth.dll」を次のフォルダー (ant run ディレクトリ内) に配置します。

C:\source_code\i2b2\i2b2createdb-1602\edu.harvard.i2b2.data\Release_1-6\NewInstall\{folder}\

(7) JDBC - 別のマシンからこの SQL ボックスに接続している場合は、TCP のポート (1433、1434、1435 ... または選択したもの) を許可するファイアウォール受信ルールを作成します。

(8) JDBC - 接続文字列

db.url=jdbc:sqlserver://LAPTOP-INSPIRON\\SQLEXPRESS:1435;databaseName=i2b2_demo;

(9) Apache Ant のダウンロード - バイナリを使用する場合は、「ビルド インストール」を呼び出す必要はありません。その場合は、10-12 を飛ばしてください。src ファイルのダウンロードを選択した場合は、「ビルド インストール」を実行する前に 3 つのことを行います。そうしないと、「ビルド成功」ではなく「ビルド失敗」と表示されます。

(10) "build install" - build.xml (元の名前は "data_build.xml") のライト リストから test-jar を削除しました。

  <target name="dist-lite"
    depends="jars,test-jar"

to

  <target name="dist-lite"
    depends="jars"

(11) "build install" - "lib" フォルダーの下に "optional" というフォルダーを追加します。

(12)「ビルドインストール」 - ここの答えに従ってください:

Apache Ant インストール バグの回避策

(13) 取得処理 - 「ant -f fetch.xml -Ddest=system」を実行

(14) Ant コマンド - この「ant create_workdata_tables_release_1-6」を実行します。つまり、-f を使用しないでください。「data_build.xml」を「build.xml」に名前変更したくない場合は、- を使用します。 buildfile (-f ではない) パラメーターに、ビルド ファイルのパスとファイル名を指定します。

(15) データベースが正しく構築されるように、コマンドを正しい順序で実行します。そうでない場合は、最初からやり直してください。

参考までに: Red Gate SQL Compare ツールと Red Gate SQL Data Compare ツールを使用していれば、これはずっと簡単だったでしょう。

于 2012-05-07T04:59:32.277 に答える