Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-3933

java.lang.LinkageError on @ViewMap injection

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 8.0.10, 8.0.11
    • None
    • TomEE Build
    • None
    • Windows 10, TomEE 8.0.11, JDK 17

    Description

      I suffer from a LinkageError when loading JSF backing beans that utilize the @ViewMap injection. When referencing the Enroll bean (see below)  from JSF I get:

      javax.el.ELException: Fehler beim Lesen von [createNewSession] für den Typ [xrn.portal.ui.Enroll$$OwbNormalScopeProxy0]phaseId=RENDER_RESPONSE(6)Caused by:
      java.lang.LinkageError - loader org.apache.tomee.catalina.TomEEWebappClassLoader @eb87c61 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 @eb87c61, parent loader java.net.URLClassLoader @4b6995df)
      at java.base/java.lang.ClassLoader.defineClass1(Native Method)

       

      @Named
      @ViewScoped
      public class Enroll implements Serializable {{{    }}

          @Inject
          @RequestMap
          Map<String, Object> requestMap;    @Inject
          @ViewMap
          Map<String, Object> viewMap;
          private boolean createNewSession = false;{{    }}

          public void setCreateNewSession(boolean createNewSession) {
              this.createNewSession = createNewSession;
      {{    }}}

          public boolean isCreateNewSession() {
              return createNewSession;
      {{    }}}

      }

       

      JSF Test-Page:

      <html xmlns="http://www.w3.org/1999/xhtml"
            xmlns:h="http://java.sun.com/jsf/html"
            xmlns:f="http://java.sun.com/jsf/core"
            xmlns:ui="http://xmlns.jcp.org/jsf/facelets">{{    }}

      <h:head></h:head>
      <h:body>
              <h:selectBooleanCheckbox value="#{enroll.createNewSession}" label="Create new session"/>
      </h:body>
      </html>

      {{Once I remove the reference to @ViewMap in Enroll the error will not occur. }}

      I'm not so firm in the specs, but I don't think this is an expected behaviour, it it?

      Attachments

        Activity

          People

            Unassigned Unassigned
            Makkus Makkus B.
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: