[
https://issues.apache.org/jira/browse/OWB-1175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15965728#comment-15965728
]
Mark Struberg commented on OWB-1175:
------------------------------------
[~bmueller] would this solution be enough for you?
It is of course not perfect as it requires manually setting the startOwb
initparam to false (to make the Filter NOT try to start OWB, default is true).
But I think cross-context forwards are really an exceptional usecase as it is
by default forbidden on almost every server due to security constraints.
> 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)