This content has been marked as final.
Show 2 replies
-
1. Re: WELD-ENV-002000: Weld SE container STATIC_INSTANCE is already running!
mkouba Aug 17, 2016 9:03 AM (in response to brucespringfield)1 of 1 people found this helpfulHi Bruce,
this means you are running multiple Weld instances of the same ID (default one) at the same time (and not isolated by ClassLoader). You will get this error if you run e.g.:
public static void main(String[] args) { Weld weld1 = new Weld().initialize(); Weld weld2 = new Weld().initialize(); // WELD-ENV-002000 and IllegalStateException is thrown }
You should either shut down the
weld1
container first or, if you really need to run multiple containers in parallel, specify a unique container ID viaorg.jboss.weld.environment.se.Weld.containerId(String)
:public static void main(String[] args) { Weld weld1 = new Weld().containerId("alpha").initialize(); Weld weld2 = new Weld().containerId("bravo").initialize(); weld1.shutdown(); weld2.shutdown(); }
It's also possible to inspect all running containers - see also
org.jboss.weld.environment.se.WeldContainer.getRunningContainerIds()
. -
2. Re: WELD-ENV-002000: Weld SE container STATIC_INSTANCE is already running!
brucespringfield Aug 17, 2016 10:37 AM (in response to mkouba)Okay, I see. Thanks for the help!