Reputation: 277
I've two Spring projects:
Project B - is the backend Project A - is a Rest API that use the backend
I'm trying to move from Eclipse to IntelliJ and so these 2 projects are written using Eclipse and they work fine both in Eclipse with its internal Tomcat than in a "standard" Tomcat after I package the A in a war file.
So the problem I've is only with IntelliJ and in particular if I deploy the project within IntelliJ.
What I did:
1) Imported project A in IntelliJ and configure it as Spring project (it was autodetected) 2) Imported project B in IntelliJ and configure it as Spring project (it was autodetected) 3) Added project B as module in Project A 4) Configured a local instance of Tomcat 7 (but also tried with Tomcat8) 5) Run the project
What I see: no deployment errors or anything related but if I call a random Rest method in the Tomcat log I see that all the security chain of Spring Security is executed without error but it seems to skip the execution of the code in the controller (that is in project A). I've also attached a debugger but since the execution stops before entering the bytecode execution I can't see anything.
I'm a newbye of IntelliJ and I'm sure I'm doing some mistakes during import of the projects that as said they work just fine in Eclipse or in Tomcat, but cannot find out where...
UPDATE IntelliJ creates a directory ROOT in Tomcat\webapps and copies in it all project files. Apparently it copies not only the jar file of ProjectB but also related src/resources/xml and everything in the original project.
UPDATE2 (Apparently solved) Apparently the problem is just a path problem. Since it deploys under a ROOT folder I can skip it in the URL. But it seems to me a strange behaviour anyway...
Thanks
Upvotes: 0
Views: 1174
Reputation: 44942
There should be no problems with debugging the issue, source code of all the major runtime components is available (Spring, Tomcat, etc). Unfortunately saying that "execution stops before entering the bytecode execution" isn't very helpful for someone who is not familiar with your project.
If you there are differences between IDEs it might be worth to see what happens when: 1) projects are packaged as WARs and deployed to standalone Tomcat 2) Tomcat is started from your build system (e.g. in Maven there's tomcat7-maven-plugin)
Option 2 is probably what I would use. That way you don't have to configure IDEs as everything is run from command line.
Upvotes: 1