spring-guides / getting-started-guides

Getting Started Guide template :: The template for new guides and also the place to request them.
https://github.com/spring-guides/getting-started-guides/wiki
Apache License 2.0
519 stars 204 forks source link

code of "Accessing JPA Data with REST" is not working on (maybe) jave 9. #70

Closed bobooboo closed 6 years ago

bobooboo commented 6 years ago

I was running code of "Accessing JPA Data with REST". and I got the following error message.

My development environment:

Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582) ~[na:na] at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185) ~[na:na] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496) ~[na:na] ... 27 common frames omitted

I think, maybe, that Java 9 no longer provide classes such as JAXB etc. I've added and fixed the following code. The program is running.

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

I referenced this comment: https://stackoverflow.com/questions/43574426/how-to-resolve-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception-in-j?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

Thank you.

gregturn commented 6 years ago

We have yet to upgrade the guides in support of Java 9, so I would deem this out of scope.

In the meantime, please use with wiki page to support any Spring Boot project on Java 9.

https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-with-Java-9