You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kp...@apache.org on 2013/10/13 14:30:56 UTC

svn commit: r1531680 - /tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml

Author: kpreisser
Date: Sun Oct 13 12:30:56 2013
New Revision: 1531680

URL: http://svn.apache.org/r1531680
Log:
Allow the JSR 356 WebSocket examples using the programmatic API (Endpoint subclasses) to work as they use a ServletContextListener that has @WebListener annotation, which would not be called with metadata-complete="true".

Modified:
    tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml

Modified: tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml?rev=1531680&r1=1531679&r2=1531680&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml Sun Oct 13 12:30:56 2013
@@ -20,7 +20,7 @@
   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                       http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
   version="3.0"
-  metadata-complete="true">
+  metadata-complete="false">
 
     <description>
       Servlet and JSP Examples.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


RE: svn commit: r1531680 - /tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml

Posted by Konstantin Preißer <kp...@apache.org>.

> -----Original Message-----
> From: Konstantin Preißer [mailto:kpreisser@apache.org]
> Sent: Sunday, October 13, 2013 5:27 PM
> To: 'Tomcat Developers List'
> Subject: RE: svn commit: r1531680 -
> /tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml
> 
> Mark,
> 
> The reason I changed the metadata-complete to "false" is that otherwise
> with Tomcat 7, the "EchoEndpoint" and "DrawboardEndpoint" would not be
> deployed so these examples would not work. In Tomcat 8 the examples
> Webapp has metadata-complete="false" so I thought it would be as simple
> to make the same change in Tomcat7's example web.xml.
> I guess when setting metadata-complete="true", one would have to add the
> two WsConfigListeners to the web.xml, but I guess that would not fix the
> failures.
> 
> > Implementing a ServerEndpointConfig and letting the SCI deploy it would
> > be an alternative option.
> 
> I'm sorry as I do not have enough knowledge of the various servlet specs to
> fix this correctly - are you able to do it?

I see now that the examples webapp will fail to start if runnint Tomcat 7 with Java6 and having metadata-complete="false" in the example's web.xml.
Is it OK to add a null check in the example WsConfigListeners to prevent the errors when websocket is not available?


Thanks,
Konstantin Preißer


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


RE: svn commit: r1531680 - /tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml

Posted by Konstantin Preißer <kp...@apache.org>.
Mark,

> -----Original Message-----
> From: Mark Thomas [mailto:markt@apache.org]
> Sent: Sunday, October 13, 2013 5:17 PM
> To: Tomcat Developers List
> Subject: Re: svn commit: r1531680 -
> /tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml

> > OK, can you give me a hint why buildbot fails?
> 
> The SCI doesn't run when using the Tomcat class which is used by the
> unit tests. The unit tests that need WebSocket support explicitly enable it.
> 
> Annotations are processed so changing metadata-complete means the
> listener is fired in a number of places where WebSocket is not available.
> 
> The examples should not require metadata-complete="false"

OK, thank you.
 
The reason I changed the metadata-complete to "false" is that otherwise with Tomcat 7, the "EchoEndpoint" and "DrawboardEndpoint" would not be deployed so these examples would not work. In Tomcat 8 the examples Webapp has metadata-complete="false" so I thought it would be as simple to make the same change in Tomcat7's example web.xml.
I guess when setting metadata-complete="true", one would have to add the two WsConfigListeners to the web.xml, but I guess that would not fix the failures.

> Implementing a ServerEndpointConfig and letting the SCI deploy it would
> be an alternative option.

I'm sorry as I do not have enough knowledge of the various servlet specs to fix this correctly - are you able to do it?

Thanks!


Regards,
Konstantin Preißer


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r1531680 - /tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml

Posted by Mark Thomas <ma...@apache.org>.
On 13/10/2013 15:33, Konstantin Preißer wrote:
> Mark,
> 
>> -----Original Message-----
>> From: Mark Thomas [mailto:markt@apache.org]
>> Sent: Sunday, October 13, 2013 3:58 PM
>> To: Tomcat Developers List
>> Subject: Re: svn commit: r1531680 -
>> /tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml
>>
>> On 13/10/2013 13:30, kpreisser@apache.org wrote:
>>> Author: kpreisser
>>> Date: Sun Oct 13 12:30:56 2013
>>> New Revision: 1531680
>>>
>>> URL: http://svn.apache.org/r1531680
>>> Log:
>>> Allow the JSR 356 WebSocket examples using the programmatic API
>> (Endpoint subclasses) to work as they use a ServletContextListener that has
>> @WebListener annotation, which would not be called with metadata-
>> complete="true".
>>
>> That appears to have triggered a number of CI failures.
> 
> OK, can you give me a hint why buildbot fails?

