浏览 3092 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2010-07-30
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Illegal @PersistenceUnit on protected javax.persistence.EntityManager com.ejb3.base.EntityManagerDao.em :There is no default persistence unit in this deployment. at org.jboss.ejb3.deployers.EJBStage2Deployer.deploy(EJBStage2Deployer.java:57) at org.jboss.ejb3.deployers.EJBStage2Deployer.deploy(EJBStage2Deployer.java:37) at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:65) at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50) at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169) ... 22 more <?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> 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2010-07-30
同时我还配置了persistence.xml文件和EntityManager
请教高手们怎么修改build.xml文件能正常将Ejb3.0组件部署成功 |
|
返回顶楼 | |