This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When a REST Service is created in a web application with Spring Framework enabled the exception is thrown during deployment : SEVERE: Exception while invoking class com.sun.enterprise.web.WebApplication start method java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes. (Tested with Java EE 6 web application and GlassFish V3)
Note: the exception is thrown even when issue 177679 (compilation problem) is fixed. That exception is caused by missing jersey-spring.jar on classpath. The entire workaround for this issue of several actions: 1. case: Simple REST Resources (no REST resources from entity classes) - if rest configuration is based on web.xml, the ServletAdaptor must contain init params: <servlet> <servlet-name>ServletAdaptor</servlet-name> <servlet-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</servlet-class> <init-param> <param-name>com.sun.jersey.config.property.packages</param-name> <param-value>org.mypackage.rest.services</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> 2. case: REST resources from entity classes - rest configuration must be based on web.xml, the ServletAdaptor must contain init params (see above) - persistence.xml must contain provider element : <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> <persistence-unit name="RestApplication3PU" transaction-type="JTA"> <provider>oracle.toplink.essentials.PersistenceProvider</provider> <jta-data-source>jdbc/sample</jta-data-source> <properties/> </persistence-unit> </persistence> - persistence.xml doesn't work with version="2.0" Action Item 1: resolve how to run REST services with Spring with Persistence 2.0 Action Item 2: resolve how to run REST services with Spring without web.xml
Integrated into 'main-golden', will be available in build *201001070200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/ac6f7f763ab9 User: mkuchtiak@netbeans.org Log: #179216: fixing first part of the issue
*** Bug 201386 has been marked as a duplicate of this bug. ***
Known problem with persistence with version 2.0. Postpone to the next release.
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss