【发布时间】:2012-05-16 00:58:14
【问题描述】:
我正在尝试使用Embeddable Glassfish app client container。 我能找到的唯一资源是上面提到的 javadocs,其中包含这个诱人的代码 sn-p
import org.glassfish.appclient.client.acc.AppClientContainer;
import org.glassfish.appclient.client.acc.config.TargetServer;
AppClientContainerBuilder builder = AppClientContainer.newBuilder(
new TargetServer("localhost", 3700));
AppClientContainer acc = builder.newContainer(new File("myAC.jar").toURI());
(或者,或者)
AppClientContainer acc = builder.newContainer(MyClient.class);
那么,
acc.startClient(clientArgs);
// The newContainer method returns as soon as the client's main method returns,
// even if the client has started another thread or is using the AWT event
// dispatcher thread
// At some later point, the program can synchronize with the app client in
// a user-specified way at which point it could invoke
acc.stop();
这看起来非常棒,但我试图让它运行几次,但出现了各种不同的错误。
有没有人有任何使用此的经验,或者他们可以向我指出一些解释如何使用它的资源的方向?
【问题讨论】:
-
Tim,可能有助于将错误添加到此问题中,以便其他人可以帮助进行故障排除。我还要指出,如果您不需要整个 EE 容器并且无法让 Glassfish 工作,这是 Jetty 非常流行的用例。
-
@Riyad 我想我更想了解一下谁在使用这个 API,因为一个没有答案的 coderanch 帖子我看不到其他任何东西
-
这与我见过的其他方法相去甚远。我能问一下你的想法吗?
标签: java glassfish application-client