Java10 으로 Spring Boot프로젝트에서 BootRun 실행하면 아래와 같은 에러가 납니다


```shell

2018-09-02 00:41:05.744 ERROR 300 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Exception starting filter [servletContainer]


java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present

at java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:117) ~[na:na]

at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125) ~[na:na]

at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[na:na]

at java.base/sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68) ~[na:na]

at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138) ~[na:na]

at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[na:na]

at java.base/sun.reflect.generics.repository.ClassRepository.computeSuperInterfaces(ClassRepository.java:117) ~[na:na]

at java.base/sun.reflect.generics.repository.ClassRepository.getSuperInterfaces(ClassRepository.java:95) ~[na:na]

at java.base/java.lang.Class.getGenericInterfaces(Class.java:1114) ~[na:na]

at com.sun.jersey.core.reflection.ReflectionHelper.getClass(ReflectionHelper.java:629) ~[jersey-core-1.19.1.jar:1.19.1]

at com.sun.jersey.core.reflection.ReflectionHelper.getClass(ReflectionHelper.java:625) ~[jersey-core-1.19.1.jar:1.19.1]

at com.sun.jersey.core.spi.factory.ContextResolverFactory.getParameterizedType(ContextResolverFactory.java:202) ~[jersey-core-1.19.1.jar:1.19.1]

at com.sun.jersey.core.spi.factory.ContextResolverFactory.init(ContextResolverFactory.java:89) ~[jersey-core-1.19.1.jar:1.19.1]

at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1332) ~[jersey-server-1.19.1.jar:1.19.1]

at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:180) ~[jersey-server-1.19.1.jar:1.19.1]

at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:799) ~[jersey-server-1.19.1.jar:1.19.1]

at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:795) ~[jersey-server-1.19.1.jar:1.19.1]

at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193) ~[jersey-core-1.19.1.jar:1.19.1]

at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:795) ~[jersey-server-1.19.1.jar:1.19.1]

at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:790) ~[jersey-server-1.19.1.jar:1.19.1]

at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:509) ~[jersey-servlet-1.19.1.jar:1.19.1]

at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:339) ~[jersey-servlet-1.19.1.jar:1.19.1]

at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:605) ~[jersey-servlet-1.19.1.jar:1.19.1]

at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:207) ~[jersey-servlet-1.19.1.jar:1.19.1]

at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:394) ~[jersey-servlet-1.19.1.jar:1.19.1]

at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:744) ~[jersey-servlet-1.19.1.jar:1.19.1]

at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:285) ~[tomcat-embed-core-8.5.32.jar:8.5.32]

at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:112) ~[tomcat-embed-core-8.5.32.jar:8.5.32]

at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4637) [tomcat-embed-core-8.5.32.jar:8.5.32]

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5282) [tomcat-embed-core-8.5.32.jar:8.5.32]

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.32.jar:8.5.32]

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1421) [tomcat-embed-core-8.5.32.jar:8.5.32]

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1411) [tomcat-embed-core-8.5.32.jar:8.5.32]

at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) [na:na]

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135) [na:na]

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [na:na]

at java.base/java.lang.Thread.run(Thread.java:844) [na:na]

Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBContext

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582) ~[na:na]

at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190) ~[na:na]

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499) ~[na:na]

at java.base/java.lang.Class.forName0(Native Method) ~[na:na]

at java.base/java.lang.Class.forName(Class.java:374) ~[na:na]

at java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114) ~[na:na]

... 36 common frames omitted


2018-09-02 00:41:05.748 ERROR 300 --- [ost-startStop-1] o.apache.catalina.core.StandardContext   : One or more Filters failed to start. Full details will be found in the appropriate container log file

2018-09-02 00:41:05.748 ERROR 300 --- [ost-startStop-1] o.apache.catalina.core.StandardContext   : Context [] startup failed due to previous errors

2018-09-02 00:41:05.752  WARN 300 --- [ost-startStop-1] o.a.c.loader.WebappClassLoaderBase       : The web application [ROOT] appears to have started a thread named [spring.cloud.inetutils] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:

 java.base@10.0.2/jdk.internal.misc.Unsafe.park(Native Method)

 java.base@10.0.2/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)

 java.base@10.0.2/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2075)

 java.base@10.0.2/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:435)

 java.base@10.0.2/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1061)

 java.base@10.0.2/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1121)

 java.base@10.0.2/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)

 java.base@10.0.2/java.lang.Thread.run(Thread.java:844)

2018-09-02 00:41:05.933  INFO 300 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]

2018-09-02 00:41:05.937  WARN 300 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat

2018-09-02 00:41:05.948  INFO 300 --- [           main] ConditionEvaluationReportLoggingListener : 


Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

2018-09-02 00:41:05.954 ERROR 300 --- [           main] o.s.boot.SpringApplication               : Application run failed


org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:155) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544) ~[spring-context-5.0.8.RELEASE.jar:5.0.8.RELEASE]

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:398) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:330) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1258) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]

at kr.revfactory.cloud.reveureka.RevEurekaApplication.main(RevEurekaApplication.java:12) [classes/:na]

Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat

at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:126) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]

at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:86) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]

at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:413) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]

at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:174) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:179) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:152) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]

... 8 common frames omitted

Caused by: java.lang.IllegalStateException: StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[] failed to start

at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.rethrowDeferredStartupExceptions(TomcatWebServer.java:172) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]

at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:110) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]

... 13 common frames omitted


```



