下面是 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:Sourcei2b2i2b2createdb-1602edu.harvard.i2b2.dataRelease_1-6NewInstallMetadata>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.
我看到 XML 文件中列出的实际 *.sql 文件,我猜它们以特定方式排序,以便关联的(包含主键(首先将数据加载到其中,而桥/父/所有者/基表(包含外键(最后运行,因为它们依赖于关联的表。 如果所有其他方法都失败了,我可能可以直接按照列出的顺序从 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>
====
===================================更新 5/6/2012 @ 6:52am:
SQL Server Management Studio 安装程序:
- SQL Server Management Studio>创建名为"i2b2_demo"的新数据库
安装 Oracle JDK:
- http://docs.oracle.com/javase/7/docs/webnotes/install/windows/jdk-installation-windows.html
安装 Apache Ant:
- 下载二进制文件 http://ant.apache.org/
- 导航到此路径以获取安装说明:手动>安装 Apache Ant>获取 Ant>..按照说明进行操作
- 将解压缩的文件夹(包含 bin 文件夹(移动到 %ANT_HOME% 环境变量中使用的
C:source_codeapache-ant-1.8.3
或目录中
Windows 7 环境变量设置 Java 和 Ant:
Windows 7>控制面板> 系统>单击"环境变量"按钮>
(不要忘记尾随的"\"( *[MacGyver 5/6/2012 @2:45pm - 忽略这个...删除尾随的"\"字符...请参阅我在下面的问题中的评论]
在"系统变量"部分下,单击"添加">变量名称:JAVA_HOME
变量值:C:Program FilesJavajdk1.7.0_02
在"系统变量"部分下,单击"添加">变量名称:ANT_HOME
变量值:C:source_codeapache-ant-1.8.3
路径"环境变量,单击"编辑">变量名称:Path
变量值:{value before editing};%JAVA_HOME%bin;%ANT_HOME%bin;
重新启动命令提示符(以管理员身份运行(
将每个
C:source_codei2b2i2b2createdb-1602edu.harvard.i2b2.dataRelease_1-6NewInstall{folder}db.properties
文件替换为适当的值。 将"?"替换为正确的值。
"db.properties" 文件:
db.type=sqlserver
db.username=?
db.password=?
db.server=LAPTOP-INSPIRONSQLEXPRESS
db.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
db.url=jdbc:sqlserver:LAPTOP-INSPIRONSQLEXPRESS;databasename=i2b2_demo
db.project=demo
收到此错误:
C:source_codei2b2i2b2createdb-1602edu.harvard.i2b2.dataRelease_1-6NewInsta
llCrcdata>ant -f data_build.xml upgrade_metadata_tables_release_1-6
Buildfile: build.xml does not exist!
Build failed
====
===================================更新 5/6/2012 @ 7:33am ...发现此页面有该错误...
安装蚂蚁:
单击此按钮:http://ant.apache.org/manual/index.html
或。。。
导航到安装 Apache Ant http://ant.apache.org/>手册>>安装 Ant>
C:source_codeapache-ant-1.8.3>ant -version
Apache Ant(TM) version 1.8.3 compiled on February 26 2012
C:source_codeapache-ant-1.8.3>ant -f fetch.xml
Buildfile: C:source_codeapache-ant-1.8.3fetch.xml
pick-dest:
BUILD FAILED
C:source_codeapache-ant-1.8.3fetch.xml:70: ERROR
Set -Ddest=LOCATION on the command line
-Ddest=user user lib dir C:UsersKeith/.ant/lib
-Ddest=system ant lib dir C:source_codeapache-ant-1.8.3/lib
-Ddest=optional optional dir ${basedir}/lib/optional (for Ant developers)
Total time: 0 seconds
C:source_codeapache-ant-1.8.3>build install
'build' is not recognized as an internal or external command,
operable program or batch file.
......然后注意到我错过了命令上的参数。不过它仍然失败了!
C:source_codeapache-ant-1.8.3>ant -f fetch.xml -Ddest=system
Buildfile: C:source_codeapache-ant-1.8.3fetch.xml
pick-dest:
[echo] Downloading to C:source_codeapache-ant-1.8.3lib
probe-m2:
download-m2:
[echo] Downloading to C:source_codeapache-ant-1.8.3lib
[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_codeapache-ant-1.8.3libmaven-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_codeapache-ant-1.8.3lib
[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_codeapache-ant-1.8.3lib
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_codeapache-ant-1.8.3lib
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_codeapache-ant-1.8.3lib
[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_codeapache-ant-1.8.3lib
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_codeapache-ant-1.8.3lib
[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_codeapache-ant-1.8.3lib
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_codeapache-ant-1.8.3lib
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_codeapache-ant-1.8.3lib
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_codeapache-ant-1.8.3lib
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_codeapache-ant-1.8.3lib
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_codeapache-ant-1.8.3lib
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_codeapache-ant-1.8.3lib
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_codeapache-ant-1.8.3lib
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_codeapache-ant-1.8.3lib
[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_codeapache-ant-1.8.3lib
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_codeapache-ant-1.8.3lib
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_codeapache-ant-1.8.3lib
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_codeapache-ant-1.8.3lib
[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_codeapache-ant-1.8.3lib
[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_codeapache-ant-1.8.3lib
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_codeapache-ant-1.8.3lib
[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_codeapache-ant-1.8.3lib
nonm2-macros:
init-no-m2:
init-cache:
-setup-temp-cache:
[mkdir] Created dir: C:Users{user name}.anttempcache
-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}.anttempcacheNetRexx.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}.anttempcacheNetRexx.zip
BUILD FAILED
C:source_codeapache-ant-1.8.3fetch.xml:328: Can't get ftp://ftp.software.ibm.
com/software/awdtools/netrexx/NetRexx.zip to C:Users{user name}.anttempcacheNetRe
xx.zip
Total time: 49 seconds
====
===================================更新 5/6/2012 @ 1:33pm
我读了这个片段,意识到我把"\"放在两个环境变量(ANT_HOME和JAVA_HOME(的末尾。 我想你不能那样做。 我的坏。
视窗注:
"ant.bat 脚本使用了三个环境变量 - ANT_HOME、CLASSPATH 和 JAVA_HOME。确保设置了 ANT_HOME 和 JAVA_HOME 变量,并且它们没有引号(' 或 "(,并且它们不以 \ 或/结尾。CLASSPATH 应为未设置或为空。
- 再一次,我不得不重新打开我的 Windows"cmd"窗口,因为我进行了这些环境变量更改。
似乎以前效果更好。 请注意,它在下面没有做太多事情。 它仍然失败。 或者也许它不需要它们,因为它从上次运行中找到了它们。
C:Windowssystem32>cd %ANT_HOME%
C:source_codeapache-ant-1.8.3>ant -f fetch.xml -Ddest=system
Buildfile: C:source_codeapache-ant-1.8.3fetch.xml
pick-dest:
[echo] Downloading to C:source_codeapache-ant-1.8.3lib
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_codeapache-ant-1.8.3fetch.xml:325: The following error occurred whil
e executing this line:
C:source_codeapache-ant-1.8.3fetch.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
似乎 Ant 根本没有安装在您的计算机上。所以我认为你必须下载并安装它:
http://ant.apache.org/
http://ant.apache.org/manual/index.html
Apache Ant在显示实际的堆栈跟踪方面做得不是很好。 因此,对于 Ant 问题进行故障排除,也可以在 Java 中完成,从 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 Server2008 R2 Express> Configuration Tools>> SQL Server Configuration Manager (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,但我有两个实例(
(5( JDBC - 如果连接到SQL Server 2008,则不要将Apache ant jar文件用于JDBC..而是下载JDBC版本4并使用"sqljdbc.jar",然后在构建中使用它.xml类路径jar列表
(6( JDBC - 将"sqljdbc_auth.dll"放在这些文件夹中(在 ant run 目录内(:
C:source_codei2b2i2b2createdb-1602edu.harvard.i2b2.dataRelease_1-6NewInstall{folder}
(7( JDBC - 如果要从另一台计算机连接到此 SQL 盒,请创建防火墙传入规则以允许端口(1433、1434 或 1435 ...或任何你选择的(的TCP。
(8( JDBC - 连接字符串
db.url=jdbc:sqlserver://LAPTOP-INSPIRON\SQLEXPRESS:1435;databaseName=i2b2_demo;
(9( Apache Ant 下载 - 如果您选择使用二进制文件,则无需调用"build install"。 在这种情况下,请跳过 10-12。 如果您选择下载 src 文件,您将在运行"构建安装"之前做 3 件事,否则它会说"构建失败"而不是"构建成功">
(10( "build install" - 从 build.xml 的精简列表中删除 test-jar(原名为 "data_build.xml"(
<target name="dist-lite"
depends="jars,test-jar"
to
<target name="dist-lite"
depends="jars"
(11( "构建安装" - 在"lib"文件夹下添加一个名为"可选"的文件夹
(12( "构建安装" - 按照这里的答案:
Apache Ant 安装错误的解决方法
(13( 获取过程 - 运行 "ant -f 获取.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数据比较工具,这会容易得多。