0 0

熟悉ant的帮忙看下,执行这个build.xml时一直报错,connection time out5

<project name="migrate to mybatis3" basedir="." default="migrateToMyBatis3">
	<target name="migrateToMyBatis3">
		<!-- delete possible results from previous run -->
		<delete>
		    <fileset dir="destination" includes="*.xml"/>
		  </delete>
		<!-- xslt convert sqlMaps 2 to mybatis 3 -->
		<xslt basedir="source" style="migrate.xslt" includes="*.xml" destdir="destination" extension=".xml"/>
		<!-- replace #id:NUMERIC# to #id,jdbcType=NUMERIC# etc. -->
		<replace dir="destination" includes="*.xml" token=":NUMERIC#" value=",jdbcType=NUMERIC#" encoding="UTF8"/>
		<replace dir="destination" includes="*.xml" token=":TIMESTAMP#" value=",jdbcType=TIMESTAMP#" encoding="UTF8"/>
		<replace dir="destination" includes="*.xml" token=":VARCHAR#" value=",jdbcType=VARCHAR#" encoding="UTF8"/>
		<replace dir="destination" includes="*.xml" token=":BLOB#" value=",jdbcType=BLOB#" encoding="UTF8"/>
		<!-- add any needed jdbc type here (for example :CLOB#, :FLOAT#, :REAL#, :BIT#, :INTEGER#, :DECIMAL#, :DATE#, :TIME#, .... ) 
		<replace dir="destination" includes="*.xml" token=":???#" value=",jdbcType=???#" encoding="UTF8"/>
		-->
		<!-- replace $id$ with ${id} -->
		<replaceregexp match="\$([a-zA-Z0-9.\[\]_]+)\$" replace="$\{\1}" flags="mg" byline="false" encoding="UTF8">
		    <fileset dir="destination" includes="*.xml" />
		</replaceregexp>
		<!-- replace #id# with #{id} -->
		<replaceregexp match="#([a-zA-Z0-9,_.=\[\]]{2,})#" replace="#{\1}" flags="mg" byline="false" encoding="UTF8">
		    <fileset dir="destination" includes="*.xml" />
		</replaceregexp>
		<!-- replace xyz[] with item for use in iterators-->
		<replaceregexp match="[a-z.]{2,}\[\]" replace="item" flags="ig" encoding="UTF8">
		    <fileset dir="destination" includes="*.xml" />
		</replaceregexp>

		<xmlvalidate failonerror="yes" lenient="false" warn="yes">
				<attribute name="http://apache.org/xml/features/validation/schema"  value="false" />
				<attribute name="http://xml.org/sax/features/namespaces" value="false" />
			<fileset dir="destination" includes="*.xml" />
			<dtd publicId="-//mybatis.org//DTD SQL Map Config 3.0//EN" location="mybatis-3-config.dtd" />
			<dtd publicId="-//mybatis.org//DTD Mapper 3.0//EN" location="mybatis-3-mapper.dtd" />
		</xmlvalidate>

	</target>
</project>

 背景是:项目的jar包升级,从ibatis2升级到mybatis3,我从google code下载了这个build文件,搭建了ant环境,但是用ant编译的时候报错,connection time out。请大家帮忙看看,谢谢

1.ant环境应该没错

2.开始执行

3.报错:

4.看下文档目录

 

请各位大牛帮忙看下,多谢了


问题补充:这个代码是从google code 下的,用来将ibatis2.X的xml文档转化为mybatis3.X的xml。 <br />可是注释掉了那些链接甚至删除掉那些链接还是报这个错。connection time out <br /><div class="quote_title">renpeng301 写道</div><div class="quote_div"><img src="/images/smiles/icon_redface.gif"/> 这个build.xml怎么这么复杂????? <br /> <br />这个链接超时 是不是某些下载链接 无法链接下载啊???</div> <br />

问题补充:使用ant -v命令得到了下面的错误信息。 <br />Apache resolver library not found, internal resolver will be used <br />[img]http://dl.iteye.com/upload/picture/pic/96204/150b3988-35c5-3318-9387-f39f2cfadf6f.png <br />[/img] <br /><div class="quote_title">suziwen 写道</div><div class="quote_div">执行 ANT -V查看详细信息</div> <br />

问题补充:下载resolver.jar和xml-commons-resolver-1.1同时放到jre\lib和ant\lib下。分别试了这2个jar包,还是不行。仍然是同样的错误。 <br /><div class="quote_title">renpeng301 写道</div><div class="quote_div"><pre name="code" class="java">
C�lio Cidral Junior wrote on Thu, 06 Apr 2006 19:48:23 GMT:
&gt; I'm trying to run a build script which has a target that uses the
&gt; &lt;style&gt; task and references an external &lt;xmlcatalog&gt;, but Ant is
&gt; giving me the warning message below.
&gt;
&gt;    Apache resolver library not found, internal resolver will be used
&gt;    Warning: catalogpath listing external catalogs will be ignored
&gt;
&gt; I've Googled a lot about this problem and couldn't find any helpful
&gt; information, except this thread:
&gt; http://www.ant-tasks.com/msg/14363.html

Hello,

I got the same error message today and solved it. So I am posting
some comments on this issue for the archive:

The original author's problem has been probably caused by the fact that
he was using xml-commons-resolver-1.0 in the classpath. The Ant
documentation explicitly mentions that you should use
xml-commons-resolver-1.1:
http://ant.apache.org/manual/CoreTypes/xmlcatalog.html

My own problem was caused by myself having put the correct version
of resolver.jar into JDK's jre/lib/endorsed directory (because I upgraded
Xalan and it appeared to pick it up all right from there). For some reason,
if resolver.jar is visible to the classloader for jre/lib/endorsed, Ant
will not be able to use it, EVEN if you add it to the Ant classpath.

