You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flex.apache.org by "Christofer Dutz (JIRA)" <ji...@apache.org> on 2015/12/01 10:19:11 UTC

[jira] [Commented] (FLEX-34978) Shutdown errors when running Blazed DS inside of Tomcat & Java 8.

    [ https://issues.apache.org/jira/browse/FLEX-34978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15033387#comment-15033387 ] 

Christofer Dutz commented on FLEX-34978:
----------------------------------------

Unfortunately this is only one of the problems with BlazeDS' handling of resources. I am planning on giving the entire Flex Client Flex Session, Channel Subscriptions, ... management a complete overwork as in it's current state there are several bad things happening (good things not happening). BUT this will be quite an effort as the code Adobe wrote here is simply insane ;-)

> Shutdown errors when running Blazed DS inside of Tomcat & Java 8.
> -----------------------------------------------------------------
>
>                 Key: FLEX-34978
>                 URL: https://issues.apache.org/jira/browse/FLEX-34978
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: .Unspecified - Framework
>    Affects Versions: BlazeDS 4.7
>         Environment: Tomcat 7.0.58
> Java 8
>            Reporter: Douglas Yeager
>
> Inside flex.messaging.FlexSessionManager a ConcurrentHashMap member variable is declared and later the keySet() is accessed.  The ConcurrentHashMap interface has changed between Java 7 and Java 8.  So although it will work when running with Java 7; it will break if you run with Java 8.  It should be updated to declare the member as just a Map or ConcurrentMap (which is done elsewhere in the BlazeDS source); however, in the FlexSessionManager it is declared as:
>     private final ConcurrentHashMap<Class<? extends FlexSession>, AbstractFlexSessionProvider> providers = new ConcurrentHashMap<Class<? extends FlexSession>, AbstractFlexSessionProvider>();
> Then in the FlexSessionManager.stop() implementation it performs the following directly off of the ConcurrentHashMap which results in a failure:
>     /**
>      * Stops the <tt>FlexSessionManager</tt>.
>      * Any registered <tt>FlexSession</tt> providers are stopped and unregistered. 
>      */
>     @Override
>     public void stop()
>     {
>         if (!isStarted())
>             return;
>         
>         super.stop();
>         
>         for (Class<? extends FlexSession> sessionClass : providers.keySet())
>         {
>             unregisterFlexSessionProvider(sessionClass);
>         }
>         providers.clear();
>     }
> The following is the stacktrace seen in the error log on shutdown:
> 2015-11-25 13:47:01,804 [localhost-startStop-2] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/context] - Servlet MessageBrokerServlet threw unload() exception
> javax.servlet.ServletException: Servlet.destroy() for servlet MessageBrokerServlet threw exception
>     at org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:1507)
>     at org.apache.catalina.core.StandardWrapper.stopInternal(StandardWrapper.java:1847)
>     at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
>     at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5707)
>     at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
>     at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1591)
>     at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1580)
>     at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>     at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
>     at flex.messaging.FlexSessionManager.stop(FlexSessionManager.java:293)
>     at flex.messaging.MessageBroker.stop(MessageBroker.java:380)
>     at flex.messaging.MessageBrokerServlet.destroy(MessageBrokerServlet.java:263)
>     at org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:1486)
>     ... 10 more
> There are two other classes that declare ConcurrentHashMap in the code that should be cleaned up too (although keySet() is not referenced in those classes , it would be better to address them to ensure this issue doesn't re-occur):
> flex.messaging.endpoints.BaseStreamingHTTPEndpoint
> flex.messaging.MessageBroker



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)