• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

org.springframework.boot 2.0.0 release has an issue

 
Ranch Hand
Posts: 1769
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am reading the tutorial about Spring boot : https://spring.io/guides/gs/spring-boot/#scratch.
My pom.xml:


When I ran SpringBootWebApplication  from Eclipse using the "Run As" -> "Java Application", I got this:


Failed to instantiate SLF4J LoggerFactory
Reported exception:
java.lang.NoClassDefFoundError: ch/qos/logback/core/joran/spi/JoranException
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
.....
at com.in28minutes.springboot.tutorial.SpringBootWebApplication.main(SpringBootWebApplication.java:10)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.core.joran.spi.JoranException
at java.net.URLClassLoader.findClass(Unknown Source)
...
Exception in thread "main" java.lang.NoClassDefFoundError: ch/qos/logback/core/joran/spi/JoranException
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)




But if I used 1.5.9 org.springframework.boot , it works.


<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
<relativePath />
</parent>



But the problem is version 1.5.9 does not have this class import org.springframework.boot.web.server.LocalServerPort. I cannot continue to run the next example in the tutorial.
Please advice. Thanks.
 
Bartender
Posts: 1868
81
Android IntelliJ IDE MySQL Database Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to https://spring.io/projects/spring-boot#learn Spring Boot is at 2.0.3, but your sample code is using an older version 2.0.0.RELEASE.
If you change to a newer version the newest GA do you get different results?
If you change to a newer snapshot fo you get different results?
 
Himai Minh
Ranch Hand
Posts: 1769
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried org.springframework.boot version 2.0.2 and 2.0.3 (the latest), it gave me the same SLF4J LoggerFactory error.
 
Ranch Hand
Posts: 570
3
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps you miss to add logback dependencies in pom.xml ?
 
Pete Letkeman
Bartender
Posts: 1868
81
Android IntelliJ IDE MySQL Database Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This project worked for me, and here is what I did:
1) Downloaded the git (as a zip) to my Windows 10 Pro system
2) Extracted the project, opened "completed" in IntelliJ
3) Removed the Maven config and only used the Gradle config
4) Ran the project.

I only know some Gradle and I don't know Maven.
From what I understand is they should both be able to do the same job, however Gradle is a little newer.

I know that there are some changes that you may need to make to your configuration files (Maven/Gradle) if you are using a version of Java other then Java 8.

Maybe if you try out the Gradle version of this project it will work for you?
 
Himai Minh
Ranch Hand
Posts: 1769
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi John Joe, I use the lastest org.framework.boot and I included the logback dependency in my pom.xm. When I ran the hello.Application in the tutorial in my previous post, it gave me an error saying that it cannot find the ch/qos/logback/core/joran/spi/JoranException.
But as I checked my Maven dependencies, this JoranException class is in one of the jar file.
But if I used the 1.5.10 version of org.framework.boot, it works.

This is my pom.xml:


Failed to instantiate SLF4J LoggerFactory
Reported exception:
java.lang.NoClassDefFoundError: ch/qos/logback/core/joran/spi/JoranException


 
Himai Minh
Ranch Hand
Posts: 1769
12
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Pete and John Joe,
I install gradle plugin to my Eclipse Oxygen by following the example here https://www.youtube.com/watch?v=jEX8Wh1TLz4.
In the build.gradle, I include dependencies org.springframework.boot:spring-boot-gradle-plugin:2.0.3.RELEASE.
I ran the hello.Application, it works.
I guess spring-boot-gradle-plugin:2.0.3 works , but not org.framework.boot 2.0.3.
 
Get out of my mind! Look! A tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!