creating-your-first-micronaut-app-groovy's Introduction
creating-your-first-micronaut-app-groovy's People
Forkers
linpete pabloalba ilmoralito chiranthsiddappa snekse ozlmkilic andersaaberg jameskleeh supsup eltonnunesscreating-your-first-micronaut-app-groovy's Issues
Tutorial fails on Micronaut 2.1.0 with Java 8
Environment:
Windows 10
Micronaut Version: 2.1.0
java version "1.8.0_261"
Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode)
Followed the instructions, step 2, 3, 4. (did not download or clone from github).
Step 5: > Task :test FAILED. test results age shows:
org.gradle.api.internal.tasks.testing.TestSuiteExecutionException: Could not execute test class 'example.micronaut.CompleteSpec'.
Caused by: java.lang.UnsupportedClassVersionError: example/micronaut/CompleteSpec has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
Step 6:
> Task :run FAILED
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: example/micronaut/Application has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
Interestingly: If I download the zip, cd into folder complete and then run "gradlew test" this does not produce the error above. The test completes without errors.
gradlew run lists errors (see below) but does start up. The browser however displays a json message "Page not found"
> Task :run
08:07:03,531 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
08:07:03,532 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
08:07:03,532 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/C:/_1_Projects/Micronaut/creating-your-first-micronaut-app-groovy-master/complete/build/resources/main/logback.xml]
08:07:03,594 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
08:07:03,596 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
08:07:03,604 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
08:07:03,611 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
08:07:03,656 |-INFO in ch.qos.logback.core.ConsoleAppender[STDOUT] - Enabling JANSI WindowsAnsiOutputStream for the console.
08:07:03,657 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - Failed to create WindowsAnsiOutputStream. Falling back on the default stream. ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type org.fusesource.jansi.WindowsAnsiOutputStream
at ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type org.fusesource.jansi.WindowsAnsiOutputStream
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:69)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:40)
at at ch.qos.logback.core.ConsoleAppender.getTargetStreamForWindows(ConsoleAppender.java:88)
at at ch.qos.logback.core.ConsoleAppender.start(ConsoleAppender.java:79)
at at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:90)
at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:309)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:193)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:179)
at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:165)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:152)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
at at io.micronaut.runtime.Micronaut.<clinit>(Micronaut.java:44)
at at example.micronaut.Application.main(Application.groovy:9)
Caused by: java.lang.ClassNotFoundException: org.fusesource.jansi.WindowsAnsiOutputStream
at at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:56)
at ... 23 common frames omitted
08:07:03,657 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
08:07:03,657 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
08:07:03,658 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
08:07:03,659 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@8bd1b6a - Registering current configuration as safe fallback point
08:07:06.118 [main] INFO io.micronaut.runtime.Micronaut - Startup completed in 2454ms. Server Running: http://localhost:8080
<==========---> 80% EXECUTING [6m 3s]
> :run
./gradlew test does not execute groovy tests
I am following the tutorial at https://guides.micronaut.io/creating-your-first-micronaut-app-groovy/guide/index.html and running the gradle command ./gradlew test does not run the spock specifications. Weirdly, it does it when I run it from IntelliJ.
The blaming part is
// use JUnit 5 platform
test {
useJUnitPlatform()
}
in build.gradle file. Commenting out this part makes the trick.
Content type:json
By default this example returns a content-type: application/json, but it is returning a String. Some browsers will complain and not show the "Hello world"
package declaration incorrect
After cloning the repository the file complete/src/main/groovy/example/micronaut/Application.groovy uses:
package example
but should use
package example.micronaut
I had the problem that "example.micronaut.Application" could not be found when running gradle run
Update to Micronaut 2.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.