当我从Hibernate更改为JDBI并尝试启动我的应用程序时,出现以下错误
java.lang.NoClassDefFoundError:io / dropwizard / jetty / RequestLogFactory
堆栈跟踪说,这个问题的原因在我的配置类中,在类定义中。 但我不知道出了什么问题。 有谁有这个问题?
MyConfiguration.java
import com.fasterxml.jackson.annotation.JsonProperty; import io.dropwizard.Configuration; import io.dropwizard.db.DataSourceFactory; import org.hibernate.validator.constraints.NotEmpty; import javax.validation.constraints.NotNull; public class MyConfiguration extends Configuration { @JsonProperty @NotNull private DataSourceFactory database; @JsonProperty @NotEmpty private String someString; public DataSourceFactory getDataSourceFactory() { return database; } public String getSomeString() { return someString; } }编辑我正在使用dropwizard 1.0.0和RequestLogFactory既不在给定的包中,也没有Intellij找不到该类。
When I changed from Hibernate to JDBI, and tried to launch my application, error below occured
java.lang.NoClassDefFoundError: io/dropwizard/jetty/RequestLogFactory
Stack trace says, that the cause of this problem is in my configuration class, at the class definition. But i have no idea what's wrong. Anyone had this problem?
MyConfiguration.java
import com.fasterxml.jackson.annotation.JsonProperty; import io.dropwizard.Configuration; import io.dropwizard.db.DataSourceFactory; import org.hibernate.validator.constraints.NotEmpty; import javax.validation.constraints.NotNull; public class MyConfiguration extends Configuration { @JsonProperty @NotNull private DataSourceFactory database; @JsonProperty @NotEmpty private String someString; public DataSourceFactory getDataSourceFactory() { return database; } public String getSomeString() { return someString; } }EDIT I'm using dropwizard 1.0.0 and RequestLogFactory is neither in the given package nor Intellij couldn't find that class.
最满意答案
您没有直接使用RequestLogFactory,但它似乎是您要导入的类之一,并且您的类路径中需要存在jar,以便导入这些类以在运行时正常工作。 您应该追踪需要包含在包含RequestLogFactory类的类路径中的jar。
You aren't using the RequestLogFactory directly, but it seems one of the classes you're importing is and that jar needs to be present on your classpath for these classes you're importing to work appropriately at runtime. You should track down the jar which you need to include on your classpath that includes the RequestLogFactory class.
更多推荐
发布评论