gothinkster / kotlin-spring-realworld-example-app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error on mvn spring-boot:run

Fe3000 opened this issue Β· comments

Hello, getting this when running mvn spring-boot:run. There is a similar issue but this one is about compilation failed to analyze the declaration UpdateArticle.

[INFO] Compiled 42 Kotlin files using incremental compiler
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  05:54 min
[INFO] Finished at: 2021-05-05T16:46:37+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jetbrains.kotlin:kotlin-maven-plugin:1.1.2:compile (compile) on project api: Compilation failure
[ERROR] org.jetbrains.kotlin.util.KotlinFrontEndException: Front-end Internal error: Failed to analyze declaration UpdateArticle
[ERROR] Cause: Unable to make field private static final jdk.internal.misc.Unsafe jdk.internal.misc.Unsafe.theUnsafe accessible: module java.base does not "opens jdk.internal.misc" to unnamed module @7ec13984
[ERROR] File being compiled and position: (5,1) in /home/findout3r/Desktop/Git/kotlin-spring-realworld-example-app/src/main/kotlin/io/realworld/model/inout/UpdateArticle.kt
[ERROR] PsiElement: @JsonRootName("article")
[ERROR] data class UpdateArticle(var title: String? = null,
[ERROR]                          var description: String? = null,
[ERROR]                          var body: String? = null,
[ERROR]                          var tagList: List<String>? = null)
[ERROR] The root cause was thrown at: AccessibleObject.java:340
[ERROR] 	at org.jetbrains.kotlin.resolve.ExceptionWrappingKtVisitorVoid.visitDeclaration(ExceptionWrappingKtVisitorVoid.kt:41)
[ERROR] 	at org.jetbrains.kotlin.psi.KtVisitorVoid.visitDeclaration(KtVisitorVoid.java:449)
[ERROR] 	at org.jetbrains.kotlin.psi.KtVisitorVoid.visitDeclaration(KtVisitorVoid.java:21)
......

[ERROR] Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private static final jdk.internal.misc.Unsafe jdk.internal.misc.Unsafe.theUnsafe accessible: module java.base does not "opens jdk.internal.misc" to unnamed module @7ec13984
[ERROR] 	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:340)
[ERROR] 	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:280)
[ERROR] 	at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:176)
[ERROR] 	at java.base/java.lang.reflect.Field.setAccessible(Field.java:170)
[ERROR] 	at com.intellij.util.ref.DebugReflectionUtil.getAllFields(DebugReflectionUtil.java:67)
[ERROR] 	at com.intellij.util.ref.DebugReflectionUtil.queueStronglyReferencedValues(DebugReflectionUtil.java:147)
[ERROR] 	at com.intellij.util.ref.DebugReflectionUtil.walkObjects(DebugReflectionUtil.java:137)
[ERROR] 	at com.intellij.util.CachedValueLeakChecker.findReferencedPsi(CachedValueLeakChecker.java:69)
[ERROR] 	at com.intellij.util.CachedValueLeakChecker.checkProvider(CachedValueLeakChecker.java:51)
[ERROR] 	at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:57)
[ERROR] 	at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:140)
[ERROR] 	at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:127)
[ERROR] 	at com.intellij.psi.impl.source.ClassInnerStuffCache.getInnerClasses(ClassInnerStuffCache.java:71)
......
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

It has been a long time this repository was not updated, this is done, I updated the project with the latest version of Spring Boot & Kotlin. @Fe3000 @tms1337

I tested the whole thing with the official React + Redux frontend.

Run:
mvn spring-boot:run

and

git clone https://github.com/khaledosman/react-redux-realworld-example-app.git
cd react-redux-realworld-example-app
npm install
npm install -g serve # if needed
REACT_APP_BACKEND_URL="http://localhost:8080/api" npm run build
serve -s build
open http://localhost:5000

Thanks @agrison I appreciate it πŸ‘πŸ˜„
Great instructions as well, easy to follow

I know this repository was old but I am a junior developer and want to learn more (and might get an interview regarding Kotlin). Once again thanks. πŸ˜„

Good luck with the interview πŸ˜„

Thanks 😊