On Sep 24, 2009, at 12:09 PM, Laird Nelson wrote:

2. Whether you do that or not, could you make it so that if a unit test, say, that is annotated with @LocalClient does NOT at the moment have any @EJB or @Resource annotations--could you make it so that the build does not
  fail in this case?

Regarding #2, I have a TestCase that is annotated with @LocalClient. I haven't yet gotten around to putting in @EJB annotations. I get a test
failure with the following stack:

javax.naming.NamingException: Unable to find injection meta-data for
foobar.TestCaseFoobar.  Ensure that class was annotated with
@org.apache.openejb.api.LocalClient and was successfully discovered and
deployed.  See http://openejb.apache.org/3.0/local-client-injection.html
   at
org .apache .openejb.client.LocalInitialContext.inject(LocalInitialContext.java: 251)

I can't seem to replicate this issue. Made a copy of our internal test case and whipped out all the fields. That didn't seem to do it, so I grabbed the 'testcase-injection' example and commented out the injection annotations. Also no issues. Tried with 3.1.1 to make sure this wasn't something that was fixed as a side effect of another commit. It worked too.

Could be some edge case that makes this fail or else it was just that your @LocalClient wasn't getting discovered. If you have something that reproduces it, I'll definitely give it a look ASAP.

-David

Reply via email to