저지 주석을 사용하여 REST 리소스를 작성했습니다. 이클립스에서 응용 프로그램을 실행할 때REST 애플리케이션은 Eclipse에서 실행되지만 실행 가능한 JAR로는 실행되지 않습니다. NoClassDefFoundError : javax/xml/bind/annotation/XmlElement
@Configuration
@ApplicationPath("/api")
public class JerseyConfiguration extends ResourceConfig {
public JerseyConfiguration() { }
@PostConstruct
public void setUp() {
register(AdminController.class);
register(AdminResource.class);
register(GenericExceptionMapper.class);
}
}
이 잘 작동 : 봄 부팅에서 그 일을하려면 내가 JerseyConfiguration 클래스를 추가했다. jar 파일을 만들고 실행할 때 다음과 같은 오류가 발생합니다.
12:45:15.311 [main] ERROR o.s.boot.SpringApplication : Application startup failed org.springframework.context.ApplicationContextException: Unable to start embedded container;
nested exception is java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration': Bean instantiation via constructor failed;
nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration$$EnhancerBySpringCGLIB$$d46b8aee]: Constructor threw exception;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceConfigCustomizer' defined in class path resource [org/springframework/boot/autoconfigure/jersey/JerseyAutoCon figuration$JacksonResourceConfigCustomizer.class]: Bean instantiation via factory method failed;
nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.jersey.ResourceConfigCustomizer]: Factory method 'resourceConfigCustomizer' threw exception;
nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlElement
아무도 왜 이러한 일이 발생하는지 말할 수 있습니까? 지금까지 내가 알고있는 javax/xml/bind/annotation
내가 자바 8 SDK를 사용하여 항아리를 시작 생각, 자바 8