我正试图使用下垂向导 (wiab)部署一个使用盒子里的巫师 (wiab)在issues 8.5.5.5上的应用程序,但我遇到了io.dropwizard.util.JarLocation类的问题。wiab将尝试获取包装dw应用程序的侦听器类的位置,但由于类‘ProtectionDomain是null中的null对象而失败。
klass.getProtectionDomain().getCodeSource().getLocation()但是,我尝试在Tomcat 8和最新的自由配置文件v9测试版上进行部署,它们都很好。
自由服务器上的两个server.xml文件在特性上看起来都非常相似。
<?xml version="1.0" encoding="UTF-8"?>
<server description="new server">
<!-- Enable features -->
<featureManager>
<feature>servlet-3.1</feature>
<feature>jsp-2.3</feature>
<feature>el-3.0</feature>
<feature>websocket-1.1</feature>
<feature>localConnector-1.0</feature>
</featureManager>
<!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
<httpEndpoint id="defaultHttpEndpoint" httpPort="9080" httpsPort="9443" />
<applicationMonitor updateTrigger="mbean" />
<application id="moshpit_war_war_exploded" location="D:\code\moshpit\moshpit-war\target\moshpit" name="moshpit_war_war_exploded" type="war" context-root="/" />
</server>我尝试从IntelliJ内部部署普通战争和爆炸性战争,以及使用dropin文件夹和预先构建的war。v9测试版会很不错,但不是8.5.5.5。
这是包装dw应用程序的监听器类:
@WebListener
public class MoshpitWebApplication extends WebApplication<MoshpitConfiguration> {
private static final Logger LOGGER = LoggerFactory.getLogger(MoshpitWebApplication.class);
public MoshpitWebApplication() {
super(new MoshpitApplication(), "/configuration/moshpit.yml");
}
}这是我的dw应用程序类
public class MoshpitApplication extends Application<MoshpitConfiguration> {
public MoshpitApplication() {
}
public static void main(String[] args) throws Exception {
new MoshpitApplication().run(args);
}
@Override
public String getName() {
return "moshpit";
}
@Override
public void initialize(Bootstrap<MoshpitConfiguration> bootstrap) {
bootstrap.setConfigurationSourceProvider(new FileConfigurationSourceProvider());
// nothing to do yet
}
@Override
public void run(MoshpitConfiguration configuration, Environment environment) throws Exception {
final Template template = configuration.buildTemplate();
environment.healthChecks().register("template", new TemplateHealthCheck(template));
environment.jersey().register(new HelloWorldResource(template));
}
}更新:
这似乎是自由8.5.5.5的一个普遍问题。尝试部署一个完全不同的应用程序,我观察到了同样的行为。CodeSource是应用程序类的null。
发布于 2015-06-11 23:47:43
自由配置文件目前没有为应用程序类设置CodeSource。正如您注意到的,这个问题在当前的测试版中得到了解决,并将在6月26日发布8.5.5.6时得到解决。
https://stackoverflow.com/questions/30351527
复制相似问题