aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes ejb upgrade - how to remove xdoclet and ejbdoclet templates? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "ejb upgrade - how to remove xdoclet and ejbdoclet templates?" Watch "ejb upgrade - how to remove xdoclet and ejbdoclet templates?" New topic
Author

ejb upgrade - how to remove xdoclet and ejbdoclet templates?

prashant gandhi
Greenhorn

Joined: May 21, 2013
Posts: 18
hi friends,

we are using ejb 2.0, want to upgrade the code to ejb 3.1.

in my current code, lot of .java files are being automatically generated using xdoclet and ejbdoclet; i see reference to these xdoclet and ejbdoclets in my build.xml file. when i remove these xdoclet and ejbdoclet code from build.xml, the application does not compile any longer (using eclipse / ant ).

i want to make changes to xdoctlet templates or get rid of these xdoclet and ejbdoclet references. how do i do this? what are the xdoclet/ejbdoclet templates look like? i dont want it to auto generate it at compile time, since these .java files (session bean is: JobConfigSessionBean.java - the autogenerated code using xdoclet is: JobConfigSession.java, JobConfigSessionHome.java, JobConfigSessionLocal.java and JobConfigSessionLocalHome.java -- for example). At ejb 3.x i dont need all these files.

below is my current build.xml file. Any help is appreciated. Thanks for your help. - is there anywhere else also i should be looking at? my web application name is DTU.




