dev@glassfish.java.net

SOLVED: Re: What is the meaning of this message?

From: Lee Chuk Munn <chuk-munn.lee_at_oracle.com>
Date: Sat, 02 Jul 2011 12:12:18 +0800

Hi

this is just for future container implementors who are getting the same
message. The fix is to associate your invocation with a JavaEE
environment. You get the environment from JndiNameEnvironment.

There are 2 steps. The first is to get the component id.
In my case, my app is deployed in a WAR file, so its pretty easy. Inject
ComponentEnvManager and get WebBundleDescriptor. From there you can get
the component id with getComponentEnvId(WebBundleDescriptor)

The second step is to call InvocationManager.preInvoke() before your
component call. InvocationManager is also an injected resource. You need
to setup a ComponentInvocation like so

ComponentInvocation ic = new ComponentINvocation(compId,
ComponentInvocation.ComponentInvocationType.APP_CLIENT_INVOCATION,
cyourComponent);
invokeMgr.preInvoke(ci);
yourComponent.someMethod();
invokeMgr.postInvoke(ci);

HTH

Regards
Chuk


On 21/06/11 14:07, Lee Chuk Munn wrote:
> Hi
>
> I got the following message when I'm using CDI to get an instance of my
> object. Can anyone shed any light on this? The app is packaged in a WAR
> file.
>
> [#|2011-06-21T14:02:04.008+0800|SEVERE|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=111;_ThreadName=Thread-1;|No
> valid EE environment for injection of com.acme.xmpp.MessageHandler|#]
>
> Thanks
>
> Regards
> Chuk

-- 
C++ : Where friends have access to your private members.
	-- Gavin Russell Baker