Polina Georgieva created TOMEE-2503:

             Summary: Implementation classes of 
javax.websocket.server.ServerApplicationConfig are not found due to enabled 
metadata-complete flag
                 Key: TOMEE-2503
                 URL: https://issues.apache.org/jira/browse/TOMEE-2503
             Project: TomEE
          Issue Type: Bug
            Reporter: Polina Georgieva
         Attachments: examples.zip


When the web deployment descriptor's flag metadata-complete is enabled, any 
implementation classes of javax.websocket.server.ServerApplicationConfig are 
not found and hence the programmatic websocket endpoint registration is not 


*Steps to reproduce*:

Use the example application (standard examples application distributed with 
Tomcat v.8.5.34):


Then check the "programmatic API" option and click on "Connect" button.

The following error is received: Info: WebSocket connection closed, Code: 1006 
is returned.


*I think the following code is responsible for this (based on Tomee sources 
 * In org.apache.openejb.config.DeploymentLoader. addWebModule(final WebModule 
webModule, final AppModule appModule) method (line 872)

the following check is made

   *if* (_isMetadataComplete_(webModule, webEjbModule)) {

                    *final* IAnnotationFinder finder = *new* 
org.apache.xbean.finder.AnnotationFinder(*new* ClassesArchive());  -> [case 1]



                } *else* {

                    *final* IAnnotationFinder finder = 
FinderFactory._createFinder_(webModule);  -> [case 2]




Case 1  (metadata-complete=true): org.apache.xbean.finder.AnnotationFinder 
instance is set to the web application - with empty classInfos map.

Case 2  (metadata-complete= false): 
 instance with non empty classInfos (containing ServerApplicationConfig)
 *  Later in 
 method (line 543):

Case 1  (metadata-complete=true): finder cannot find any implementation classes 
and the org.apache.tomcat.websocket.server.WsSci intiatilizer has nothing to 

Case 2  (metadata-complete= false): correct implementation class found and 
mapped to the WsSci intiatilizer => everything works as expected


In my opinion the metadata-complete flag should not affect the finding of 
implementation classes and they should always be available regardless of the 
flag's value.

Note that the reported problems applies for other standard Java EE interfaces 
(for example: interface javax.faces.event.PhaseListener, interface 
javax.faces.convert.Converter, interface javax.faces.validator.Validator etc.) 
so I expect other scenarios to be broken as well.

Best Regards,



This message was sent by Atlassian JIRA

Reply via email to