The SCI doesn't run when using the Tomcat class which is used by the
unit tests. The unit tests that need WebSocket support explicitly enable it.

Annotations are processed so changing metadata-complete means the
listener is fired in a number of places where WebSocket is not available.

The examples should not require metadata-complete="false"

Mark

> 
> When I look at the stdio logs for compile_1 [1], I can see NPEs in the examples-WsConfigListener that did not happen previously (but they happen also in trunk). I do also get these NPEs when I debug Tomcat in Eclipse as it seems the Servlet Context did not have the "javax.websocket.server.ServerContainer" attribute. I solved this by adding
>     new WsContextListener().contextInitialized(sce);
> at the beginning of contextInitialized() method in the WsConfigListener.
> 
> But I don't know if the failures have something to do with it.
> (When I build Tomcat7 locally with WebSocket support and run it, then I do not get such exceptions.)
> 
> 
> Regards,
> Konstantin Preißer
> 
> [1] http://ci.apache.org/builders/tomcat-7-trunk/builds/1469/steps/compile_1/logs/stdio
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


RE: svn commit: r1531680 - /tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml

Posted by Konstantin Preißer <kp...@apache.org>.
> -----Original Message-----
> From: Konstantin Preißer [mailto:kpreisser@apache.org]
> Sent: Sunday, October 13, 2013 4:34 PM
> To: 'Tomcat Developers List'
> Subject: RE: svn commit: r1531680 -
> /tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml
> 
> "javax.websocket.server.ServerContainer" attribute. I solved this by adding
>     new WsContextListener().contextInitialized(sce);
> at the beginning of contextInitialized() method in the WsConfigListener.

Sorry, that should read:
I solved this by adding
    new org.apache.tomcat.websocket.server.WsContextListener.contextInitialized(sce);
at the beginning of contextInitialized() method in the Examples WsConfigListeners.


Regards,
Konstantin Preißer


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


RE: svn commit: r1531680 - /tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml

Posted by Konstantin Preißer <kp...@apache.org>.
Mark,

> -----Original Message-----
> From: Mark Thomas [mailto:markt@apache.org]
> Sent: Sunday, October 13, 2013 3:58 PM
> To: Tomcat Developers List
> Subject: Re: svn commit: r1531680 -
> /tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml
> 
> On 13/10/2013 13:30, kpreisser@apache.org wrote:
> > Author: kpreisser
> > Date: Sun Oct 13 12:30:56 2013
> > New Revision: 1531680
> >
> > URL: http://svn.apache.org/r1531680
> > Log:
> > Allow the JSR 356 WebSocket examples using the programmatic API
> (Endpoint subclasses) to work as they use a ServletContextListener that has
> @WebListener annotation, which would not be called with metadata-
> complete="true".
> 
> That appears to have triggered a number of CI failures.

OK, can you give me a hint why buildbot fails?

When I look at the stdio logs for compile_1 [1], I can see NPEs in the examples-WsConfigListener that did not happen previously (but they happen also in trunk). I do also get these NPEs when I debug Tomcat in Eclipse as it seems the Servlet Context did not have the "javax.websocket.server.ServerContainer" attribute. I solved this by adding
    new WsContextListener().contextInitialized(sce);
at the beginning of contextInitialized() method in the WsConfigListener.

But I don't know if the failures have something to do with it.
(When I build Tomcat7 locally with WebSocket support and run it, then I do not get such exceptions.)


Regards,
Konstantin Preißer

[1] http://ci.apache.org/builders/tomcat-7-trunk/builds/1469/steps/compile_1/logs/stdio



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r1531680 - /tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml

Posted by Mark Thomas <ma...@apache.org>.
On 13/10/2013 13:30, kpreisser@apache.org wrote:
> Author: kpreisser
> Date: Sun Oct 13 12:30:56 2013
> New Revision: 1531680
> 
> URL: http://svn.apache.org/r1531680
> Log:
> Allow the JSR 356 WebSocket examples using the programmatic API (Endpoint subclasses) to work as they use a ServletContextListener that has @WebListener annotation, which would not be called with metadata-complete="true".

That appears to have triggered a number of CI failures.

Implementing a ServerEndpointConfig and letting the SCI deploy it would
be an alternative option.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org