5 Replies Latest reply on Apr 17, 2009 4:00 PM by Brendan Farragher

    binding problem

    Tomislav Jakopec Novice

      Today we start to use JBOSS 4.2.2 GA (RF 3.1.3. SNAPSHOT) and have following problem :


      java.lang.IllegalArgumentException: Could not set field value by reflection: Binding.simpleTogglePanel1 on: orka.core.view.Binding with value: class org.richfaces.component.html.HtmlSimpleTogglePanel


      everything was working fine (JBOSS was 4.2.0 GA), now its question should I change something in my code or is bug (question where - in my code - RF - SEAM - JBOSS AS.

      bean
      package orka.core.view;
      import java.io.Serializable;
      import org.richfaces.component.html.HtmlTabPanel;
      @Name("binding")
      @Scope(ScopeType.CONVERSATION)
      public class Binding implements Serializable{
      
       @In(required = false, create = true)
       @Out(required = false)
       public HtmlTabPanel tabPanel1;
      
       public void createBinding() {
      
       }
      }
      


      jsp (/kadrovska/natjecaji/natjecaj/AkcijaNatjecaj.jsp)
      <r:tabPanel switchType="server" binding="#{tabPanel1}">
      


      pages.xml
      <page view-id="/kadrovska/natjecaji/natjecaj/AkcijaNatjecaj.jsp"
       login-required="true" action="#{binding.createBinding}">
       <begin-conversation join="true" pageflow="natjecaj"
       flush-mode="MANUAL" />
       </page>
      



        • 1. Re: binding problem
          Tomislav Jakopec Novice

          Additional information:
          Before was SEAM 2.0 CR, now is SEAM 2.0 GA.

          Then I try instead binding="#{tabPanel1}" to put binding="#{binding.tabPanel1}" and get


          java.lang.IllegalArgumentException: argument type mismatch


          I will post this problem also on SEAM forum, but I think that maybe my RF approach is wrong...

          Any help is appreciated!




          • 2. Re: binding problem
            Tomislav Jakopec Novice

            We resolve problem! Want to know how? :)

            Problem was in JBOSS class loader.

            In file
            $jboss-4.2.2.GA/server/default/deploy/jboss-web.deployer/META-INF/jboss-service.xml

            put

            <attribute name="Java2ClassLoadingCompliance">true</attribute>
             <!-- A flag indicating if the JBoss Loader should be used. This loader
             uses a unified class loader as the class loader rather than the tomcat
             specific class loader.
             The default is false to ensure that wars have isolated class loading
             for duplicate jars and jsp files.
             -->
             <attribute name="UseJBossWebLoader">true</attribute>
             <!-- The list of package names that should not be loaded without
             delegating to the parent class loader before trying the web app
             class loader. The packages listed here are those tha are used by
             the web container implementation and cannot be overriden.
             This only applies when UseJBossWebLoader=false.
             -->
            


            instead of false

            • 3. Re: binding problem
              Brendan Farragher Newbie

              This solved my Seam/JSF component binding problem also. I was getting the same argument mismatch exception while trying to bind to a HtmlPickList. I am concerned about altering this setting, though. I only did this on my local JBoss server for testing my Seam app... Is this a wise configuration change? What types of problems can altering this setting cause for existing applications?

              Thanks.

              • 4. Re: binding problem
                Brendan Farragher Newbie

                OK, I was able to override the class loading settings at the project level. Note that I diod not have to override the "UseJBossWebLoader" setting. I had to include a jboss-web.xml file in my WEB-INF directory as shown below. Also, I had to package the RichFaces jars inside of my <App name>.jar file, which resides inside of my .ear file, in order for my session bean to be able to find the HtmlPickList component. Finally, I used the technique described here:

                http://docs.jboss.org/seam/2.0.1.CR1/reference/en/html/conversations.html#d0e5171

                for wrapping the HtmlPickList inside of another bean, but I had to scope the bean at the session level. It did not work correctly at event scope, as the paragraph describes.

                <?xml version='1.0' encoding='UTF-8' ?>
                
                <!DOCTYPE jboss-web
                 PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN"
                 "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd">
                
                <jboss-web>
                
                <class-loading java2ClassLoadingCompliance='true'>
                 <loader-repository>
                 seam.jboss.org:loader=YourAppNameGoesHere
                 <loader-repository-config>
                 java2ParentDelegaton=true
                 </loader-repository-config>
                 </loader-repository>
                </class-loading>
                
                </jboss-web>
                


                • 5. Re: binding problem
                  Brendan Farragher Newbie

                  PS - jboss-web.xml replaces the jboss-all.xml file in the META-INF directory. I deleted jboss-all.xml.

                  Thanks to tjakopec for posting his/her findings.