-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
compile error (missing javax.Servlet and Undertow) while importing in eclipse #9175
Comments
I can confirm both the problem and suggested fix. I have encountered this a few times (randomly) with my STS 3 while the maven compiles fine. This is really an annoying error and you can not run the project or tests from the IDE. |
@Arnaud-Nauwynck @pmverma : can one of you do a PR to apply the fix ? |
Are you sure you activated either the "dev" or the "prod" Maven profile ? |
@cbornet No, I didn't activated maven profile manually in eclipse. I assume that it should work out-of-the-box and we have not to do so previously either. I will try it tonight and update here. |
Hi @cbornet I can confirm, that after manually selecting the dev profile in eclipse. It works. But we didn't need to do this step previously, anything has changed? |
This is also happening inside vscode and it is really annoying. I will do a PR with suggested fix very soon. |
The issue if I'm not mistaken is that the dev profile is not set. Adding the deps to the pom will probably not be enough as you should be either in dev profile or prod profile. We should even check that at runtime. |
yes that means the profile is not set, even though it's active by default in Maven (and that used to work!). So I'm guessing there is an issue in the Eclipse Maven plugin -> we should find a workaround, but most importantly this bug should reported to them (or we should find the existing ticket and link it here) |
Of course activating the profile manually in the eclipse project setting works fine. But I'm not sure how to do it in visual studio code. And yes this issue seems related to the eclipse Maven plugin. |
* add support for thin jar in gae Only adds to maven build; work in progress * correcting mistake introduced in a pervious pull request A previous pull request incorrectly removes the com.google.cloud.tools when gaeCloudSQLInstanceNeeded is set to false #10362 * add correct handlers for retrieving static files * remove bootWar from gradle The new GAE with Java 11 builds on JAR; this has been done on the maven side. * correcting mistake introduced in a pervious pull request A previous pull request incorrectly removes the com.google.cloud.tools when gaeCloudSQLInstanceNeeded is set to false * replace deprecated value "project" by "projectId" * testing with cloudsql; change string to single quotes If this is not done the following error is created; yntaxError: Multi-line double-quoted string needs to be sufficiently indented (16:14) 14 | datasource: 15 | type: com.zaxxer.hikari.HikariDataSource > 16 | url: "jdbc:mysql://google/mysql?cloudSqlInstance=abstract-block-253023:us-central1:testjhipster | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * Add copyright information * add mainclass name instead of basename * add gradle support for unjaring the original jar This adds Gradle side support for thin jars * missing symbol from previous commit * remove the original jar as per discussion * minor bug fix per code review * add max heap size to entrypoint field in app.yaml * Revert Xmx change * correction of the url strings * remove whitespaces in project ID * simplify the prod-gae profile definition * thin jar generation support for maven * thin jar generation support for gradle * adjustments to the maven and gradle deployment commands * add thinResolve step before staging * prettier issue fix * add error code checking for gcloud - gcloud seems to print out info messages to the error stream as well. We need to check whether it's an actual error * add trim to remove unnecessary newline and remove silent mode for prompt in order to trigger cloud sql api * fix the trim line more elegantly * add missing maven dependency * refactor code to include application-prod-gae.yml file regardless of Cloud SQL - this makes sure the correct port environment variable is passed whether the user chose to use cloud sql or not. * fix dependency problem (similar to #9175) to get rid of the clean option * add dependency before the check for cloud sql * changed per code review
Overview of the issue
importing a jhipster project does not compile in eclipse, but compiles in maven
Eclipse complains about missing class: javax.servlet.ServletException
Adding
solved this first error, but there is 16 others (all concerning undertow) after:
Adding this solves the remaining errors:
Motivation for or Use Case
using eclipse..
Reproduce the error
create empty jhipster project, choosing maven
then import in eclipse using "import ... > existing maven project"
eclipse version : 2018-12, with jdk8, standard eclipse java, no plugins
Related issues
Suggest a Fix
adding this in the pom.xml solves the issue:
JHipster Version(s)
JHipster version v5.8.1
JHipster configuration
Welcome to the JHipster Information Sub-Generator
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
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
git version 2.17.0
node: v10.15.1
npm: 6.4.1
yeoman: 2.0.5
yarn: 1.13.0
Entity configuration(s)
entityName.json
files generated in the.jhipster
directorynone
Browsers and Operating System
Windows 10.
browsers: any (compile time error)
The text was updated successfully, but these errors were encountered: