问题
I am getting this error from the first attempt to get a jhipster project compiled in STS Eclipse.
The type org.springframework.core.NestedRuntimeException cannot be resolved. It is indirectly referenced from required .class files CustomPersistentRememberMeServices.java /us-modeldrivers-jhipsterTest003/src/main/java/us/modeldrivers/jhipsterTest003/security line 1 Java Problem
My process so far :
- Install jhipster and run a project build
- Create a Spring project in STS Eclipse
- Update the pom to that generated by jhipster
- Copy the jhipster code into the appropriate package in the eclipse project
- Get "tools.jar not found error, so force eclipse to use JDK, not JRE
- Get "javax.servlet.http.HttpServletResponse cannot be resolved" error, so add Tomcat runtime libary to the build path
- Get the NestedRuntimeException not found error, fail to find any answers, realize must be doing something fundamentally wrong.
Any help gratefully received.
EDIT 2014-03-17 I installed fresh versions of STS, including 32 bit and older versions - same result - missing jar files.
I can get rid of missing javax.servlet.http.HttpServletResponse by adding
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-servlet_2.5_spec</artifactId>
<version>1.2</version>
</dependency>
I can get rid of missing javax.servlet.http.HttpServletResponse by adding
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.1.0.RELEASE</version>
</dependency>
But jhipster cant expect you to add core spring to the pom to work.
Something must be wrong outside STS?
I have had the problem before that Maven tries to download the required jar files to Users\IBP.m2\repository\org\springframework\spring-instrument\3.0.5.RELEASE (for example). If this fails then it doesnt try again. So you find the thing that failed and delete its directory - that forces a re-download. But in this case the things that said to be missing are in .m2 from other projects.
Anyway, that is a total guess, and I am totally stuck.
回答1:
I did the following steps and it works
- Install the version 3.4.0 of sts
- Generate a new project using yo jhipster command
- Import the generated project in sts
- Run the Application.java as application
Everything works.
回答2:
This was caused by a corrupt Maven repository. I cleared out the maven cache and it worked fine. Thanks to the support guys of IntelliJ.
回答3:
Your answer above is correct... the primary problem is more than likely that you're doing one of two things:
- Copy/pasting code into STS rather than doing an import.
- Trying to run the application by executing "Run on Server", rather than "Run as Spring Boot".
回答4:
In the "Run As" context menu you should run "Maven clean" then "Maven install". Then you can start the application by "Run As/Java Application" on the Application
class.
回答5:
you can install sts in eclipse and import the project as existing maven project and then exclude the node_modes and bower components from project properties.
来源:https://stackoverflow.com/questions/22424087/what-is-the-correct-eclipse-setup-for-jhipster