5 Replies Latest reply on Jul 2, 2011 7:11 PM by niknik77771

    Weld 1.2?

    tandraschko

      Hi,


      where can i get weld-servlet 1.2.0-beta2 or newer?
      I have few problems with non serializable stuff of weld 1.1 and i saw a comment that it will be fixed with 1.2.0-beta2.

        • 1. Re: Weld 1.2?
          tandraschko

          Did anyone managed to get @ViewScoped working?
          My problem is that org.jboss.weld.seam.ManagedBean is not serializable...

          • 2. Re: Weld 1.2?
            andrewwheeler

            It seams that it is only Myfaces that attempts to serialise org.jboss.weld.seam.ManagedBean in the ViewMap. This has been addressed by Pete (See this Myfaces JIRA). It now appears weld has worked around this issue. However it would be nice to get instructions on how to apply this to AS6.


            • 3. Re: Weld 1.2?
              tandraschko

              Because there is no response of the weld team and also the issue was not commented, i tried to fix this problem.
              My steps:
              1) Make ManagedBean Serializable
              2) Add a default constructor in ManagedBean
              3) Add also a default constructor in the superclasses (Eclipse will navigate you)
              4) Fix the: xxx may not have been initialized errors of eclipse



                 protected ManagedBean() {
                         proxiable = true;
                 }
              
                 protected AbstractBean() {
                         services = null;
                 }
              
                 protected AbstractClassBean() {
                         
                 }
              
                 protected RIBean() {
                         this.beanManager = null;
                         this.id = "";
                         this.hashCode = this.id.hashCode();
                 }




              I do not know whether it could have any side effects but on my first tests, it works without problems.

              • 4. Re: Weld 1.2?
                tandraschko

                Ok it does not really work. The ViewScoped is like a @RequestScoped bean.

                • 5. Re: Weld 1.2?
                  niknik77771

                  Make you Bean Serializable and use this solution for ViewScoped. It works for me. https://github.com/verborghs/jsf-cdi