Quantcast
Channel: VMware Communities : Discussion List - vSphere Client SDK
Viewing all articles
Browse latest Browse all 2218

ClassCastException when registering plugin websocket endpoint

$
0
0

Our team is using SDK v6.7 update 3, and the following code:

    public void contextInitialized(ServletContextEvent sce) {
         final ServletContext servletContext = sce.getServletContext();
         final ServerContainer globalPassthru = (ServerContainer)servletContext.getAttribute("javax.websocket.server.ServerContainer");
         .
         .
     }    

Invariably throws a ClassCastException:

    com.vmware.o6jia.context.web.websocket.ServerContainerWrapper cannot be cast to javax.websocket.server.ServerContainer 

However, if the plugin is deployed in global scope, the code above works flawlessly. We've already attempted setting/resetting context classloader as described here:

    Thread.currentThread().setContextClassLoader(getClass().getClassLoader())

 

Does removing <code>scope="global"</code> from pluginPackage involve additional configuration?


Viewing all articles
Browse latest Browse all 2218

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>