Josh Long 의 블로그를 참고하자면 (http://joshlong.com/jl/blogPost/java-10.html)

Java9 부터 일부 모듈이 Java에서 빠지면서 종속성을 추가해야 하는 작업이 필요하다는 군요


Maven 을 사용중이라면 다음과 같이 추가하면 됩니다

<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>


Gradle을 설정에도 추가하니 클래스 패스를 못찾는 에러가 납니다


```shell

javax.xml.bind.JAXBException: Implementation of JAXB-API has not been found on module path or classpath.

```


아래와 같이 추가하니 정상 동작합니다.

runtime('org.glassfish.jaxb:jaxb-runtime:2.3.0')
runtime('javax.activation:activation:1.1.1')

Stackoverflow 를 참고했습니다 

https://stackoverflow.com/questions/46991022/junit-5-java-9-and-gradle-how-to-pass-add-modules

'SpringFramework > Spring Boot' 카테고리의 다른 글

Java10으로 Spring Boot 실행시  (0) 2018.09.02

주변에 보면 Angular 를 하고는 싶으나 진입이 어렵다고들 하십니다.

타입스크립트 ES6 등등 처음 접해보는 개념들과 용어들, 그리고 처음에 뭔가 셋팅이 많이 필요해서 일지도 모릅니다.


(보통 AngularJS 1.x 는 AngularJS로 Angular2.x이후는 Angular로 불립니다.)


Angular-CLI 를 이용하면 Angular2 프로젝트 초기 셋팅에 들어가는 수고를 덜 수 있습니다.

따라서 처음에는 Angular CLI 로 시작해보시길 권장합니다

https://github.com/angular/angular-cli








1. NPM을 이용해서 angular-cli 를 설치

 npm install -g angular-cli 


*npm 이 없으시다면, NODE js를 설치하세요


2. Angular 프로젝트 생성

 ng new {PROJECT_NAME}


3. Angular 프로젝트 실행

 cd {PROJECT_NAME}

 ng serve


이제 브라우저에서 http://localhost:4200/ 으로 접속해보시면 app Works! 메세지를 보실 수 있을 겁니다.















콘솔에 익숙하지 않으신분들 위해 IntellJ 를 이용하여 Angular CLI를 사용해보겠습니다.

JetBrains에서는 아래와 같이 안내를 해주고 있습니다.


https://www.jetbrains.com/help/idea/2016.3/using-angular-cli.html



(사전작업) Plugins 에서 AngularJS와 NodeJS를 설치합니다. 

로컬에 node가 없으신분은 최신버젼 Node JS도 설치해줍니다. ( https://nodejs.org/ko )




1. Languages & Frameworks > Node.js and NPM 에서 angular-cli 를 설치합니다.

(+ 를 클릭해서 angular-cli 검색한 뒤 Install Package 로 설치합니다.)




2. 이제 New > Project 로 angular-cli 프로젝트를 생성합니다.




필요 모듈 다운로드 및 설정중



새 프로젝트 설정 완료




3. 신규 생성된 Angular 프로젝트를 실행해보겠습니다.

하단의 npm탭을 클릭한 뒤 start에서 Run 'start' 실행합니다



끝났습니다~!

브라우저에서 http://localhost:4200 으로 접속해봅니다.

 













추가로 Intellij와 NetBeans에서 Angular2 사용 비교 포스팅 링크 첨부합니다.


https://jaxenter.com/angular-2-intellij-netbeans-eclipse-128461.html#intellij








'웹서비스 > Angular' 카테고리의 다른 글

IntelliJ에서 Angular2 사용하기 with Angular CLI  (0) 2016.12.28

Spring boot 를 Intellij15 에서 실행하니 hot swapping 이 안되서 한참 찾아봄

tomcat 프로젝트로 변경해서는 되는데 bootRun으로 하니 리소스나 html, class 수정해도 반응이 없음

IDE 설정을 변경하고 나니 제대로 수행됨



1. Gradle Settings

buildscript {  
  ext {
    springBootVersion = '1.3.0.RELEASE'
  }
  repositories {
    mavenCentral()
  }
  dependencies {
    classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    classpath 'org.springframework:springloaded:1.2.5.RELEASE'
  }
}


idea {  
  module {
    inheritOutputDirs = false
    outputDir = file("$buildDir/classes/main/")
  }
}


gradle idea




2. IDE Settings

preferences > build,Execution, Deployment > Compiler > check "Make project automatically"


Help > Find Action > search "Registry" > check "compiler.automake.allow.when.app.running"


gradle idea bootRun



참고 :http://www.greggbolinger.com/spring-boot-live-reload-with-gradle-and-intellij-15/

+ Recent posts

티스토리 툴바