On 04/03/2015 18:15, Enke, Dr., Michael wrote:
> Hello all, I start a tomcat from my application and call the static
> ChatAnnotation.broadcast(String) (from examples) out of my
> application. This is possible but anyhow my application seems to
> access a "different" broadcast(String) method: If there are
> connections to the chat (private static final Set connections), my
> application sees an empty Set. How this is possible for a static
> method / Set? There should be only one static function / static
> variable in the JVM!?

That statement is incorrect.

There is only one static function / variable per class instance.

A class is uniquely identified by its name AND class loader.

Hence in a multiple class-loader environment like a Servlet container
(each webapp has its own class loader) you can have multiple classes
with the same name but different class loaders.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to