Re: Possible bug in myfaces/openwebbeans

Vicente Rossello <[email protected]> Fri, 20 Feb 2026 15:56:30 +0100
Newsgroups gmane.comp.java.openejb.devel
Message-ID <CAGKhu1_fX2bbw7Z54vt73A+AcwhRNYZv0eoK6FpMxhFUNyFw8g@mail.gmail.com>
--00000000000015aa5f064b42a1a0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

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 =3D forClass.getClassLoader();
    if (classLoader =3D=3D 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=E2=80=AFPM Vicente Rossello <cocorossello@gmai=
l.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=3D"en"
>       xmlns=3D"http://www.w3.org/1999/xhtml"
>       xmlns:f=3D"jakarta.faces.core"
>       xmlns:h=3D"jakarta.faces.html"
>       xmlns:c=3D"jakarta.tags.core">
> <f:view>
>     <h:body>
>         <c:set var=3D"example" value=3D"example" scope=3D"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.TomE=
EWebappClassLoader @7d22f4f9 attempted duplicate class definition for org.a=
pache.webbeans.custom.Map$$OwbNormalScopeProxy14900025290. (org.apache.webb=
eans.custom.Map$$OwbNormalScopeProxy14900025290 is in unnamed module of loa=
der org.apache.tomee.catalina.TomEEWebappClassLoader @7d22f4f9, parent load=
er 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['somep=
aram']} and for example bean (note that it has the scope=3D"request" proper=
ty). 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
>
>

--00000000000015aa5f064b42a1a0--