Wednesday, January 7, 2009

Netbeans modified web.xml when it shouldn't

A couple of days ago, I was working on a J2EE project using EJB 3.0 and plain JSP/Servlets. I used Netbeans 6.0.1 with GlassFish 9.1 on my XP Professional PC. For some reason, the project build kept on failing, without any changes in the configuration files which I barely touched. After digging through the stack traces and log files I got, I found this message "The ResourceConfig instance does not contain any root resource classes". I googled for that and found that others got the same problem. I followed this thread on forums, and was really angry to find that Netbeans added stuff to my web.xml, which of course couldn't be resolved by the deployment script. This is the extra parts the guys mentioned on the forum and I found in my web.xml:


It seemed like it had to do with the RESTful webservices plug-ins which I didn't even reference in that project. I removed the extra parts from my web.xml and also removed the RESTful plug-ins to make sure it doesn't happen again and everything went fine.

No comments: