yes, I have those lines in my build.xml file. ----- Original Message ----- From: "wonder sonic" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, June 24, 2002 7:50 AM Subject: Re: [JBoss-user] xdoclet creating wrong package
> Hi, > I'm not an xdoclet expert but did you put the line: > > <packageSubstitution packages="session,entity" > substituteWith="interfaces"/> > > in the build.xml ant file? > > look at the example: > > ... > <target name="xdoclet-generate" depends="init"> > <taskdef > name="ejbdoclet" > classname="xdoclet.ejb.EjbDocletTask" > > > <classpath refid="xdoclet.path"/> > </taskdef> > > <ejbdoclet > sourcepath="${src.ejb.dir}" > destdir="${build.generate.dir}" > classpathref="base.path" > excludedtags="@version,@author" > ejbspec="${ejb.version}" > mergedir="${src.resources.dir}/xdoclet" > force="${xdoclet.force}" > > > <fileset dir="${src.ejb.dir}"> > <include name="**/*Bean.java"/> > </fileset> > > <packageSubstitution > packages="session,entity" > substituteWith="interfaces"/> > <dataobject/> > <remoteinterface/> > <homeinterface/> > <entitypk/> > <entitycmp/> > <deploymentdescriptor > destdir="${build.dir}/META-INF"/> > <!-- AS 4/29/02 Do not validate XML files > because JBoss 3.0 message driven will > report an wrong error because it uses > the wrong jboss.dtd --> > <jboss version="${jboss.version}" > xmlencoding="UTF-8" > typemapping="${type.mapping}" > datasource="${datasource.name}" > destdir="${build.dir}/META-INF" > validateXml="false" > /> > </ejbdoclet> > </target> > ... > > Hope it helps... > Wonder Sonic > > --- Sundaram <[EMAIL PROTECTED]> a écrit : > Hi, > > > > I have modified template example , created user > > entity bean. some how it > > creating wrong package name. > > > > user entity class, it generating wrong package > > name. > > com.percipia.auth.entity, but it suppose to be > > com.percipia.auth.interfaces. > > > > generated line: > > public com.percipia.auth.entity.UserEntityData > > getValueObject( ) throws > > java.rmi.RemoteException; > > > > -------------------------------- > > > > UserEntityBean.java > > --------------- > > > > package com.percipia.auth.entity; > > > > import com.percipia.auth.interfaces.*; > > > > import java.sql.Date; > > import java.rmi.RemoteException; > > import java.util.Collection; > > import java.util.Iterator; > > > > import javax.ejb.CreateException; > > import javax.ejb.EJBException; > > import javax.ejb.EntityBean; > > import javax.ejb.EntityContext; > > import javax.ejb.FinderException; > > import javax.ejb.RemoveException; > > import javax.naming.Context; > > import javax.naming.InitialContext; > > import javax.naming.NamingException; > > import javax.rmi.PortableRemoteObject; > > > > /** > > * The Entity bean represents a UserEntity > > * > > * @author Andreas Schaefer > > * @version $Revision: 1.1 $ > > * > > * @ejb:bean name="User/UserEntity" > > * display-name="UserEntity working on > > projects to support > > clients" > > * type="CMP" > > * jndi-name="ejb/User/UserEntity" > > * > > * @ejb:transaction type="Required" > > * > > * @ejb:data-object > > extends="com.percipia.auth.interfaces.AbstractData" > > * setdata="false" > > * > > * @ejb:finder signature="java.util.Collection > > findAll()" > > * > > * @ejb:finder > > signature="com.percipia.auth.interfaces.UserEntity > > findByName( java.lang.String pSurname, > > java.lang.String pLastName )" > > * > > * @jboss:finder-query name="findByName" > > * query="First_Name = {0} AND > > Last_Name = {1}" > > * > > * @ejb:finder > > signature="com.percipia.auth.interfaces.UserEntity > > findAnotherByName( int pId, java.lang.String > > pSurname, java.lang.String > > pLastName )" > > * > > * @jboss:finder-query name="findAnotherByName" > > * query="Id != {0} AND > > First_Name = {1} AND Last_Name = > > {2}" > > * > > * @jboss:table-name table-name="UserEntity" > > * > > * @jboss:create-table create="true" > > * > > * @jboss:remove-table remove="true" > > **/ > > public abstract class UserEntityBean > > implements EntityBean > > { > > > > > > > > > > // > > > ------------------------------------------------------------------------- > > // Members > > > > > > > > // > > > ------------------------------------------------------------------------- > > > > public EntityContext mContext; > > > > > > > > > > // > > > ------------------------------------------------------------------------- > > // Methods > > > > > > > > // > > > ------------------------------------------------------------------------- > > > > /** > > * Store the data within the provided data object > > into this bean. > > * > > * @param pUserEntity The Value Object containing > > the UserEntity values > > * > > * @ejb:interface-method view-type="remote" > > **/ > > public void setValueObject( UserEntityData > > pUserEntity ) > > throws > > InvalidValueException > > { > > // Check for Data Integrity in the Value > > Object > > if( pUserEntity == null ) { > > throw new InvalidValueException( > > "object.undefined", > > "UserEntity" ); > > } > > if( pUserEntity.getId() <= 0 ) { > > throw new InvalidValueException( > > "id.invalid", new String[] { > > "UserEntity", "Id" } ); > > } > > // Check if the UserEntity is not already > > saved > > try { > > UserEntityHome lHome = (UserEntityHome) > > mContext.getEJBHome(); > > UserEntity lEntity = > > lHome.findAnotherByName( pUserEntity.getId(), > > pUserEntity.getFirstName(), > > pUserEntity.getLastName() ); > > // UserEntity with the given email address > > already exists retrieve > > instead of create a new one > > throw new InvalidValueException( > > "user.already.exists", new > > String[] { pUserEntity.getFirstName() + " " + > > pUserEntity.getLastName() } ); > > } > > catch( FinderException fe ) { > > // That's ok > > } > > catch( RemoteException re ) { > > // Should never happens (are local) > > } > > try { > > UserEntityHome lHome = (UserEntityHome) > > mContext.getEJBHome(); > > UserEntity lUserEntity = lHome.findByName( > > pUserEntity.getFirstName(), > > pUserEntity.getLastName() ); > > if( lUserEntity.getValueObject().getId() != > > pUserEntity.getId() ) { > > } > > } > > catch( FinderException fe ) { > > // That's ok > > } > > catch( RemoteException re ) { > > // Should never happens (are local) > > } > > setId( pUserEntity.getId() ); > > setFirstName( pUserEntity.getFirstName() ); > > setLastName( pUserEntity.getLastName() ); > > setPassword( pUserEntity.getPassword() ); > > setEmail( pUserEntity.getEmail() ); > > setAddress( pUserEntity.getAddress() ); > > setCity( pUserEntity.getCity() ); > > setZIP( pUserEntity.getZIP() ); > > setState( pUserEntity.getState() ); > > setCountry( pUserEntity.getCountry() ); > > if( getCreationDate() == null ) { > > // Only set it if object is created > > setCreationDate( new Date( new > > java.util.Date().getTime() ) ); > > } > > // After making any chances update the > > modification date > > > === message truncated === > > ___________________________________________________________ > Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! > Yahoo! Mail : http://fr.mail.yahoo.com > > > ------------------------------------------------------- > Sponsored by: > ThinkGeek at http://www.ThinkGeek.com/ > _______________________________________________ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user > ------------------------------------------------------- Sponsored by: ThinkGeek at http://www.ThinkGeek.com/ _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user