有没有办法在Netbeans和Eclipse之间共享相同的*.java文件?
我正在尝试使用Maven shade插件将Grizzly打包为Jersey作为单个jar.但我总是得到消息No container provider supports the type class org.glassfish.grizzly.http.server.HttpHandler
代码在Eclipse中运行良好,但在打包的jar中不行:
public class Main {
private static URI getBaseURI() {
return UriBuilder.fromUri("http://localhost/").port(9998).build();
}
public static final URI BASE_URI = getBaseURI();
protected static HttpServer startServer() throws IOException {
System.out.println("Starting grizzly...");
ResourceConfig rc = new PackagesResourceConfig("share.test");
rc.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
return GrizzlyServerFactory.createHttpServer(BASE_URI, rc);
}
public static void main(String[] args) throws IOException {
HttpServer httpServer = startServer();
System.in.read();
httpServer.stop();
}
}
Run Code Online (Sandbox Code Playgroud)
这是完整的例外
$ java -jar target/webServiceTest-0.0.1-SNAPSHOT.jar
Starting grizzly...
Mar 20, 2012 12:48:53 PM com.sun.jersey.api.core.PackagesResourceConfig init …Run Code Online (Sandbox Code Playgroud)