*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Anyone who tried @Init annotation in Stateful Session Bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Anyone who tried @Init annotation in Stateful Session Bean" Watch "Anyone who tried @Init annotation in Stateful Session Bean" New topic
Author

Anyone who tried @Init annotation in Stateful Session Bean

Nitin Takale
Greenhorn

Joined: Nov 30, 2006
Posts: 26
Hi All,

I'm writing a ejb 2.1 client for ejb 3.0 Stateful bean. I've initialize(String) and initialize(String,String) methods in my bean class.

And my home interface has create(String) and createCart(String,String) method

I tried to use Init annotation on initialize method. as..
@Init("create")
@Init("createCart")

and

@Init("create(java.lang.String)")
@Init(createCart(java.lang.String,java.lang.String))

but in both cases I'm getting exception saying..
Bean class for ejb [CartEJB] does not define a
method corresponding to [Home] interface method [public abstract com.seed.ejb20
.CartRemote com.seed.ejb20.CartHome.createCart(java.lang.String,java.lang.String
) throws java.rmi.RemoteException,javax.ejb.CreateException]

and so on....

So can you please guide me how do use this Init annotation.
My code works well if I don't use Init annotation and instead use Deployment descriptor elements init-method.....


Thanks

Nitin
[ September 01, 2008: Message edited by: Nitin Takale ]

Nitin<br /> <br />SCJP 6.0<br />SCBCD 5.0
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Anyone who tried @Init annotation in Stateful Session Bean
 
Similar Threads
ejbc error
EJB 3 Client View
EJB 3.0 Lookup (or inject) stateful SessionBean
EJB3 - Passing intialization parameters in the absence of Home interface
EJBObject, EJBHome and SessionBean methods