I have created a web application using Jersey and Dynamic Web Project of Eclipse. It worked fine when I do ‘Run On Server’.
I wanted to port my project into maven using m2e. I could successfully build WAR file using m2e and ‘Run As –> Maven install’. However, when I do ‘Run As –> Run on Server’ the root classes are not scanned and I get ‘403 Forbidden’ error as a result (proper tomcat user ‘manager’ is created so I think it is not tomcat access issue).
Eclipse console shows that there are no attempts made to scan the root or provider classes (when I run it as plain Dynamic Web Project without maven, it scanned root classes properly). Somehow Jersey application initialization is not happening. It is just not calling ‘com.sun.jersey.api.core.PackagesResourceConfig init’.
When I deploy the m2e generated WAR to standalone tomcat it works fine. I want to debug the web app from Eclipse using eclipse tomcat plugin (just the way it happen in plain Dynamic Web Project without m2e).
Has anyone faced similar problem before? Is there any configuration missing?
Maven Install just installs your app into your Maven repository unless you use other maven plugins to also deploy your WAR file (copy command to put war in deploy folder). Maybe try the other Maven options like Package and see if that works. Also check the projects target folder in eclipse and manually copy your WAR file to the server to see if its the WAR or the server with the problem.The main thing you should do first is verify that the WAR file you compile with maven is the file the server is trying to use.