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

Mark Struberg edited comment on OWB-1175 at 4/11/17 8:52 PM:
-------------------------------------------------------------

Looks like it's even more complicated. 
As far as I can tell after debugging through it seems that neither the Context 
Listener nor the Servlet Filter gets invoked for a forward on the target 
application :(

That means that adding that Filter for having cross-context forwards won't help 
much I fear.
I'll investigate if we have another portable solution.

*edit* had the dispatcher in the wrong web.xml. Seems to work now


was (Author: struberg):
Looks like it's even more complicated. 
As far as I can tell after debugging through it seems that neither the Context 
Listener nor the Servlet Filter gets invoked for a forward on the target 
application :(

That means that adding that Filter for having cross-context forwards won't help 
much I fear.
I'll investigate if we have another portable solution.

> Duplicate registration of ServletContextBean
> --------------------------------------------
>
>                 Key: OWB-1175
>                 URL: https://issues.apache.org/jira/browse/OWB-1175
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Web
>    Affects Versions: 1.7.2
>            Reporter: Benjamin Mueller
>            Assignee: Mark Struberg
>         Attachments: test.zip
>
>
> After updating to 1.7.2 (from 1.6.3) my application on Tomcat 8 stopped 
> working.
> It configures both the WebBeansConfigurationListener and 
> WebBeansConfigurationFilter in web.xml
> {code:xml}
> <listener>
>       
> <listener-class>org.apache.webbeans.servlet.WebBeansConfigurationListener</listener-class>
> </listener>
> <filter>
>       <filter-name>WebBeansConfigurationFilter</filter-name>
>       
> <filter-class>org.apache.webbeans.servlet.WebBeansConfigurationFilter</filter-class>
> </filter>
> <filter-mapping>
>       <filter-name>WebBeansConfigurationFilter</filter-name>
>       <url-pattern>/*</url-pattern>
>       <dispatcher>FORWARD</dispatcher>
> </filter-mapping>
> {code}
> I need this setup to handle requests being forwarded by a different webapp 
> (with cross-context).
> When starting, Open-Webbeans fails now with:
> {noformat}
> SCHWERWIEGEND: Exception starting filter WebBeansConfigurationFilter
> org.apache.webbeans.exception.DuplicateDefinitionException: 
> PassivationCapable bean id is not unique: SERVLET_CONTEXT#interface 
> javax.servlet.ServletContext#@javax.enterprise.inject.Default(),@javax.enterprise.inject.Any(),
>  bean:ServletContext, WebBeansType:SERVLET_CONTEXT, Name:null, API 
> Types:[java.lang.Object,javax.servlet.ServletContext], 
> Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]
>       at 
> org.apache.webbeans.container.BeanManagerImpl.addPassivationInfo(BeanManagerImpl.java:411)
>       at 
> org.apache.webbeans.container.BeanManagerImpl.addInternalBean(BeanManagerImpl.java:365)
>       at 
> org.apache.webbeans.web.lifecycle.WebContainerLifecycle.startApplication(WebContainerLifecycle.java:90)
>       at 
> org.apache.webbeans.servlet.WebBeansConfigurationFilter.init(WebBeansConfigurationFilter.java:90)
> {noformat}
> This is probably due to WebContainerLifecycle#startApplication, which does 
> not first check if it is already started before it adds the 
> ServletContextBean (again) in contrast to AbstractLifecycle#startApplication 
> (bootstrapApplication).



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to