蚂蚁+冷泉
我正在使用新的 cfbuilder 并使用 ANT 将我的代码推送到我的开发服务器。不断出现的一个问题是,当我对 beans.xml 文件进行更改时,我的 ant 构建会在 beans.xml 文件上引发异常。
这是我得到的异常:
BUILD FAILED
C:\workingcopies\bpmMag\config\beans.xml:3: Unexpected element "{}beans" {antlib:org.apache.tools.ant}beans
这是我的构建文件:
<?xml version="1.0" encoding="UTF-8"?>
<project name="build" default="" basedir=".">
<description>
A description of what this build file does
</description>
<!-- Location of working Copy -->
<property name="workingCopy" value="C:\workingcopies\bpmMag" />
<!-- Location of testing server -->
<property name="testServer" value="Z:\www\dev7.devstation\htdocs" />
<!-- Test Target -->
<target name="test">
<copy todir="${testServer}">
<fileset dir="${workingCopy}">
<exclude name="coldspring/**"/>
<exclude name="**/*.project"/>
<exclude name="settings.xml"/>
<exclude name=".settings/**"/>
<exclude name="build.xml"/>
</fileset>
</copy>
</target>
这是我的 beans.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans>
<!-- Advice Beans -->
<bean id="AdviceDAO" class="com.model.advice.dao.AdviceDAO">
<constructor-arg name="dsn"><value>${dsn}</value></constructor-arg>
</bean>
<bean id="AdviceGateway" class="com.model.advice.gateway.AdviceGW">
<constructor-arg name="dsn"><value>${dsn}</value></constructor-arg>
</bean>
<bean id="AdviceService" class="com.model.advice.service.AdviceSV">
<constructor-arg name="adviceDAO">
<ref bean="adviceDAO"/>
</constructor-arg>
<constructor-arg name="adviceGateway">
<ref bean="adviceGateway"/>
</constructor-arg>
</bean>
</beans>
I am working with the new cfbuilder and using ANT to push my code to my dev server. One issue that keeps cropping up is when I make changes to my beans.xml file my ant build throws an exception on my beans.xml file.
This is the exception that I get:
BUILD FAILED
C:\workingcopies\bpmMag\config\beans.xml:3: Unexpected element "{}beans" {antlib:org.apache.tools.ant}beans
Here is my build file:
<?xml version="1.0" encoding="UTF-8"?>
<project name="build" default="" basedir=".">
<description>
A description of what this build file does
</description>
<!-- Location of working Copy -->
<property name="workingCopy" value="C:\workingcopies\bpmMag" />
<!-- Location of testing server -->
<property name="testServer" value="Z:\www\dev7.devstation\htdocs" />
<!-- Test Target -->
<target name="test">
<copy todir="${testServer}">
<fileset dir="${workingCopy}">
<exclude name="coldspring/**"/>
<exclude name="**/*.project"/>
<exclude name="settings.xml"/>
<exclude name=".settings/**"/>
<exclude name="build.xml"/>
</fileset>
</copy>
</target>
Here is my beans.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans>
<!-- Advice Beans -->
<bean id="AdviceDAO" class="com.model.advice.dao.AdviceDAO">
<constructor-arg name="dsn"><value>${dsn}</value></constructor-arg>
</bean>
<bean id="AdviceGateway" class="com.model.advice.gateway.AdviceGW">
<constructor-arg name="dsn"><value>${dsn}</value></constructor-arg>
</bean>
<bean id="AdviceService" class="com.model.advice.service.AdviceSV">
<constructor-arg name="adviceDAO">
<ref bean="adviceDAO"/>
</constructor-arg>
<constructor-arg name="adviceGateway">
<ref bean="adviceGateway"/>
</constructor-arg>
</bean>
</beans>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是你的整个构建文件吗?因为它缺少结束项目标签,所以
我复制了 beans.xml 和 build.xml,添加了结束项目标签,设置了一组模拟目录,并且它按我的预期工作(即没有 {} beans.... 错误)
Is that your entire build file? Because it's missing the closing project tag
I copied your beans.xml and build.xml, added the end project tag, set up a simulation set of directories, and it worked as expected for me (i.e. no {} beans.... error)