Regards,
Jan Ploski



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
</pre></div> <br />

问题补充:解决了,第一个问题是我的目录缺少这个jar包,第二个原因是使用ant -d命令查看到的.我要转换的xml文件用的还是 <br />&lt;!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd"&gt;修改完这2个地方之后虽然还是有warning,但是已经可以实现转换了,谢谢您的提醒。 <br /> <br /><div class="quote_title">suziwen 写道</div><div class="quote_div">执行 ANT -V查看详细信息</div> <br />
2011年8月05日 08:55

3个答案 按时间排序 按投票排序

0 0

采纳的答案

执行 ANT -V查看详细信息

2011年8月05日 12:07
0 0

C�lio Cidral Junior wrote on Thu, 06 Apr 2006 19:48:23 GMT:
> I'm trying to run a build script which has a target that uses the
> <style> task and references an external <xmlcatalog>, but Ant is
> giving me the warning message below.
>
>    Apache resolver library not found, internal resolver will be used
>    Warning: catalogpath listing external catalogs will be ignored
>
> I've Googled a lot about this problem and couldn't find any helpful
> information, except this thread:
> http://www.ant-tasks.com/msg/14363.html

Hello,

I got the same error message today and solved it. So I am posting
some comments on this issue for the archive:

The original author's problem has been probably caused by the fact that
he was using xml-commons-resolver-1.0 in the classpath. The Ant
documentation explicitly mentions that you should use
xml-commons-resolver-1.1:
http://ant.apache.org/manual/CoreTypes/xmlcatalog.html

My own problem was caused by myself having put the correct version
of resolver.jar into JDK's jre/lib/endorsed directory (because I upgraded
Xalan and it appeared to pick it up all right from there). For some reason,
if resolver.jar is visible to the classloader for jre/lib/endorsed, Ant
will not be able to use it, EVEN if you add it to the Ant classpath.

Regards,
Jan Ploski



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

2011年8月05日 15:04
0 0

这个build.xml怎么这么复杂?????

这个链接超时 是不是某些下载链接 无法链接下载啊???

2011年8月05日 11:12

相关推荐

Global site tag (gtag.js) - Google Analytics