我试图与Embeddable Glassfish app client container工作。 我能找到的唯一资源是包含这个诱人的代码上述的javadoc片断GlassFish应用程序客户端容器
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帖子我看不到其他的东西 –
这与我的其他方法相去甚远看到。我能问问你有什么想法吗? – Thufir