<?xml version="1.0" ?>
- <!-- =======================================================================
-->
- <!-- DTU JBoss build file
-->
- <!-- =======================================================================
-->
- <project name="MPE2UNIX" default="package-all" basedir=".">
<property environment="env" />
<property name="src.dir" value="${basedir}/src" />
<property name="junit.dir" value="${basedir}/junit" />
<property name="jboss.home" value="${env.JBOSS_HOME}" />
<property name="build.dir" value="${basedir}/build" />
<property name="build.classes.dir" value="${build.dir}/classes" />
<property name="build.ejb.dd" value="${build.dir}/ejb" />
<property name="build.ejb-unix.dd" value="${build.dir}/ejb-unix" />
<property name="build.web.dd" value="${build.dir}/web" />
<property name="schemas.dir" value="${basedir}/schemas" />
<property name="xdoclet.lib.dir" value="${basedir}/lib/xdoclet" />
<property name="generated.java.dir" value="gen-src/java" />
<property name="version" value="2.1" />
<taskdef name="xmlbean" classname="org.apache.xmlbeans.impl.tool.XMLBean" classpath="${basedir}/lib/xbean.jar" />
- <!-- ===================================================================
-->
- <!-- Build classpath
-->
- <!-- ===================================================================
-->
- <path id="classpath">
- <fileset dir="${jboss.home}/client">
<include name="**/*.jar" />
</fileset>
- <fileset dir="${jboss.home}/server/default/deploy/jbossweb-tomcat50.sar">
<include name="**/*.jar" />
</fileset>
- <fileset dir="${jboss.home}/server/default/lib">
<include name="*.jar" />
</fileset>
- <fileset dir="${xdoclet.lib.dir}">
<include name="*.jar" />
</fileset>
<pathelement location="${build.classes.dir}" />
<pathelement location="${basedir}/lib/xbean.jar" />
<pathelement location="${basedir}/lib/xbean_xpath.jar" />
<pathelement location="${basedir}/lib/jaxen-1.1-beta2.jar" />
<pathelement location="${basedir}/lib/commons-net-1.2.2.jar" />
<pathelement location="${basedir}/lib/commons-io-1.0.jar" />
<pathelement location="${basedir}/lib/jakarta-oro-2.0.8.jar" />
<pathelement location="${generated.java.dir}" />
<pathelement location="${basedir}/lib/junit-3.8.1.jar" />
<pathelement location="${basedir}/lib/commons-cli-1.0.jar" />
</path>
- <!-- ===================================================================
-->
- <!-- Initialize
-->
- <!-- ===================================================================
-->
- <target name="init">
- <tstamp>
<format property="TODAY" pattern="d-MM-yy" />
</tstamp>
- <tstamp>
<format pattern="MMMM d, yyyy hh:mm aa" property="BUILD_DATE" />
</tstamp>
</target>
- <target name="init-tasks">
<taskdef name="ejbdoclet" classname="xdoclet.modules.ejb.EjbDocletTask" classpathref="classpath" />
</target>
- <!-- ===================================================================
-->
- <!-- Prepares the build directory
-->
- <!-- ===================================================================
-->
- <target name="prepare" depends="init">
<mkdir dir="${build.dir}" />
<mkdir dir="${build.dir}/dtu_wrapper" />
<mkdir dir="${build.classes.dir}" />
<mkdir dir="${build.dir}/ejb" />
<mkdir dir="${build.dir}/ejb/META-INF" />
<mkdir dir="${generated.java.dir}" />
</target>
- <!-- ===================================================================
-->
- <!-- Generate XMLBean wrappers
-->
- <!-- ===================================================================
-->
- <target name="generate-xml-wrappers" depends="prepare">
- <xmlbean classgendir="${build.classes.dir}" srcgendir="${generated.java.dir}" classpath="${basedir}/lib/xbean.jar" failonerror="true">
- <fileset dir="${schemas.dir}/">
<include name="job.xsd" />
<include name="job.xsdconfig" />
</fileset>
</xmlbean>
- <xmlbean classgendir="${build.classes.dir}" srcgendir="${generated.java.dir}" classpath="${basedir}/lib/xbean.jar" failonerror="true">
- <fileset dir="${schemas.dir}/">
<include name="userprefs.xsd" />
<include name="userprefs.xsdconfig" />
</fileset>
</xmlbean>
- <xmlbean classgendir="${build.classes.dir}" srcgendir="${generated.java.dir}" classpath="${basedir}/lib/xbean.jar" failonerror="true">
- <fileset dir="${schemas.dir}/">
<include name="fileexplorer.xsd" />
<include name="fileexplorer.xsdconfig" />
</fileset>
</xmlbean>
- <xmlbean classgendir="${build.classes.dir}" srcgendir="${generated.java.dir}" classpath="${basedir}/lib/xbean.jar" failonerror="true">
- <fileset dir="${schemas.dir}/">
<include name="pfdictionary.xsd" />
<include name="pfdictionary.xsdconfig" />
</fileset>
</xmlbean>
- <xmlbean classgendir="${build.classes.dir}" srcgendir="${generated.java.dir}" classpath="${basedir}/lib/xbean.jar" failonerror="true">
- <fileset dir="${schemas.dir}/">
<include name="validation.xsd" />
<include name="validation.xsdconfig" />
</fileset>
</xmlbean>
</target>
- <!-- ===================================================================
-->
- <!-- Run EJBDoclet
-->
- <!-- ===================================================================
-->
- <target name="ejbdoclet" depends="generate-xml-wrappers, init-tasks">
- <ejbdoclet destdir="${generated.java.dir}" excludedtags="@version,@author,@todo" addedtags="@xdoclet-generated at ${TODAY},Copyright (c) 2004 ACNielsen. All Rights Reserved.,@author Applied Visions Inc." ejbspec="2.0">
- <fileset dir="${src.dir}">
<include name="com/acnielsen/dtu/model/*/ejb/*Bean.java" />
<exclude name="com/acnielsen/dtu/model/unixservice/**" />
</fileset>
<packageSubstitution packages="model.jobconfigsession" substituteWith="common.interfaces" useFirst="true" />
<packageSubstitution packages="model.filelayoutsession" substituteWith="common.interfaces" useFirst="true" />
<packageSubstitution packages="model.fileservice" substituteWith="common.interfaces" useFirst="true" />
<packageSubstitution packages="model.jobservice" substituteWith="common.interfaces" useFirst="true" />
<packageSubstitution packages="model.loginservice" substituteWith="common.interfaces" useFirst="true" />
<packageSubstitution packages="model.userprofilesession" substituteWith="common.interfaces" useFirst="true" />
<packageSubstitution packages="model.validationservice" substituteWith="common.interfaces" useFirst="true" />
<remoteinterface />
<homeinterface />
<localinterface />
<localhomeinterface />
- <utilobject cacheHomes="true" kind="physical">
<packageSubstitution packages="model.jobconfigsession" substituteWith="common.util" useFirst="true" />
<packageSubstitution packages="model.filelayoutsession" substituteWith="common.util" useFirst="true" />
<packageSubstitution packages="model.fileservice" substituteWith="common.util" useFirst="true" />
<packageSubstitution packages="model.jobservice" substituteWith="common.util" useFirst="true" />
<packageSubstitution packages="model.loginservice" substituteWith="common.util" useFirst="true" />
<packageSubstitution packages="model.userprofilesession" substituteWith="common.util" useFirst="true" />
<packageSubstitution packages="model.validationservice" substituteWith="common.util" useFirst="true" />
</utilobject>
<deploymentdescriptor destdir="${build.dir}/ejb/META-INF" />
<jboss version="4.0" unauthenticatedPrincipal="nobody" xmlencoding="UTF-8" destdir="${build.ejb.dd}/META-INF" validatexml="true" preferredrelationmapping="relation-table" mergedir="dd/merge" />
</ejbdoclet>
</target>
- <target name="ejbdoclet-unix" depends="init-tasks">
- <ejbdoclet destdir="${generated.java.dir}" excludedtags="@version,@author,@todo" addedtags="@xdoclet-generated at ${TODAY},Copyright (c) 2004 ACNielsen. All Rights Reserved.,@author Applied Visions Inc." ejbspec="2.0">
- <fileset dir="${src.dir}">
<include name="com/acnielsen/dtu/model/unixservice/ejb/*Bean.java" />
</fileset>
<packageSubstitution packages="model.unixservice" substituteWith="common.interfaces" useFirst="true" />
<remoteinterface />
<homeinterface />
<localinterface />
<localhomeinterface />
- <utilobject cacheHomes="true" kind="physical">
<packageSubstitution packages="model.unixservice" substituteWith="common.util" useFirst="true" />
</utilobject>
<deploymentdescriptor destdir="${build.dir}/ejb-unix/META-INF" />
<jboss version="4.0" unauthenticatedPrincipal="nobody" xmlencoding="UTF-8" destdir="${build.ejb-unix.dd}/META-INF" validatexml="true" preferredrelationmapping="relation-table" />
</ejbdoclet>
</target>
- <!-- ===================================================================
-->
- <!-- Compiles the source code
-->
- <!-- ===================================================================
-->
- <target name="compile-ejb" depends="ejbdoclet, ejbdoclet-unix">
- <javac srcdir="${src.dir}" destdir="${build.classes.dir}" includes="**" excludes="com/acnielsen/dtu/web/**, com/acnielsen/dtu/dtuwrapper/**" debug="on" deprecation="on" optimize="off" classpathref="classpath">
<src path="${generated.java.dir}" />
</javac>
</target>
- <target name="compile-web">
- <javac srcdir="${src.dir}" destdir="${build.classes.dir}" includes="com/acnielsen/dtu/web/**" debug="on" deprecation="on" optimize="off" classpathref="classpath">
<src path="${generated.java.dir}" />
</javac>
</target>
- <target name="compile-wrapper">
- <javac srcdir="${src.dir}" destdir="${build.classes.dir}" includes="com/acnielsen/dtu/dtuwrapper/**, com/acnielsen/dtu/common/StreamGobbler.java" debug="on" deprecation="on" optimize="off" classpathref="classpath">
<src path="${generated.java.dir}" />
</javac>
</target>
- <target name="compile-tests">
<javac srcdir="${junit.dir}" destdir="${build.classes.dir}" debug="on" deprecation="on" optimize="off" includes="**" classpathref="classpath" />
</target>
- <!-- ===============================================================================
-->
- <!-- Package Data Transformation Wrapper application files into into dtu_wrapper.jar
-->
- <!-- ===============================================================================
-->
- <target name="package-dtu-wrapper" depends="prepare, compile-wrapper">
<delete file="${build.dir}/dtu_wrapper/dtu_wrapper.jar" />
- <jar jarfile="build/dtu_wrapper/dtu_wrapper.jar">
- <manifest>
<attribute name="Class-Path" value="./lib/commons-cli-1.0.jar" />
<attribute name="Main-Class" value="com.acnielsen.dtu.dtuwrapper.DTUWrapper" />
<attribute name="Implementation-Title" value="Data Transformation Utility" />
<attribute name="Implementation-Version" value="${version}" />
<attribute name="Implementation-Vendor" value="ACNielsen" />
</manifest>
- <fileset dir="${build.classes.dir}">
<include name="com/acnielsen/dtu/dtuwrapper/*.class" />
<include name="com/acnielsen/dtu/common/StreamGobbler.class" />
</fileset>
</jar>
<copy file="${src.dir}/com/acnielsen/dtu/dtuwrapper/dtu.exp" todir="${build.dir}/dtu_wrapper" />
<copy file="${basedir}/lib/commons-cli-1.0.jar" todir="${build.dir}/dtu_wrapper/lib" />
</target>
- <!-- ===========================================================================
-->
- <!-- Package Data Transformation Unix Service (EJB) files into into dtu_unix.jar
-->
- <!-- ===========================================================================
-->
- <target name="package-ejb-unix" depends="prepare, compile-ejb">
<delete file="${build.dir}/dtu_unix.jar" />
- <jar jarfile="${build.dir}/dtu_unix.jar">
- <manifest>
<attribute name="Class-Path" value="" />
<attribute name="Implementation-Title" value="Data Transformation Utility" />
<attribute name="Implementation-Version" value="${version}" />
<attribute name="Implementation-Vendor" value="ACNielsen" />
</manifest>
- <fileset dir="${build.classes.dir}">
<include name="com/acnielsen/dtu/model/unixservice/**/*.class" />
<include name="com/acnielsen/dtu/common/interfaces/ejb/UnixService*.class" />
<include name="com/acnielsen/dtu/model/util/EnviornmentVariables.class" />
<include name="com/acnielsen/dtu/model/util/Paths.class" />
<include name="com/acnielsen/dtu/common/StreamGobbler.class" />
</fileset>
- <fileset dir="${build.ejb-unix.dd}/">
<include name="**/*.xml" />
</fileset>
</jar>
</target>
- <!-- ===================================================================
-->
- <!-- Package Data Transformation Utilities (EJB) files into into dtu.jar
-->
- <!-- ===================================================================
-->
- <target name="package-ejb" depends="prepare, compile-ejb">
<delete file="${build.dir}/dtu.jar" />
- <jar jarfile="${build.dir}/dtu.jar">
- <manifest>
<attribute name="Class-Path" value="./lib/xbean.jar ./lib/xbean_xpath.jar ./lib/jaxen-1.1-beta2.jar ./lib/commons-net-1.2.2.jar ./lib/jakarta-oro-2.0.8.jar" />
<attribute name="Implementation-Title" value="Data Transformation Utility" />
<attribute name="Implementation-Version" value="${version}" />
<attribute name="Implementation-Vendor" value="ACNielsen" />
</manifest>
- <fileset dir="${build.classes.dir}">
<include name="com/acnielsen/dtu/**/*.class" />
<include name="schema/**/*.*" />
<exclude name="com/acnielsen/dtu/model/unixservice/**/*.class" />
<exclude name="com/acnielsen/dtu/dtuwrapper/**/*.class" />
</fileset>
- <fileset dir="${build.ejb.dd}/">
<include name="**/*.xml" />
</fileset>
</jar>
</target>
- <!-- ===================================================================
-->
- <!-- Package Web Client files into dtu.war
-->
- <!-- ===================================================================
-->
- <target name="package-web" depends="prepare, compile-web">
<delete file="${build.dir}/dtu.war" />
<delete dir="${build.dir}/help" />
<unzip src="${src.dir}/web/help/help.zip" dest="${build.dir}/help" />
- <copy overwrite="true" todir="${build.dir}/processed/web">
<fileset dir="${src.dir}/web" includes="login.jspx" />
- <filterset>
<filter token="BUILD_DATE" value="${BUILD_DATE}" />
<filter token="VERSION" value="${version}" />
</filterset>
</copy>
- <war warfile="${build.dir}/dtu.war" webxml="dd/web.xml">
- <fileset dir="${src.dir}/web">
<include name="*.jspx" />
<exclude name="login.jspx" />
<include name="*.html" />
<include name="images/*.gif" />
<include name="scripts/*.js" />
<include name="styles/*.css" />
<include name="transforms/*.xslt" />
</fileset>
- <fileset dir="${build.dir}/processed/web">
<include name="login.jspx" />
</fileset>
- <fileset dir="${build.dir}">
<include name="help/**" />
</fileset>
- <webinf dir="dd">
<include name="jboss-web.xml" />
</webinf>
- <classes dir="${build.classes.dir}">
<include name="com/acnielsen/dtu/web/**/*.class" />
</classes>
</war>
</target>
- <!-- ===================================================================
-->
- <!-- Package EJB, Web Client, and libs into dtu.ear
-->
- <!-- ===================================================================
-->
- <target name="package-ear" depends="clean, package-ejb, package-web">
<delete file="${build.dir}/dtu.ear" />
- <ear destfile="${build.dir}/dtu.ear" appxml="dd/application.xml">
<fileset dir="build" includes="*.jar,*.war" />
- <fileset dir="${basedir}">
<include name="lib/xbean.jar" />
<include name="lib/xbean_xpath.jar" />
<include name="lib/jaxen-1.1-beta2.jar" />
<include name="lib/commons-net-1.2.2.jar" />
<include name="lib/jakarta-oro-2.0.8.jar" />
</fileset>
</ear>
</target>
- <!-- ===================================================================
-->
- <!-- Package EAR, dtu_unix.jar, and dtu wrapper
-->
- <!-- ===================================================================
-->
<target name="package-all" depends="package-ear, package-ejb-unix, package-dtu-wrapper" />
- <!-- ===================================================================
-->
- <!-- Deploys EAR
-->
- <!-- ===================================================================
-->
- <target name="deploy-ear" depends="package-ear">
<copy file="build/dtu.ear" todir="${jboss.home}/server/default/deploy" />
</target>
- <!-- ===================================================================
-->
- <!-- Quick deploy Web - updates EAR with web changes
-->
- <!-- ===================================================================
-->
- <target name="quick-deploy-web" depends="package-web">
<delete file="${build.dir}/dtu.ear" />
- <ear destfile="${build.dir}/dtu.ear" appxml="dd/application.xml">
<fileset dir="${build.dir}" includes="*.jar,*.war" />
<fileset dir="${basedir}" includes="lib/*.jar" />
</ear>
<copy file="${build.dir}/dtu.ear" todir="${jboss.home}/server/default/deploy" />
</target>
- <!-- ===================================================================
-->
- <!-- Cleans up generated stuff
-->
- <!-- ===================================================================
-->
- <target name="clean">
<delete dir="${build.dir}" />
- <!-- CCM3152072 - SFD Rewrite Datapull - No need to delete the actual jar/ear files from jboss directory
-->
- <!-- <delete file="${jboss.home}/server/default/deploy/dtu.jar"/>
-->
- <!-- <delete file="${jboss.home}/server/default/deploy/dtu.war"/>
-->
- <!-- <delete file="${jboss.home}/server/default/deploy/dtu.ear"/>
-->
- <!-- <delete file="${jboss.home}/server/default/deploy/dtu_unix.jar"/>
-->
<delete dir="${generated.java.dir}" />
</target>
- <!-- ===================================================================
-->
- <!-- JUnit test cases
-->
- <!-- ===================================================================
-->
- <target name="run-junit-tests-jobconfigsession" depends="compile-tests">
- <java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<arg value="com.acnielsen.dtu.model.jobconfigsession.ejb.JobConfigSessionBeanTest" />
<sysproperty key="java.naming.factory.initial" value="org.jnp.interfaces.NamingContextFactory" />
<sysproperty key="java.naming.provider.url" value="jnp://localhost" />
<sysproperty key="java.naming.factory.url.pkgs" value="org.jboss.namingrg.jnp.interfaces" />
<classpath refid="classpath" />
</java>
</target>
- <target name="run-junit-tests-fileservice" depends="compile-tests">
- <java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<arg value="com.acnielsen.dtu.model.fileservice.ejb.FileServiceBeanTest" />
<sysproperty key="java.naming.factory.initial" value="org.jnp.interfaces.NamingContextFactory" />
<sysproperty key="java.naming.provider.url" value="jnp://localhost" />
<sysproperty key="java.naming.factory.url.pkgs" value="org.jboss.namingrg.jnp.interfaces" />
<classpath refid="classpath" />
</java>
</target>
- <target name="run-junit-tests-loginservice" depends="compile-tests">
- <java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<arg value="com.acnielsen.dtu.model.loginservice.ejb.LoginServiceBeanTest" />
<sysproperty key="java.naming.factory.initial" value="org.jnp.interfaces.NamingContextFactory" />
<sysproperty key="java.naming.provider.url" value="jnp://localhost" />
<sysproperty key="java.naming.factory.url.pkgs" value="org.jboss.namingrg.jnp.interfaces" />
<classpath refid="classpath" />
</java>
</target>
- <target name="run-junit-tests-userprofilesession" depends="compile-tests">
- <java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<arg value="com.acnielsen.dtu.model.userprofilesession.ejb.UserProfileSessionBeanTest" />
<sysproperty key="java.naming.factory.initial" value="org.jnp.interfaces.NamingContextFactory" />
<sysproperty key="java.naming.provider.url" value="jnp://localhost" />
<sysproperty key="java.naming.factory.url.pkgs" value="org.jboss.namingrg.jnp.interfaces" />
<classpath refid="classpath" />
</java>
</target>
- <target name="run-junit-tests-jobservice" depends="compile-tests">
- <java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<arg value="com.acnielsen.dtu.model.jobservice.ejb.JobServiceBeanTest" />
<sysproperty key="java.naming.factory.initial" value="org.jnp.interfaces.NamingContextFactory" />
<sysproperty key="java.naming.provider.url" value="jnp://sys19" />
<sysproperty key="java.naming.factory.url.pkgs" value="org.jboss.namingrg.jnp.interfaces" />
<classpath refid="classpath" />
</java>
</target>
- <target name="run-junit-tests-unixservice" depends="compile-tests">
- <java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<arg value="com.acnielsen.dtu.model.unixservice.ejb.UnixServiceBeanTest" />
<sysproperty key="java.naming.factory.initial" value="org.jnp.interfaces.NamingContextFactory" />
<sysproperty key="java.naming.provider.url" value="jnp://sys19" />
<sysproperty key="java.naming.factory.url.pkgs" value="org.jboss.namingrg.jnp.interfaces" />
<classpath refid="classpath" />
</java>
</target>
- <target name="run-junit-tests-filelayoutsession" depends="compile-tests">
- <java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<arg value="com.acnielsen.dtu.model.filelayoutsession.ejb.FileLayoutSessionBeanTest" />
<sysproperty key="java.naming.factory.initial" value="org.jnp.interfaces.NamingContextFactory" />
<sysproperty key="java.naming.provider.url" value="jnp://localhost" />
<sysproperty key="java.naming.factory.url.pkgs" value="org.jboss.namingrg.jnp.interfaces" />
<classpath refid="classpath" />
</java>
</target>
</project>



Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9318
    
109

Answered here https://community.jboss.org/thread/229696?tstart=0

[My Blog] [JavaRanch Journal]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ejb upgrade - how to remove xdoclet and ejbdoclet templates?
 
Similar Threads
Elementary Query around EJB3 and JBoss
Elementary Query around JBoss and EJB3
Unable to run embedded jboss.
stateless session bean
Build failed- ejb3.deployer not found