Caused by: com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes

huangapple go评论91阅读模式
英文:

Caused by: com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes

问题

我正在尝试使用IntelliJ创建Gradle/DropWizard(JDK 1.8)应用程序
尝试运行时出现以下错误:
Caused by: com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.

以下是完整的代码:

package org.xx.udemy;

import io.dropwizard.Application;
import io.dropwizard.Configuration;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;

public class DropWizApp extends Application<Configuration> {
    @Override
    public void initialize(Bootstrap<Configuration> bootstrap) {

    }

    @Override
    public void run(Configuration configuration, Environment environment) throws Exception {
        System.out.println("Hello DropWiz!");
    }
    public static void main(String ...args) throws Exception{
        new DropWizApp().run(args);
    }
}
英文:

I am trying to create Gradle/DropWizard (JDK 1.8) application using IntelliJ
When attempting to run I receive:
Caused by: com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.

Below is a complete code:

package org.xx.udemy;

import io.dropwizard.Application;
import io.dropwizard.Configuration;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;

public class DropWizApp extends Application&lt;Configuration&gt; {
    @Override
    public void initialize(Bootstrap&lt;Configuration&gt; bootstrap) {

    }

    @Override
    public void run(Configuration configuration, Environment environment) throws Exception {
        System.out.println(&quot;Hello DropWiz!&quot;);
    }
    public static void main(String ...args) throws Exception{
        new DropWizApp().run(args);
    }
}

答案1

得分: 0

升级Dropwizard的版本解决了这个问题。

英文:

Upgrading dropwizard's version solved the problem.

huangapple
  • 本文由 发表于 2020年8月14日 04:29:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/63402764.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定