[jboss-user] [EJB 3.0] - "An SLSB doesn't have a home interface anymore" ?
christophe.laumond
do-not-reply at jboss.com
Thu Sep 14 04:41:53 EDT 2006
Hi all,
I'm using Seam1.0.1GA with the JBoss AS 4.0.4GA provided with JEMSInstaller and for testing I'm using the testng-jdk15.jar provided with the TestNG Eclipse plugin.
I have found this article describing EJB 3.0 in general :
http://www.javaworld.com/javaworld/jw-08-2004/jw-0809-ejb-p2.html
Below the part this post is about :
anonymous wrote :
| An SLSB doesn't have a home interface anymore?in fact, no EJB type requires it. The bean class may or may not implement a business interface. If it does not implement any business interfaces, a business interface will be generated using all the public methods.
When I read that I think : "This is wonderful !"
I have generated DAO class using the Hibernate tools in Eclipse.
For example :
| @Stateless
| public class AccountantHome {
|
| private static final Log log = LogFactory.getLog(AccountantHome.class);
|
| @PersistenceContext
| private EntityManager entityManager;
|
| public void persist(Accountant transientInstance) {
| ...
| }
|
| public void remove(Accountant persistentInstance) {
| ...
| }
|
| public Accountant merge(Accountant detachedInstance) {
| ...
| }
|
| public Accountant findById(long id) {
| ...
| }
| }
|
So this generated class is perfect according to what it said in the article.
But when I deploy it I get :
anonymous wrote :
| bean class has no local, webservice, or remote interfaces defined and does not implement at least one business interface
|
I don't understand why this occure.
It fails in both JBoss AS and the Microcontainer + Embeddable EJB3 of TestNG.
I had to create an interface and add the annotation @Local to the interface in order to get a correct deploy.
Could you tell me what I have missed please ?
Regards,
Christophe Laumond,
M-ITC Ltd,
Mauritius
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971493#3971493
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3971493
More information about the jboss-user
mailing list