You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Vicente Rossello <co...@gmail.com> on 2026/02/20 14:40:13 UTC

Possible bug in myfaces/openwebbeans

Hi,

I'm trying to migrate a big tomee app from 8.x to 10.1

I think I found a bug, I don't know if the bug belongs to openwebbeans,
myfaces or tomee integration layer.

The reproducer is very simple:

<!DOCTYPE html>
<html lang="en"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="jakarta.faces.core"
      xmlns:h="jakarta.faces.html"
      xmlns:c="jakarta.tags.core">
<f:view>
    <h:body>
        <c:set var="example" value="example" scope="request"/>
        dsadsa
        #{param['someparam']}
        hello!!! #{example} adssda
    </h:body>
</f:view>
</html>


Running this with tomee plus 10.1.4 throws an error:

	Caused by: java.lang.LinkageError: loader
org.apache.tomee.catalina.TomEEWebappClassLoader @7d22f4f9 attempted
duplicate class definition for
org.apache.webbeans.custom.Map$$OwbNormalScopeProxy14900025290.
(org.apache.webbeans.custom.Map$$OwbNormalScopeProxy14900025290 is in
unnamed module of loader
org.apache.tomee.catalina.TomEEWebappClassLoader @7d22f4f9, parent
loader java.net.URLClassLoader @1176dcec)
		at java.base/java.lang.ClassLoader.defineClass1(Native Method)
		at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:962)


The thing is that the same proxy class name is created for
#{param['someparam']} and for example bean (note that it has the
scope="request" property). I don't really know how to look further.

A full reproducer is in https://github.com/cocorossello/tomee-sample

Do you have an idea?


Best regards,

Vicente

Re: Possible bug in myfaces/openwebbeans

Posted by Vicente Rossello <co...@gmail.com>.
Now I see that the problem may be in:

protected String getUnusedProxyClassName(ClassLoader classLoader,
String proxyClassName)

That in fact gets the classloader from

public ClassLoader getProxyClassLoader(final Class<?> forClass) {
    final ClassLoader classLoader = forClass.getClassLoader();
    if (classLoader == null) {
        return Thread.currentThread().getContextClassLoader();
    }
    return classLoader;
}


Here I can see that if forClass is FacesArtifactProducer, classloader
is an URLClassLoader, not Tomee's classloader, that's why openwebbeans
thinks that the class does not exist. I think this is because how this
FacesArtifactProducer has been defined.


On Fri, Feb 20, 2026 at 3:40 PM Vicente Rossello <co...@gmail.com>
wrote:

> Hi,
>
> I'm trying to migrate a big tomee app from 8.x to 10.1
>
> I think I found a bug, I don't know if the bug belongs to openwebbeans,
> myfaces or tomee integration layer.
>
> The reproducer is very simple:
>
> <!DOCTYPE html>
> <html lang="en"
>       xmlns="http://www.w3.org/1999/xhtml"
>       xmlns:f="jakarta.faces.core"
>       xmlns:h="jakarta.faces.html"
>       xmlns:c="jakarta.tags.core">
> <f:view>
>     <h:body>
>         <c:set var="example" value="example" scope="request"/>
>         dsadsa
>         #{param['someparam']}
>         hello!!! #{example} adssda
>     </h:body>
> </f:view>
> </html>
>
>
> Running this with tomee plus 10.1.4 throws an error:
>
> 	Caused by: java.lang.LinkageError: loader org.apache.tomee.catalina.TomEEWebappClassLoader @7d22f4f9 attempted duplicate class definition for org.apache.webbeans.custom.Map$$OwbNormalScopeProxy14900025290. (org.apache.webbeans.custom.Map$$OwbNormalScopeProxy14900025290 is in unnamed module of loader org.apache.tomee.catalina.TomEEWebappClassLoader @7d22f4f9, parent loader java.net.URLClassLoader @1176dcec)
> 		at java.base/java.lang.ClassLoader.defineClass1(Native Method)
> 		at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:962)
>
>
> The thing is that the same proxy class name is created for #{param['someparam']} and for example bean (note that it has the scope="request" property). I don't really know how to look further.
>
> A full reproducer is in https://github.com/cocorossello/tomee-sample
>
> Do you have an idea?
>
>
> Best regards,
>
> Vicente
>
>