Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to micronaut 2.0.0 #108

Merged
merged 47 commits into from
Jun 28, 2020

Conversation

atomfrede
Copy link
Member

@atomfrede atomfrede commented Jun 16, 2020

This PR updates

  • to RC1 of micronaut 2
  • aligns gradle with the configuration generated by micronaut run (e.g. watch and incremental compilation)
  • use micronaut maven plugin instead of maven exec
  • replace deprecated parts from security module (password encoder, rejection handler)

Open Issues

  • Cache Support seems to have changed (missing dependency)
  • Some dependency versions seem not to be part of the 2.x bom (changed coordinates)

Updates #89

@atomfrede atomfrede added the dependencies Pull requests that update a dependency file label Jun 16, 2020
@atomfrede
Copy link
Member Author

Using my local setup (latest main generator and gradle 6.5) the server tests are running just fine

@atomfrede atomfrede changed the title update to latest RC1 of micronaut update to micronaut 2.0.0.RC1 Jun 16, 2020
@JasonTypesCodes
Copy link
Contributor

@atomfrede I manually updated a now-outdated version of the sample app to Micronaut 2 for our comparisions project. It may be of some help: https://github.com/micronaut-projects/micronaut-comparisons/tree/master/jhipster-sample-app-micronaut-2

@atomfrede
Copy link
Member Author

atomfrede commented Jun 18, 2020

Small heads up, I have generated an application with gradle and jwt, it works fine (build, run, tests). Seems the incremental build support does not work fine with the annotation processing or something else we have. Need to check.

Maven seems to have a dependency problem, I think I already know, just need to fix it.

Using oauth there is a NPE in the DefaultUserDetailsMapper, need to check if it is due to our configuration. Furthermore I am a little confused. In the RC1 documentation it is mentioned that DefaultOpenIdUserDetailsMapper has been renamed to DefaultOpenIdAuthenticationMapper but it doesn't exist, even not in the latest master branch.

EDIT: But of course I am testing against latest main generator master which has already e.g. updated gradle, but I guess thats unrelated.

@atomfrede atomfrede force-pushed the 89-update-to-micronaut-2-rc branch 2 times, most recently from 981a15b to 161e049 Compare June 18, 2020 21:42
@atomfrede
Copy link
Member Author

I will check why the generated jar is not starting using ./gradlew run and ./mvnw mn:run works just fine.

@atomfrede atomfrede force-pushed the 89-update-to-micronaut-2-rc branch from 161e049 to 790b6ba Compare June 19, 2020 20:01
@atomfrede
Copy link
Member Author

@JasonTypesCodes If you have time can you test it maybe? I have generated the gradle-jwt-angular sample and did test. integrationTest and e2e, all green. It seems to be a timeout error on the ci, not sure why exactly.

@JasonTypesCodes
Copy link
Contributor

@atomfrede Sure thing. I'll give it a go this evening.

@atomfrede
Copy link
Member Author

Thanks very much!

@JasonTypesCodes
Copy link
Contributor

@atomfrede I've tried it a few different ways on my local machine and I'm not getting any failures. I did notice that we aren't using @ExecuteOn on blocking operations which could cause the event loop to lock in seemingly random places. I'll try applying that as an experiment and push a branch up to see if things are happier in that scenario

@JasonTypesCodes
Copy link
Contributor

@atomfrede That didn't work, but I did notice this when watching the GH Action run:

23:26:33.968 [pool-1-thread-1] ERROR i.micronaut.scheduling.TaskExecutors - Error occurred executing @Async method [void migrateAsync(LiquibaseConfigurationProperties config,DataSource dataSource)]: null
java.lang.NullPointerException: null

I don't recall seeing that on my machine. I'll look into that a bit

@atomfrede
Copy link
Member Author

Yes I have sent it too and wondering why as it also don't happen when doing it locally.

@JasonTypesCodes
Copy link
Contributor

I've recreated it a couple times on my machine using the run-sample script so I started looking through the commands that the scripts are running. I've been able to recreate it a few times by starting the jar in a background process using &. Once the migration has occurred on the database, it doesn't appear to happen again.

@JasonTypesCodes
Copy link
Contributor

I spoke too soon. I just witnessed it happening without a background process. I can't dedicate much time to this right now, but this reminds me of an issue we had at some point in Micronaut 1.3.x with Liquibase Migrations. (cc @ilopmar)

Full Stack Trace is:

