You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Jonathan S Fisher (Commented) (JIRA)" <ji...@apache.org> on 2012/04/09 17:15:17 UTC

[jira] [Commented] (OPENEJB-1818) Validation: Missing @Local annotation

    [ https://issues.apache.org/jira/browse/OPENEJB-1818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13249861#comment-13249861 ] 

Jonathan S Fisher commented on OPENEJB-1818:
--------------------------------------------

The complaint here is the error provided by OpenEJB was very cryptic... It's not a big deal, but may be an error for improvement in the future.

I had the following (incorrect) code in my application. OpenEJB reported the "application could not be validated" but really didn't give a great description of what was wrong:

<code>
@Stateless
public class PongEJB implements ShortCodeDecoder, ClickCounter {
	@PersistenceContext
	private EntityManager em;

	@Inject
	private Logger log;
</code>

It turns out, that GlassFish will automagically figure out that you wanted a @Local annotation, so this could would work in GlassFish. But, in reality, since the interfaces are not annotated, you would need to tell the container how to expose your EJB, like this:

<code>
@Local({ ShortCodeDecoder.class, ClickCounter.class })
@Stateless
public class PongEJB implements ShortCodeDecoder, ClickCounter {
	@PersistenceContext
	private EntityManager em;

	@Inject
	private Logger log;
</code>

Thank you,
-Jonathan
                
> Validation: Missing @Local annotation
> -------------------------------------
>
>                 Key: OPENEJB-1818
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1818
>             Project: OpenEJB
>          Issue Type: Sub-task
>          Components: deployment, ejb3 simplified
>            Reporter: David Blevins
>             Fix For: 3.1.x
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira