Generator-jhipster: Using UAA ends in JAXBException

Created on 24 May 2019  ·  5Comments  ·  Source: jhipster/generator-jhipster

Overview of the issue

I try starting/building a new project with uaa enabled microservices. So i create the uaa service and som uaa enabled microservices, but i can't start/build the uaa nor the microservices with java 11 or 12. Because JAXB not found. i try to add the required maven dependencies, but this also not working.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project main-application-service: Fatal error compiling: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException: javax.xml.bind.JAXBException -> [Help 1]

Motivation for or Use Case

Microservices without uaa enabled, starts without any problems. But if you want a project with uaa its not working.

Reproduce the error
  1. create a uaa service with the generator and try to build it with java 11 or 12
  2. create a microservice with uaa as authentificationservice and try to build it with java 11 or 12
Suggest a Fix

I think, the uaa service generator is not updated to use with newer java versions then java 8

JHipster Version(s)

jHipster 6.0.1

JHipster configuration

INFO! Using JHipster version installed locally in current project's node_modules
INFO! Executing jhipster:info
INFO! Options: from-cli: true
Welcome to the JHipster Information Sub-Generator

JHipster Version(s)
[email protected] /Users/rizzi/Desktop/jhipster-demo
└── [email protected] 

##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.epbf.bitsbutler.ms.mainapplication",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "6.0.1",
    "applicationType": "microservice",
    "baseName": "mainApplicationService",
    "packageName": "com.epbf.bitsbutler.ms.mainapplication",
    "packageFolder": "com/epbf/bitsbutler/ms/mainapplication",
    "serverPort": "8081",
    "authenticationType": "jwt",
    "cacheProvider": "hazelcast",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "mariadb",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": "eureka",
    "buildTool": "maven",
    "enableSwaggerCodegen": false,
    "jwtSecretKey": "bXktc2VjcmV0LXRva2VuLXRvLWNoYW5nZS1pbi1wcm9kdWN0aW9uLWFuZC10by1rZWVwLWluLWEtc2VjdXJlLXBsYWNl",
    "testFrameworks": [
      "gatling"
    ],
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "otherModules": [],
    "enableTranslation": true,
    "clientPackageManager": "npm",
    "nativeLanguage": "en",
    "languages": [
      "en",
      "de"
    ],
    "skipClient": true,
    "skipUserManagement": true
  }
}

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory


JDL entity definitions


Environment and Tools

openjdk version "12.0.1" 2019-04-16
OpenJDK Runtime Environment AdoptOpenJDK (build 12.0.1+12)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 12.0.1+12, mixed mode, sharing)

git version 2.21.0

node: v12.3.1

npm: 6.9.0

yeoman: 2.0.5

yarn: 1.16.0

Docker version 18.09.2, build 6247962

docker-compose version 1.23.2, build 1110ad01

INFO! Congratulations, JHipster execution is complete!

Entity configuration(s) entityName.json files generated in the .jhipster directory

no entities needed for forcing the exception

Browsers and Operating System

Latest MacOS Mojave with Java 11 and 12

  • [X] Checking this box is mandatory (this is just to show you read everything)
area microservice uaa

All 5 comments

If you add JAXB as a dependency, does it work?

<dependency>
    <groupId>org.glassfish.jaxb</groupId>
    <artifactId>jaxb-runtime</artifactId>
</dependency>

This is by default already in the dependencies. I also try to some combinations with jaxb-api, jaxb-core, jaxb-impl, activation but nothing works for me

@RizziCR Thanks for reporting. I was able to reproduce the problem and a quick workaround is to add the following under hibernate-jpamodelgen within the configuration of the maven-compiler-plugin:

                        <path>
                            <groupId>org.glassfish.jaxb</groupId>
                            <artifactId>jaxb-runtime</artifactId>
                            <version>${jaxb-runtime.version}</version>
                        </path>

I think this might be caused by a change I made :flushed: . Will investigate further and do a PR. In the meantime can you please try the workaround and let us know if it works for you?

@pvliss Thanks for the quick reply. I can confirm, that it works with the workaround ;)
Thanks

@RizziCR Great and thanks for the feedback!!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shivroy121 picture shivroy121  ·  3Comments

SudharakaP picture SudharakaP  ·  3Comments

SudharakaP picture SudharakaP  ·  3Comments

RizziCR picture RizziCR  ·  3Comments

marcelinobadin picture marcelinobadin  ·  3Comments