14:48:23.296 [pool-1-thread-1] ERROR i.micronaut.scheduling.TaskExecutors - Error occurred executing @Async method [void migrateAsync(LiquibaseConfigurationProperties config,DataSource dataSource)]: null
java.lang.NullPointerException: null
        at liquibase.util.LiquibaseUtil.getBuildInfo(LiquibaseUtil.java:45)
        at liquibase.util.LiquibaseUtil.getBuildVersion(LiquibaseUtil.java:17)
        at liquibase.sqlgenerator.core.MarkChangeSetRanGenerator.generateSql(MarkChangeSetRanGenerator.java:91)
        at liquibase.sqlgenerator.core.MarkChangeSetRanGenerator.generateSql(MarkChangeSetRanGenerator.java:25)
        at liquibase.sqlgenerator.SqlGeneratorChain.generateSql(SqlGeneratorChain.java:30)
        at liquibase.sqlgenerator.SqlGeneratorFactory.generateSql(SqlGeneratorFactory.java:222)
        at liquibase.executor.AbstractExecutor.applyVisitors(AbstractExecutor.java:25)
        at liquibase.executor.jvm.JdbcExecutor.access$600(JdbcExecutor.java:40)
        at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:384)
        at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:59)
        at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:131)
        at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:111)
        at liquibase.changelog.StandardChangeLogHistoryService.setExecType(StandardChangeLogHistoryService.java:388)
        at liquibase.database.AbstractJdbcDatabase.markChangeSetExecStatus(AbstractJdbcDatabase.java:1130)
        at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:64)
        at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:83)
        at liquibase.Liquibase.update(Liquibase.java:202)
        at liquibase.Liquibase.update(Liquibase.java:179)
        at io.micronaut.liquibase.LiquibaseMigrationRunner.performUpdate(LiquibaseMigrationRunner.java:189)
        at io.micronaut.liquibase.LiquibaseMigrationRunner.migrate(LiquibaseMigrationRunner.java:146)
        at io.micronaut.liquibase.LiquibaseMigrationRunner.migrateAsync(LiquibaseMigrationRunner.java:122)
        at io.micronaut.liquibase.$LiquibaseMigrationRunnerDefinition$Intercepted.$$access0(Unknown Source)
        at io.micronaut.liquibase.$LiquibaseMigrationRunnerDefinition$Intercepted$$proxy0.invokeInternal(Unknown Source)
        at io.micronaut.context.AbstractExecutableMethod.invoke(AbstractExecutableMethod.java:146)
        at io.micronaut.aop.chain.MethodInterceptorChain.proceed(MethodInterceptorChain.java:60)
        at io.micronaut.scheduling.async.AsyncInterceptor.lambda$intercept$3(AsyncInterceptor.java:97)
        at io.micrometer.core.instrument.composite.CompositeTimer.record(CompositeTimer.java:79)
        at io.micrometer.core.instrument.Timer.lambda$wrap$0(Timer.java:148)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)

@atomfrede
Copy link
Member Author

Thanks @JasonTypesCodes for taking a look. I will try to dig deeper whats going on.

@atomfrede
Copy link
Member Author

Some more small insights. When using maven, there seems to be the jackson version is not correct (2.10.4). This results in e.g. method not found exception in the JWTTest. Updating it to 2.11 (as it is already in gradle) result sin a different error (not found exception).

@atomfrede atomfrede force-pushed the 89-update-to-micronaut-2-rc branch from 235cfe1 to 424a5e1 Compare June 22, 2020 22:12
@atomfrede atomfrede changed the title update to micronaut 2.0.0.RC1 update to micronaut 2.0.0.RC2 Jun 23, 2020
@atomfrede atomfrede linked an issue Jun 23, 2020 that may be closed by this pull request
@atomfrede
Copy link
Member Author

Small update:

  • doing locally ./test-integration/run-sample.sh gradle-jwt-angular works fine, even e2e. Not sure what to do about the failing tests, they look like a timeout, which is not there when running it on my machine
  • the JWTFilterTest returns a 303 redirect when doing oauth2, did not check if that has changed compared to mn 1.x. Apart from the that e2e tests seem to generate jwt based authentication.

@JasonTypesCodes
Copy link
Contributor

I'll take another stab at figuring this out this afternoon. This is great work @atomfrede !

@atomfrede
Copy link
Member Author

Thanks @JasonTypesCodes ❤️ Testing manually oauth works just fine.

@atomfrede atomfrede force-pushed the 89-update-to-micronaut-2-rc branch from 0263612 to e6133ec Compare June 27, 2020 09:25
@atomfrede
Copy link
Member Author

I would say let's merge it. I can take care of updating the blueprint to the 6.10 main generator release later today so we can have heroku deployment merged afterwards.

@atomfrede atomfrede merged commit 68abec7 into jhipster:master Jun 28, 2020
@atomfrede
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update to Micronaut 2
3 participants