java - Primefaces Chat Application - web.xml Invalid content was found starting with element -
this question has answer here:
i want implement pf 3.5 chat application on tomcat 7
server. have added dependencies:
<dependency> <groupid>org.atmosphere</groupid> <artifactid>atmosphere-runtime</artifactid> <version>1.0.1</version> </dependency> <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-api</artifactid> <version>1.7.1</version> </dependency> <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-simple</artifactid> <version>1.7.1</version> </dependency>
however, when implement web.xml
:
<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_2_5.xsd" version="2.5">
...
<servlet> <servlet-name>push servlet</servlet-name> <servlet-class>org.primefaces.push.pushservlet</servlet-class> <load-on-startup>1</load-on-startup> <init-param> <param-name>org.atmosphere.cpr.broadcastercacheclass</param-name> <param-value>org.atmosphere.cache.headerbroadcastercache</param-value> </init-param> <init-param> <param-name>org.atmosphere.cpr.broadcasterclass</param-name> <param-value>org.atmosphere.cpr.defaultbroadcaster</param-value> </init-param> <init-param> <param-name>org.atmosphere.cpr.broadcastfilterclasses</param-name> <param-value>org.atmosphere.client.trackmessagesizefilter</param-value> </init-param> <init-param> <param-name>org.atmosphere.cpr.sessionsupport</param-name> <param-value>true</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>push servlet</servlet-name> <url-pattern>/primepush/*</url-pattern> </servlet-mapping>
as excpetion get:
cvc-complex-type.2.4.a: invalid content found starting element 'init-param'. 1 of '{"http://java.sun.com/ xml/ns/javaee":run-as, "http://java.sun.com/xml/ns/javaee":security-role-ref}' expected.
btw exception @ <init-param>
tag.
i appreciate answer!
update
i same excpetion when write that:
<servlet> <servlet-name>push servlet</servlet-name> <servlet-class>org.primefaces.push.pushservlet</servlet-class> <load-on-startup>1</load-on-startup> <init-param> <param-name>channels</param-name> <param-value>chat,counter</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>push servlet</servlet-name> <url-pattern>/prime-push/*</url-pattern> </servlet-mapping>
i expcetion @ <init-param>
tag
according schema order matters. <load-on-startup/>
element should come after <init-param/>
element.
eg.
<servlet> <servlet-name>push servlet</servlet-name> <servlet-class>org.primefaces.push.pushservlet</servlet-class> <init-param> <param-name>channels</param-name> <param-value>chat,counter</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>