users@glassfish.java.net

Re: Embedded ACC and GFv3

From: <glassfish_at_javadesktop.org>
Date: Wed, 31 Mar 2010 08:39:26 PDT

Hi, Atilla.

Thanks for attaching the sample.

1. I do not get the compilation warning. I set up my version of the SunGFv3 library to include just the gf-client.jar from my GlassFish installation. Is that what you did?

2. The injection should work but it does not seem to work for me either with your example. I have opened a new issue for this problem: https://glassfish.dev.java.net/issues/show_bug.cgi?id=11740

You can work around this problem by passing the URI for the downloaded client JAR file to builder.newContainer, instead of passing the client main class. I know that is not as convenient, perhaps, but then the client would not have to look up resources using InitialContext and could use injection.

3. The IllegalStateException might be a GlassFish bug in which we are being too strict about some state checking. I just opened this issue for the problem: https://glassfish.dev.java.net/issues/show_bug.cgi?id=11741

(Long explanation - When your driver program (HelloApp-emb-ACC) invokes acc.startClient then the ACC's state changes from "prepared" to "started." At the end of startClient, the ACC automatically invokes the acc.stop method if your client or main program has not created any GUI elements. This changes the ACC's state to "stopped." When your driver program invokes acc.stop, that method complains because the state is already stopped. There are good reasons why the ACC should clean things up automatically if it can, but the embedded ACC API should not throw the IllegalStateException in your example because you are following the API as documented.)

You can avoid that problem by temporarily removing the invocation of acc.stop from your driver.

Sorry for the inconvenience, but thanks for calling the problems to our attention.

- Tim
[Message sent by forum member 'tjquinn']

http://forums.java.net/jive/thread.jspa?messageID=394679