[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Hey,
I'm adding this here for Nabble in case someone runs into the same problem I did, they can search for it: something that kinda took me off guard when trying to setup Oort: for the init-param oort.url I used
http://localhost:8080/cometd and had this running on two separate machines. The two would handshake but never exchange messages. After fiddling with the web.xml for a while I figured out that the oort.url should specifically refer to the machine the servlet is running off of by a name other than localhost - So if the IP address of one machine is 192.168.1.2, your best bet is using the oort.url
http://192.168.1.2:8080/cometd (assuming port 8080 and that your cometd servlet is mapped to /cometd), and if the other machine is 192.168.1.3 its oort.url should be
http://192.168.1.3:8080/cometd. In fact, here are my two web.xmls. The first is from a machine I call molecule and the second is from a machine I call atom (their IP addresses are configured in my hosts file):
molecule: web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="
http://java.sun.com/xml/ns/javaee"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
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>cometd</servlet-name>
<servlet-class>org.mortbay.cometd.continuation.ContinuationCometdServlet</servlet-class>
<init-param>
<param-name>timeout</param-name>
<param-value>60000</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>oortServlet</servlet-name>
<servlet-class>org.cometd.oort.OortServlet</servlet-class>
<init-param>
<param-name>oort.url</param-name>
<param-value>
http://molecule:8080/cometd</param-value>
</init-param>
<init-param>
<param-name>oort.cloud</param-name>
<param-value>
http://atom:8080/cometd</param-value>
</init-param>
<init-param>
<param-name>oort.channels</param-name>
<param-value>/chat/**</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>cometd</servlet-name>
<url-pattern>/cometd/*</url-pattern>
</servlet-mapping>
</web-app>
atom: web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="
http://java.sun.com/xml/ns/javaee"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
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>cometd</servlet-name>
<servlet-class>org.mortbay.cometd.continuation.ContinuationCometdServlet</servlet-class>
<init-param>
<param-name>timeout</param-name>
<param-value>60000</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>oortServlet</servlet-name>
<servlet-class>org.cometd.oort.OortServlet</servlet-class>
<init-param>
<param-name>oort.url</param-name>
<param-value>
http://atom:8080/cometd</param-value>
</init-param>
<init-param>
<param-name>oort.cloud</param-name>
<param-value>
http://molecule:8080/cometd</param-value>
</init-param>
<init-param>
<param-name>oort.channels</param-name>
<param-value>/chat/**</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>cometd</servlet-name>
<url-pattern>/cometd/*</url-pattern>
</servlet-mapping>
</web-app>