Note that there are some explanatory texts on larger screens.

plurals
  1. PO(PrimePush) com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes
    text
    copied!<p>I am new to PrimePush and want to try it out. I followed this <a href="http://kahimyang.info/kauswagan/howto_blogs/1298-using_primefaces_primepush_with_tomcat_7" rel="nofollow">tutorial</a> <br> However, when I run the register.xhtml file, I hit the error of <em>com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.</em> <br><br> These are jar that I have<br></p> <ul> <li>atmosphere-compat-jbossweb-1.0.1</li> <li>atmosphere-compat-tomcat-1.0.1</li> <li>atmostphere-compat-tomcat7-1.0.1</li> <li>atmostphere-runtime-1.0.1</li> <li>primefaces-3.4.2</li> <li>slf4j-api-1.7.2</li> <li>slf4j-simple-1.7.2</li> <li>JSF 2.1 (Mojarra 2.1.6)</li> </ul> <p>I am using <strong>tomcat7</strong> and <strong>jre7</strong></p> <p>This is <strong>web.xml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"&gt; &lt;display-name&gt;Test1&lt;/display-name&gt; &lt;welcome-file-list&gt; &lt;welcome-file&gt;index.html&lt;/welcome-file&gt; &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt; &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;welcome-file&gt;default.html&lt;/welcome-file&gt; &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt; &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;servlet&gt; &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt; &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt; &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt; &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;context-param&gt; &lt;description&gt;State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2&lt;/description&gt; &lt;param-name&gt;javax.faces.STATE_SAVING_METHOD&lt;/param-name&gt; &lt;param-value&gt;client&lt;/param-value&gt; &lt;/context-param&gt; &lt;context-param&gt; &lt;param-name&gt;javax.servlet.jsp.jstl.fmt.localizationContext&lt;/param-name&gt; &lt;param-value&gt;resources.application&lt;/param-value&gt; &lt;/context-param&gt; &lt;context-param&gt; &lt;param-name&gt;javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL&lt;/param-name&gt; &lt;param-value&gt;true&lt;/param-value&gt; &lt;/context-param&gt; &lt;listener&gt; &lt;listener-class&gt;com.sun.faces.config.ConfigureListener&lt;/listener-class&gt; &lt;/listener&gt; &lt;context-param&gt; &lt;param-name&gt;primefaces.PUSH_SERVER_URL&lt;/param-name&gt; &lt;param-value&gt;http://localhost:8080&lt;/param-value&gt; &lt;/context-param&gt; &lt;servlet&gt; &lt;servlet-name&gt;Push Servlet&lt;/servlet-name&gt; &lt;servlet-class&gt;org.primefaces.push.PushServlet&lt;/servlet-class&gt; &lt;init-param&gt; &lt;param-name&gt;org.atmosphere.cpr.broadcasterCacheClass&lt;/param-name&gt; &lt;param-value&gt;org.atmosphere.cache.HeaderBroadcasterCache&lt;/param-value&gt; &lt;/init-param&gt; &lt;init-param&gt; &lt;param-name&gt;org.atmosphere.cpr.broadcasterClass&lt;/param-name&gt; &lt;param-value&gt;org.atmosphere.cpr.DefaultBroadcaster&lt;/param-value&gt; &lt;/init-param&gt; &lt;init-param&gt; &lt;param-name&gt;org.atmosphere.cpr.broadcastFilterClasses&lt;/param-name&gt; &lt;param-value&gt;org.atmosphere.client.TrackMessageSizeFilter&lt;/param-value&gt; &lt;/init-param&gt; &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;Push Servlet&lt;/servlet-name&gt; &lt;url-pattern&gt;/primepush/*&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;servlet&gt; &lt;servlet-name&gt;jersey-serlvet&lt;/servlet-name&gt; &lt;servlet-class&gt; com.sun.jersey.spi.container.servlet.ServletContainer &lt;/servlet-class&gt; &lt;init-param&gt; &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt; &lt;param-value&gt;bean.PushBean&lt;/param-value&gt; &lt;/init-param&gt; &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;jersey-serlvet&lt;/servlet-name&gt; &lt;url-pattern&gt;/*&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;/web-app&gt; </code></pre> <p>This is <strong>register.xhtml</strong></p> <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html"&gt; &lt;h:head&gt; &lt;title&gt;Facelet Title&lt;/title&gt; &lt;/h:head&gt; &lt;h:body&gt; &lt;h:form id="form"&gt; &lt;h:outputText id="out" value="#{pushBean.count}" styleClass="ui-widget display" /&gt; &lt;br /&gt; &lt;p:commandButton value="Click" actionListener="#{pushBean.increment}" /&gt; &lt;/h:form&gt; &lt;p:socket onMessage="handleMessage" channel="/counter" /&gt; &lt;script type="text/javascript"&gt; function handleMessage(data) { $('.display').html(data); } &lt;/script&gt; &lt;/h:body&gt; &lt;/html&gt; </code></pre> <p>This is <strong>PushBean.java</strong></p> <pre><code>package Bean; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; import org.primefaces.push.PushContext; import org.primefaces.push.PushContextFactory; @ManagedBean @SessionScoped public class PushBean implements java.io.Serializable { /** * */ private static final long serialVersionUID = 1L; public PushBean() { } private int count; public int getCount() { return count; } public void setCount(int count) { this.count = count; } public synchronized void increment() { count++; PushContext pushContext = PushContextFactory.getDefault().getPushContext(); pushContext.push("/counter", String.valueOf(count)); } } </code></pre> <p>From this <a href="http://www.mkyong.com/webservices/jax-rs/jersey-the-resourceconfig-instance-does-not-contain-any-root-resource-classes/" rel="nofollow">link</a>, it says </p> <p>Many reasons causing this “ResourceConfig” error message. Few solutions that i know :</p> <ul> <li>com.sun.jersey.config.property.packages doesn’t exist in your web.xml.</li> <li>com.sun.jersey.config.property.packages included a resource that doesn’t include any jersey services. In above case, "com.mkyong.rest” doesn’t contains any jersey services.</li> </ul> <p>So I am thinking that <strong>could it be bean.PushBean in web.xml that is wrong</strong>? <br>However, I don't know how to change it (if bean.PushBean is a problem). From eclipse project explorer, the PushBean.java path is Java Resources -> src -> Bean ->PushBean.java</p> <p>Please help me find the solution. Thanks in advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload