[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails when container bootstrapped outside
Title: Message Title Martin Kouba updated WELD-2223 Weld / WELD-2223 Registering servlet listener on tomcat embedded fails when container bootstrapped outside Change By: Martin Kouba Status: Pull Request Sent Resolved Resolution: Done Add Comment This message was sent by Atlassian JIRA (v7.2.3#72005-sha1:73be91d) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails when container bootstrapped outside
Title: Message Title Martin Kouba updated an issue Weld / WELD-2223 Registering servlet listener on tomcat embedded fails when container bootstrapped outside Change By: Martin Kouba Git Pull Request: https://github.com/weld/core/pull/1623 , https://github.com/weld/core/pull/1624 Add Comment This message was sent by Atlassian JIRA (v7.2.3#72005-sha1:73be91d) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails when container bootstrapped outside
Title: Message Title Issue was automatically transitioned when Martin Kouba created pull request #1623 in GitHub Weld / WELD-2223 Registering servlet listener on tomcat embedded fails when container bootstrapped outside Change By: Martin Kouba Status: Reopened Pull Request Sent Add Comment This message was sent by Atlassian JIRA (v7.2.3#72005-sha1:73be91d) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails when container bootstrapped outside
Title: Message Title Martin Kouba updated WELD-2223 Weld / WELD-2223 Registering servlet listener on tomcat embedded fails when container bootstrapped outside Change By: Martin Kouba Status: Pull Request Sent Git Pull Request: https://github.com/weld/core/pull/1623 Add Comment This message was sent by Atlassian JIRA (v7.2.3#72005-sha1:73be91d) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails when container bootstrapped outside
Title: Message Title Martin Kouba commented on WELD-2223 Re: Registering servlet listener on tomcat embedded fails when container bootstrapped outside John Ament Good to know. Actually, I started to write a test for this and realized that the events are not fired since 2.3.3.Final (fixed in WELD-2077) but the synchronized block is still executed (hence the issue). Add Comment This message was sent by Atlassian JIRA (v7.2.3#72005-sha1:73be91d) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails when container bootstrapped outside
Title: Message Title John Ament commented on WELD-2223 Re: Registering servlet listener on tomcat embedded fails when container bootstrapped outside BTW, Tomcat has fixed their upstream issue with this. Starting with 9.0.0.M18, they have the ability to make this single threaded with fixes it as well. Add Comment This message was sent by Atlassian JIRA (v7.2.3#72005-sha1:73be91d) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails when container bootstrapped outside
Title: Message Title Martin Kouba updated an issue Weld / WELD-2223 Registering servlet listener on tomcat embedded fails when container bootstrapped outside Change By: Martin Kouba Fix Version/s: 2.4.3.Final Fix Version/s: 3.0.0.Final Add Comment This message was sent by Atlassian JIRA (v7.2.3#72005-sha1:73be91d) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails when container bootstrapped outside
Title: Message Title Martin Kouba commented on WELD-2223 Re: Registering servlet listener on tomcat embedded fails when container bootstrapped outside It seems to me, in this situation, the initialized event should not be fired from HttpContextLifecycle... I tend to agree. So the only @Initialized(ApplicationScoped.class) event would be fired from Weld SE bootstrap (org.jboss.weld.environment.se.events.ContainerInitialized as a payload). Add Comment This message was sent by Atlassian JIRA (v7.2.3#72005-sha1:73be91d) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails when container bootstrapped outside
Title: Message Title Martin Kouba updated an issue Weld / WELD-2223 Registering servlet listener on tomcat embedded fails when container bootstrapped outside Change By: Martin Kouba Component/s: Java SE Support Add Comment This message was sent by Atlassian JIRA (v7.2.3#72005-sha1:73be91d) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails when container bootstrapped outside
Title: Message Title Martin Kouba commented on WELD-2223 Re: Registering servlet listener on tomcat embedded fails when container bootstrapped outside Ok, so I think I understand the issue better. What's really happening is a dead lock between the two threads, simply because they're both locking on the same object. The second thread is derived from the first, so the lock never gets cleared. Yes, Tomcat is started from within AfterDeploymentValidation notification when the lock is already held. Thoughts? Hm yes, we would have either to delay @Initialized(ApplicationScoped.class) or change the lock object. Add Comment This message was sent by Atlassian JIRA (v7.2.3#72005-sha1:73be91d) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails when container bootstrapped outside
Title: Message Title John Ament commented on WELD-2223 Re: Registering servlet listener on tomcat embedded fails when container bootstrapped outside Ok, so I think I understand the issue better. What's really happening is a dead lock between the two threads, simply because they're both locking on the same object. The second thread is derived from the first, so the lock never gets cleared. It seems to me, in this situation, the initialized event should not be fired from HttpContextLifecycle (it is fired in all 3 containers) since the container isn't bootstrapped from Weld Servlet. I hate to say it, but adding another boolean to the constructor for lifecycle may make the most sense. Thoughts? Add Comment This message was sent by Atlassian JIRA (v7.2.3#72005-sha1:73be91d) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails when container bootstrapped outside
Title: Message Title John Ament commented on WELD-2223 Re: Registering servlet listener on tomcat embedded fails when container bootstrapped outside But that's not the case here. The first event being fired is `AfterDeploymentValidation` but then in tomcat you're firing `@Initialized(ApplicationScoped.class)` - however I suspect that shouldn't get fired. I don't believe it's fired for undertow, jetty, haven't quite figured out why its fired for Tomcat. Add Comment This message was sent by Atlassian JIRA (v7.2.3#72005-sha1:73be91d) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails when container bootstrapped outside
Title: Message Title Martin Kouba commented on WELD-2223 Re: Registering servlet listener on tomcat embedded fails when container bootstrapped outside Yep, we use the container instance as a lock to ensure all the container lifecycle observer methods are called sequentially and also to ensure @Initialized(ApplicationScoped.class) are called sequentially. Add Comment This message was sent by Atlassian JIRA (v7.2.3#72005-sha1:73be91d) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails when container bootstrapped outside
Title: Message Title John Ament updated an issue Weld / WELD-2223 Registering servlet listener on tomcat embedded fails when container bootstrapped outside Change By: John Ament Summary: Registering servlet listener on tomcat embedded fails when container bootstrapped outside Add Comment This message was sent by Atlassian JIRA (v7.2.3#72005-sha1:73be91d) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails when container bootstrapped outside
Title: Message Title John Ament edited a comment on WELD-2223 Re: Registering servlet listener on tomcat embedded fails when container bootstrapped outside i was able to dig into this a bit deeper w/ some tomcat guysWhat I'm seeing is that during the execution of tomcat bootstrap during ` {{ AfterDeploymentValidation ` }} this synchronized block causes a deadlock on the calling threadhttps://github.com/weld/core/blob/2.4/impl/src/main/java/org/jboss/weld/servlet/HttpContextLifecycle.java#L140I'm going to try to dig in further to take a thread dump. Add Comment This message was sent by Atlassian JIRA (v7.2.3#72005-sha1:73be91d) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails
Title: Message Title John Ament commented on WELD-2223 Re: Registering servlet listener on tomcat embedded fails Here's output from main thread: Name: main State: WAITING on java.util.concurrent.FutureTask@70a09034 Total blocked: 0 Total waited: 45 Stack trace: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) java.util.concurrent.FutureTask.awaitDone(FutureTask.java:429) java.util.concurrent.FutureTask.get(FutureTask.java:191) org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:939) - locked org.apache.catalina.core.StandardEngine@120b1811 org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) - locked org.apache.catalina.core.StandardEngine@120b1811
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails
Title: Message Title John Ament updated an issue Weld / WELD-2223 Registering servlet listener on tomcat embedded fails Change By: John Ament Affects Version/s: 2.4.0.Final Affects Version/s: 2.3.5.Final Add Comment This message was sent by Atlassian JIRA (v7.2.3#72005-sha1:73be91d) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails
Title: Message Title John Ament updated an issue Weld / WELD-2223 Registering servlet listener on tomcat embedded fails Change By: John Ament Priority: Major Minor Add Comment This message was sent by Atlassian JIRA (v7.2.3#72005-sha1:73be91d) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails
Title: Message Title John Ament updated an issue Weld / WELD-2223 Registering servlet listener on tomcat embedded fails Change By: John Ament Component/s: Servlet Container Support Add Comment This message was sent by Atlassian JIRA (v7.2.3#72005-sha1:73be91d) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails
Title: Message Title John Ament reopened an issue i was able to dig into this a bit deeper w/ some tomcat guys What I'm seeing is that during the execution of tomcat bootstrap during `AfterDeploymentValidation` this synchronized block causes a deadlock on the calling thread https://github.com/weld/core/blob/2.4/impl/src/main/java/org/jboss/weld/servlet/HttpContextLifecycle.java#L140 I'm going to try to dig in further to take a thread dump. Weld / WELD-2223 Registering servlet listener on tomcat embedded fails Change By: John Ament Resolution: Rejected Status: Resolved Reopened Add Comment This message was sent by Atlassian JIRA (v7.2.3#72005-sha1:73be91d)
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails
Title: Message Title Martin Kouba resolved as Rejected Weld / WELD-2223 Registering servlet listener on tomcat embedded fails Change By: Martin Kouba Status: Reopened Resolved Resolution: Rejected Add Comment This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails
Title: Message Title Martin Kouba commented on WELD-2223 Re: Registering servlet listener on tomcat embedded fails John Ament Should I close the issue or do you have any new info? Add Comment This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails
Title: Message Title Martin Kouba commented on WELD-2223 Re: Registering servlet listener on tomcat embedded fails For the record, we've just found out that arquillian-container-weld is using org.jboss.weld.servlet.StaticWeldProvider - see also ARQ-2041. Add Comment This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails
Title: Message Title Martin Kouba commented on WELD-2223 Re: Registering servlet listener on tomcat embedded fails FYI I've just tried to debug the TomcatWebServerTest and the set of discovered CDIProviders only contained org.jboss.weld.environment.WeldProvider and org.jboss.weld.environment.se.WeldSEProvider and both worked fine (alhough the test assertion failed). Add Comment This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails
Title: Message Title Martin Kouba commented on WELD-2223 Re: Registering servlet listener on tomcat embedded fails Actually, there would be still a collision between CDIProvider from Weld SE (org.jboss.weld.environment.se.WeldSEProvider) and the one from Weld Servlet. WeldSEProvider should work fine for your use case. Hm, I'm just looking at CDI.current() and it takes the first provider which can access the container. Add Comment This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails
Title: Message Title Martin Kouba commented on WELD-2223 Re: Registering servlet listener on tomcat embedded fails Hi John, what version of Weld do you actually use? In the log I can see org.jboss.weld.servlet.StaticWeldProvider which is not used for ages and was even removed in master and 2.4 branches ( WELD-2199 ). The org.jboss.weld.environment.WeldProvider should be used instead, see also https://github.com/weld/core/blob/master/environments/servlet/core/src/main/resources/META-INF/services/javax.enterprise.inject.spi.CDIProvider. Add Comment This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails
Title: Message Title Martin Kouba reopened an issue Weld / WELD-2223 Registering servlet listener on tomcat embedded fails Change By: Martin Kouba Resolution: Rejected Status: Resolved Reopened Assignee: Martin Kouba Add Comment This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails
Title: Message Title John Ament commented on WELD-2223 Re: Registering servlet listener on tomcat embedded fails Even after setting the bean manager attribute com.google.common.util.concurrent.UncheckedExecutionException: org.jboss.weld.exceptions.IllegalStateException: WELD-001328: Unable to identify the correct BeanManager. The calling class org.jboss.weld.servlet.WeldInitialListener is not placed in bean archive at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2203) at com.google.common.cache.LocalCache.get(LocalCache.java:3937) at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941) at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824) at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4830) at org.jboss.weld.SimpleCDI.getBeanManager(SimpleCDI.java:105) at org.jboss.weld.SimpleCDI.getBeanManager(SimpleCDI.java:38) at org.jboss.weld.servlet.WeldInitialListener.contextInitialized(WeldInitialListener.java:94)
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails
Title: Message Title Martin Kouba commented on WELD-2223 Re: Registering servlet listener on tomcat embedded fails Well, you can pass Weld, WeldContainer or BeanManager. And yes, the info was added into 2.4.0.CR1 and 3.0.0.Beta1 - see also WELD-2192 . The page you're referencing is the latest stable version of Weld (2.3.5.Final atm). That's why I added the explicit link to 2.4.0.CR1 docs. Add Comment This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails
Title: Message Title John Ament commented on WELD-2223 Re: Registering servlet listener on tomcat embedded fails I just double checked, after getting it working. This page has no information about setting the weld container. Add Comment This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails
Title: Message Title John Ament commented on WELD-2223 Re: Registering servlet listener on tomcat embedded fails Hi, thanks for rejecting my issue. The item you're proposing assumes I have access to the underlying weld container, which I don't in the case I'm using StartMain to launch my app. Likewise if I'm using arquillian to bootstrap, still don't have WeldContainer. Add Comment This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails
Title: Message Title John Ament commented on WELD-2223 Re: Registering servlet listener on tomcat embedded fails A reproducible test case: https://github.com/hammock-project/hammock/blob/tomcat-issues/web-tomcat/src/test/java/ws/ament/hammock/web/tomcat/TomcatWebServerTest.java#L37 Add Comment This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2223) Registering servlet listener on tomcat embedded fails
Title: Message Title John Ament created an issue Weld / WELD-2223 Registering servlet listener on tomcat embedded fails Issue Type: Bug Assignee: Unassigned Created: 20/Aug/16 10:03 AM Priority: Major Reporter: John Ament Presume I have this test: @Test public void shouldStartTomcat() throws Exception { try(WeldContainer weldContainer = new Weld().disableDiscovery() .beanClasses(DefaultServlet.class).initialize()) {