Hi,

I'm using the "official" 1.1.2. version build from
xdoclet.sourceforge.net, not a CVS version. As I had never built
stateful session beans with XDoclet before I didn't encounter this
problem before either. Passed parameters in ejbCreate for entity beans
work fine and as you can see in my code sample it should also work for
stateful session beans (works for setSessionContext but not for
ejbCreate).

I'd be so happy if anybody had a hint for me here.

Later,
Bernie


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]] On Behalf 
> Of [EMAIL PROTECTED]
> Sent: vendredi 12 avril 2002 14:05
> To: [EMAIL PROTECTED]
> Subject: [Xdoclet-user] Method argument in ejbCreate of 
> stateful session bean does not wo rk
> 
> 
> Hi,
> 
> I have a stateful session bean whose ejbCreate has an 
> argument. I have the following three lines as class level 
> tags (among others).
> 
>  * @ejb:bean           type="Stateful" name="HVAttributeManager"
>  *      jndi-name="ejb/HVAttributeManager" view-type="remote"
>  *      transaction-type="Container"
> 
> When I run Ant I get the following build error:
> 
> compile-ejbs:
>     [javac] Compiling 1 source file to C:\myapp\build\ejb\classes
>     [javac] 
> C:\myapp\gen-src\com\logica\insurance\joap\util\validation\HVAttribu
> teManagerSession.java:58: ejbCreate(java.util.Map) in 
> com.logica.insurance.joap. util.validation.HVAttributeManager 
> cannot be applied to ()
>     [javac]       super.ejbCreate();
>     [javac]            ^
>     [javac] 1 error
> 
> BUILD FAILED
> 
> Thing is, the create method in my source class looks like this:
> 
>    /**
>      *  Creates the manager bean and initializes it with a 
> map of value objects.
>      *
>      * @param  valueObjects      the map of value objects
>      * @throws  CreateException  the wrong arguments are supplied
>      * @ejb:create-method
>      */
>     public void ejbCreate( Map valueObjects ) throws CreateException
>     {
>         init( valueObjects );
>     }
> 
> However the generated implementation class (public class 
> HVAttributeManagerSession
>    extends 
> com.logica.insurance.joap.util.validation.HVAttributeManager
>    implements javax.ejb.SessionBean) has a create method 
> which doesn't include the parameter:
> 
> public void ejbCreate() throws javax.ejb.CreateException
>    {
>       super.ejbCreate();
>    }
> 
> I do also override setSessionContext like this:
> 
> public void setSessionContext( SessionContext ctx ) throws 
> EJBException
>     {
>         ejbContext = ctx;
>         hvDataStore = HVDataStore.getInstance();
>     }
> 
> Here the parameters gets inserted correctly into the generated class:
> 
> public void setSessionContext(javax.ejb.SessionContext ctx) 
> throws javax.ejb.EJBException
>    {
>       super.setSessionContext(ctx);
>    }
> 
> What's wrong here? Anything with XDoclet? Or am I doing 
> something wrong. I never used a stateful session bean with a 
> parameterized create method before, that's why I never 
> encountered this before.
> 
> I'd appreciate any input :)
> 
> Thanks,
> Bernie
> 
> _______________________________________________
> Xdoclet-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/xdoclet-user
> 
> 


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to