我正在努力让一个肥皂网络服务在我的嵌入式码头服务器上运行。
我遵循了这个德语教程(ofc不起作用): http://www.torsten-horn.de/techdocs/jee-jax-ws.htm#Deployment-im-Webserver
相关代码片段:
Endpoint ep = Endpoint.publish( url, new BuecherServiceImpl() );
int anzahlBuecherResult = TestWsClient.test( "WsMitEndpointIntegrTest", url, 4000000000L, anzahlBuecher, true );
public static int test( String testName, String url, long startIsbn, int anzahlBuecher, boolean trace ) throws Exception
{
BuecherServiceIntf buecherService;
if( url.equalsIgnoreCase( "direkt" ) ) {
buecherService = new BuecherServiceImpl();
} else {
System.out.println( testName + ": " + url );
Service service = null;
int timeoutSekunden = 20;
while( service == null ) {
try {
//here …
Run Code Online (Sandbox Code Playgroud) 有没有办法向正在运行的嵌入式Jetty实例添加处理程序?我们已将旧的基于Jetty 6的项目迁移到Jetty 9,我们需要为插件系统添加和删除动态处理程序......
见下面的例子......
Server server = new Server();
[...]
server.start();
[...]
Handler[] existingHandler = server.getHandlers();
// There is no more
server.addHandler(newHandler);
// only this you can do, but only if the server is stopped
server.setHandler(newHandler)
Run Code Online (Sandbox Code Playgroud)
注意:newHandler
是HandlerCollection
......