我配置的ant,build.xml文件用于导入到EJB
2010-07-30 16:23
351 查看
当我配置了Spring 以后,这些配置就不起作用了,deploy时报错:
There is no default persistence unit in this deployment
实际上注释使用persistenceContext注入entityManager时,使用Spring不需要指定其属性unitName的值,已经在配置文件中指定了。
<?xml version="1.0" encoding="UTF-8"?>
<project name="Ejb3.0Test" basedir=".">
<property name="src.dir" value="${basedir}/src" />
<property environment="env" />
<property name="jboss.home" value="${env.JBOSS_HOME}" />
<property name="jboss.server.config" value="${jboss.home}/server/default" />
<property name="jboss.server.deploy" value="${jboss.server.config}/deploy" />
<property name="build.dir" value="${basedir}/build" />
<path id="build.classpath">
<fileset dir="${jboss.home}/client">
<include name="*.jar" />
</fileset>
<pathelement location="${build.dir}" />
</path>
<target name="prepare">
<delete dir="${build.dir}" />
<mkdir dir="${build.dir}" />
</target>
<target name="compile" depends="prepare" description="编译">
<javac srcdir="${src.dir}" destdir="${build.dir}">
<classpath refid="build.classpath" />
</javac>
</target>
<target name="ejbjar" depends="compile" description="创建Ejb发布包">
<jar jarfile="${basedir}/${ant.project.name}.jar">
<fileset dir="${build.dir}">
<include name="**/*.class" />
</fileset>
</jar>
</target>
<target name="deploy" depends="ejbjar" description="发布Ejb">
<copy file="${basedir}/${ant.project.name}.jar" todir="${jboss.server.deploy}" />
</target>
<target name="undeploy" description="卸载Ejb">
<delete file="${jboss.home}/server/${jboss.server.config}/deploy" />
</target>
</project>
There is no default persistence unit in this deployment
实际上注释使用persistenceContext注入entityManager时,使用Spring不需要指定其属性unitName的值,已经在配置文件中指定了。
<?xml version="1.0" encoding="UTF-8"?>
<project name="Ejb3.0Test" basedir=".">
<property name="src.dir" value="${basedir}/src" />
<property environment="env" />
<property name="jboss.home" value="${env.JBOSS_HOME}" />
<property name="jboss.server.config" value="${jboss.home}/server/default" />
<property name="jboss.server.deploy" value="${jboss.server.config}/deploy" />
<property name="build.dir" value="${basedir}/build" />
<path id="build.classpath">
<fileset dir="${jboss.home}/client">
<include name="*.jar" />
</fileset>
<pathelement location="${build.dir}" />
</path>
<target name="prepare">
<delete dir="${build.dir}" />
<mkdir dir="${build.dir}" />
</target>
<target name="compile" depends="prepare" description="编译">
<javac srcdir="${src.dir}" destdir="${build.dir}">
<classpath refid="build.classpath" />
</javac>
</target>
<target name="ejbjar" depends="compile" description="创建Ejb发布包">
<jar jarfile="${basedir}/${ant.project.name}.jar">
<fileset dir="${build.dir}">
<include name="**/*.class" />
</fileset>
</jar>
</target>
<target name="deploy" depends="ejbjar" description="发布Ejb">
<copy file="${basedir}/${ant.project.name}.jar" todir="${jboss.server.deploy}" />
</target>
<target name="undeploy" description="卸载Ejb">
<delete file="${jboss.home}/server/${jboss.server.config}/deploy" />
</target>
</project>
相关文章推荐
- ANT 发布项目中 build.xml 文件的详细配置
- ANT 发布项目中 build.xml 文件的详细配置
- Ant的项目配置文件build.xml(使用jboss-4.2.3GA-jdk6.zip)
- Ant配置文件build.xml示例
- Eclipse 自动生成 Ant的Build.xml 配置文件
- Ant配置文件build.xml
- Ant 中的build.xml配置文件生成报告、发邮件完整版
- ANT 发布项目中 build.xml 文件的详细配置
- ant创建 发布 EJB build.xml 文件的编写
- ant的配置文件build.xml范例
- Ant 中的build.xml配置文件生成报告、发邮件完整版
- 利用ant和XDOCLET生成Hibernate3配置文件和映射文件的BUILD.XML
- Eclipse 自动生成 Ant的Build.xml 配置文件
- 【转载】Eclipse 自动生成 Ant的Build.xml 配置文件
- Ant配置文件build.xml
- Ant build.xml 配置文件详解
- ANT 发布项目中 build.xml 文件的详细配置
- ANT 发布项目中 build.xml 文件的详细配置
- Ant build.xml文件详解
- EJB2.0 ejb-jar.xml配置文件详解