Closed mraible closed 3 years ago
The first error, from PostResource
happens because Micronaut has a @Post
annotation and the entity's name is Post
. I changed all references to the Post
entity to com.jhipster.demo.blog.domain.Post
and it fixed the problem. For example:
@Post("/posts")
@ExecuteOn(TaskExecutors.IO)
public HttpResponse<com.jhipster.demo.blog.domain.Post> createPost(@Body com.jhipster.demo.blog.domain.Post post) throws URISyntaxException {
log.debug("REST request to save Post : {}", post);
if (post.getId() != null) {
throw new BadRequestAlertException("A new post cannot already have an ID", ENTITY_NAME, "idexists");
}
com.jhipster.demo.blog.domain.Post result = postRepository.mergeAndSave(post);
URI location = new URI("/api/posts/" + result.getId());
return HttpResponse.created(result).headers(headers -> {
headers.location(location);
HeaderUtil.createEntityCreationAlert(headers, applicationName, true, ENTITY_NAME, result.getId().toString());
});
}
The CacheConfiguration
compilation issue seems to come from cacheProvider hazelcast
in the JDL. If I change it to ehcache
, it works.
It seems like the jdl
command should some sort of validation to make sure the values are valid for a blueprint?
Good point, I think we don't do something to validate the jdl. For the @Post
vs Post
-Entity, do you think we should add that to protected words/names or import e.g. @Post
fully qualified so there will be no clash with any user defined entity name?
@mraible Can you check it works now when changing to a supported cache provider out of box? Will track the sanity check for JDL configuration options in a dedicated issue.
Tried with v7 main branch and it fails. I knew it would, but figured I'd document the error here in case someone is searching for it. 🙂
Error running generator app: TypeError: jhContext.setupServerOptions is not a function
TypeError: jhContext.setupServerOptions is not a function
After installing generator-jhipster@6.10.5
, and using npm link
in a fresh checkout, I can confirm everything compiles. 👍
However, the tests do not pass, nor does the app startup.
Caused by: org.hibernate.cache.CacheException: Caching was explicitly requested, but no RegionFactory was defined and there is not a single registered RegionFactory
at org.hibernate.cache.internal.RegionFactoryInitiator.resolveRegionFactory(RegionFactoryInitiator.java:89)
at org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(RegionFactoryInitiator.java:47)
at org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(RegionFactoryInitiator.java:32)
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:101)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263)
What should I change cacheProvider
too? It's currently set to hazelcast
.
Currently ehcache
, caffeine
and redis
are supported.
I updated blog-oauth2.jdl to use Ehcache. Now I'm able to start it!
FWIW, npm run e2e
fails, but I've seen this on the main generator too, so probably not related to Micronaut.
> blog@0.0.1-SNAPSHOT e2e /Users/mraible/blog
> protractor src/test/javascript/protractor.conf.js
[10:47:52] W/configParser - pattern ./e2e/entities/**/*.spec.ts did not match any files.
[10:47:52] I/launcher - Running 1 instances of WebDriver
[10:47:52] I/direct - Using ChromeDriver directly...
[10:47:52] E/runner - Unable to start a WebDriver session.
[10:47:52] E/launcher - Error: Error: spawn Unknown system error -86
at ChildProcess.spawn (internal/child_process.js:403:11)
at Object.spawn (child_process.js:553:9)
at exec (/Users/mraible/blog/node_modules/selenium-webdriver/io/exec.js:116:27)
at /Users/mraible/blog/node_modules/selenium-webdriver/remote/index.js:219:25
at processTicksAndRejections (internal/process/task_queues.js:93:5)
[10:47:52] E/launcher - Process exited with error code 100
npm ERR! code ELIFECYCLE
npm ERR! errno 100
npm ERR! blog@0.0.1-SNAPSHOT e2e: `protractor src/test/javascript/protractor.conf.js`
npm ERR! Exit status 100
npm ERR!
npm ERR! Failed at the blog@0.0.1-SNAPSHOT e2e script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mraible/.npm/_logs/2021-03-16T16_47_52_614Z-debug.log
It looks like no e2e spec files have been generated
e2e files exist:
➜ blog git:(master) ls src/test/javascript
e2e jest.conf.js protractor.conf.js
jest-global-mocks.ts jest.ts spec
➜ blog git:(master) ls src/test/javascript/e2e
account admin page-objects
➜ blog git:(master) ls src/test/javascript/e2e/account
account.spec.ts
➜ blog git:(master) ls src/test/javascript/e2e/admin
administration.spec.ts
➜ blog git:(master) ls src/test/javascript/e2e/page-objects
jhi-page-objects.ts
Let's close this as the compilation error is fixed. We will tackle the jdl validation in a different issue after jh7 migration.
Overview of the issue
Creating an app with the
blog-oauth2
JDL results in a compilation error.Run
./mvnw
after the process completes. You'll see the following errors:Reproduce the error
Install Micronaut for JHipster 0.8.0, then run the commands above.
Related issues
I also saw a lot of downloads from
jcenter.bintray.com
when creating the app. We should probably fix that before it goes away on May 31, 2021.JHipster Version(s)
JHipster configuration, a
.yo-rc.json
file generated in the root folder.yo-rc.json file
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions
Environment and Tools
openjdk version "11.0.8" 2020-07-14 OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.8+10, mixed mode)
git version 2.24.3 (Apple Git-128)
node: v14.15.0
npm: 6.14.11
yeoman: 3.1.1
yarn: 1.22.10
Docker version 20.10.2, build 2291f61
docker-compose version 1.27.4, build 40524192
identical .jhipster/Blog.json identical .jhipster/Post.json identical .jhipster/Tag.json INFO! Congratulations, JHipster execution is complete!