As far as I know you need an interface to be created manually and the container does not create it for your.
If you have a nice IDE like Eclipse 3.1.1 you can extract an interface file from your session bean automatically by right clicking on the Session bean and then click on Refractor -> Extract interface. Then you can just add wour @Remote or @Local tags.
Ok, I found where I got this idea from.
On the first page it says:
"In the EJB 3.0 world, all kinds of enterprise beans are just plain old Java objects (POJO) with appropriate annotations... you don't necessarily have to implement a business interface (the container can generate it for you)."
And on the second page:
"If it does not implement any business interfaces, a business interface will be generated using all the public methods. If only certain methods should be exposed in the business interface, all of those methods can be marked with the @BusinessMethod annotation."
Of course I'm just noticing that this article is almost a year and a half old, so things may have changed quite a bit since then. If it has changed, does anyone know where in the spec drafts it changed? I'd be interested in the rationale behind this. I think it would be really great to eliminate the redundant (from a conceptual point of view) interface for each bean.
Of course I'm just noticing that this article is almost a year and a half old, so things may have changed quite a bit since then. If it has changed, does anyone know where in the spec drafts it changed?
See the Revision History page of the EJB 3.0 Simplified API PFD (P.58). I think the Public Draft dropped the feature:
Removed requirements for support of generated interfaces. Generation of interfaces may be supported by tools.