Springdoclet - multiple beans created for superclass

"Jonathan Bryant" <[email protected]> Wed, 8 Nov 2006 23:36:03 -0600
Newsgroups gmane.comp.java.xdoclet.user
Message-ID <0C3AEA555EC5E14EB9A3756D74D46B42020FF06F@mercury.ad.austin.hoovers.com>
I have a problem when I create my spring config files. It seems that if
I have two beans that I need in my conf file, and one extends the other
I get three beans in the resulting config file. For example, I put
together a simple example. In this case I have two classes, Person and
Customer, Customer extends Person. If I create a bean for each class, I
end up with 3 beans in my config file. 

Any ideas?


I've included all the relevant bits below:

--------------------------------------------
Xdoclet output
--------------------------------------------

<beans default-autowire="no" default-lazy-init="false"
default-dependency-check="none">
  	<bean id="customer" class="com.foo.Customer">
	<bean id="person" class="com.foo.Customer">
	<bean id="person" class="com.foo.Person">
</beans>


--------------------------------------------
Classes
--------------------------------------------

/**
 * @spring.bean id="person"
*/
public class Person {
    private String name;
    public Person() {}
    public String getName() {}
    public void setName(String name) {}
}


/**
 * @spring.bean id="customer"
*/
public class Customer extends Person{

    private String customerId;
    public Customer() {}
    public String getCustomerId() {}
    public void setCustomerId(String customerId) {}
}


-----------------------------------------------
Build.xml
-----------------------------------------------


<project basedir="." default="xdoclet" name="project">
       <path id="classpath.xdoclet"><fileset dir="lib"
includes="*.jar"/></path>
  	<target name="xdoclet">
       		<taskdef name="springdoclet"
	
classname="xdoclet.modules.spring.SpringDocletTask"
	                      classpathref="classpath.xdoclet"/>

           		<springdoclet destDir="conf"  verbose="true">
            		<fileset dir="src"><include
name="**/*.java"/></fileset>
            		<springxml mergeDir="conf"
destinationFile="dispatcher-servlet.xml" validateXML="false"/>
            	</springdoclet>
   	</target>
</project>



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642