jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.57k stars 4.02k forks source link

Failure when generating with Cassandra and no i18n (master) #3394

Closed raphaelbrugier closed 8 years ago

raphaelbrugier commented 8 years ago
Overview of the issue

In the master, the generator does not work when trying to generate with a Cassandra database and not internationalization

JHipster Version(s)

master (a1ed454)

JHipster configuration, a .yo-rc.json file generated in the root folder
{
  "generator-jhipster": {
    "jhipsterVersion": "3.0.0",
    "baseName": "i18n",
    "packageName": "com.mycompany.myapp",
    "packageFolder": "com/mycompany/myapp",
    "serverPort": "8080",
    "authenticationType": "session",
    "hibernateCache": "no",
    "clusteredHttpSession": "no",
    "websocket": "no",
    "databaseType": "cassandra",
    "devDatabaseType": "cassandra",
    "prodDatabaseType": "cassandra",
    "searchEngine": "no",
    "buildTool": "maven",
    "enableSocialSignIn": false,
    "rememberMeKey": "3e8df6fe47976edc3f9f48f15d0c2cb241c94134",
    "useSass": false,
    "applicationType": "monolith",
    "testFrameworks": [
      "gatling"
    ],
    "jhiPrefix": "jhi",
    "enableTranslation": false
  }
Reproduce the error

run yo:jhipster on the .yo-rc.json above

Suggest a Fix

I've tracked in the git history the regression was introduced by commit 8683b49 but I have not found the root cause yet. Maybe @wmarques have an idea? Otherwise I'll continue my analysis.

What do you thing to also add a test to in the samples to cover this case? I don't know how much it cost - in build time - to add a new configuration.

ruddell commented 8 years ago

I ran into (maybe) the same issue the other day when trying to run the docker-compose subgenerator. Just confirmed with the latest master but have not looked into it.

Checking Docker images in applications' directories...
events.js:154
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot set property 'context' of undefined
    at module.exports.DockerComposeGenerator.extend.configuring.setAppsYaml (/Users/ruddell/Dev/Contrib/generator-jhipster/generators/docker-compose/index.js:307:58)
    at Object.<anonymous> (/Users/ruddell/Dev/Contrib/generator-jhipster/node_modules/yeoman-generator/lib/base.js:436:25)
    at /Users/ruddell/Dev/Contrib/generator-jhipster/node_modules/yeoman-generator/node_modules/run-async/index.js:24:25
    at /Users/ruddell/Dev/Contrib/generator-jhipster/node_modules/yeoman-generator/lib/base.js:448:8
    at processImmediate [as _immediateCallback] (timers.js:383:17)

.yo-rc.json

{
  "generator-jhipster": {
    "jhipsterVersion": "3.0.0",
    "baseName": "casstest",
    "packageName": "com.jruddell.test",
    "packageFolder": "com/jruddell/test",
    "serverPort": "8085",
    "authenticationType": "jwt",
    "hibernateCache": "no",
    "databaseType": "cassandra",
    "devDatabaseType": "cassandra",
    "prodDatabaseType": "cassandra",
    "searchEngine": "no",
    "buildTool": "maven",
    "jwtSecretKey": "a310878c074bd02c67adc51c484c420978c039aa",
    "enableTranslation": false,
    "applicationType": "microservice",
    "testFrameworks": [
      "gatling"
    ],
    "jhiPrefix": "jhi",
    "skipClient": true,
    "skipUserManagement": true
  }
}

Reproduce (gateway, registry, other microservices work fine)

mkdir docker-config casstest && cd casstest
yo jhipster
./mvnw package -Pprod -DskipTests docker:build 
cd ../docker-config
yo jhipster:docker-compose #select microservices and gateway in ../ directory
pascalgrimaud commented 8 years ago

@raphaelbrugier : I'm working on it

@ruddell : it's another issue

pascalgrimaud commented 8 years ago

@ruddell : can you open a new issue about it ? It's related to the recent change on cassandra and cassandra-cluster

I try to work on it this morning

raphaelbrugier commented 8 years ago

Perfect, thanks @pascalgrimaud ! I'm sorry, I forgot to copy / paste the stack trace when reporting the issue