8 Replies Latest reply on Jul 11, 2007 8:54 AM by damianharvey

    Incremental 'hot' deployment problem

    damianharvey

      I have changed a Seam-Gen EAR based project to use the incremental deployment utilising WEB-INF/dev. I have left my src/model in the normal place but changed the src/action to output it's class files to resources/WEB-INF/dev. I have set core:init debug="true" and changed the build.xml to move the resources/WEB-INF/dev classes to the {war.dir}/WEB-INF/dev directory. I'm not referring to any of these classes from anywhere outside of WEB-INF/dev. All of these classes are JavaBeans (no SFSB or SLSB).

      This all deploys fine and runs without problem, however when I change something (eg. an EntityHome based class) I have errors:

      Caused by: java.lang.IllegalArgumentException: Could not set field value by reflection.....[etc etc]
      Caused by: java.lang.IllegalArgumentException
       at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)....
      


      This wasn't an issue deploying in the normal way and doesn't appear to break the rules of the incremental deployment. Can anyone point me in the right direction?

      Also, when the Seam classloader runs through the list of classes in WEB-INF/dev it prints out only the unchanged classes and omits the ones that have changed. Is this intended?

      Thanks,

      Damian.

        • 1. Re: Incremental 'hot' deployment problem
          damianharvey

          I should mention that the error occurs when I refresh the page and not on the actual redeployment.

          It appears to be choking when I have injected another JavaBean into the class eg.

          @In(create=true)
          NumberGenerator numberGenerator;

          where numberGenerator is just a basic POJO. If I comment this out it will choke on the next one - not necessarily in this class or any class referenced on the current page that is being refreshed.

          Cheers,

          D.

          • 2. Re: Incremental 'hot' deployment problem
            damianharvey

            Sorry to keep dumping on this thread.

            I've generated a new project and tried the same there. It works on the generated EntityHomes however when I dump in all of my classes with their numerous bijections I still have errors - specifically this one:

            java.lang.IllegalArgumentException: value of context variable is not an instance of the component bound to the context variable: vesselHome
            

            At no point had I called a page that references vesselHome.

            Thanks,

            D.

            • 3. Re: Incremental 'hot' deployment problem
              gavin.king

              I think what you are trying to say is that you're trying to do incremental hot deployment of EJB components. This can't be made to work at present :-(

              • 4. Re: Incremental 'hot' deployment problem
                damianharvey

                Unless I'm mistaken (and I frequently am) EJB Components would be SFSB, SLSB, EntityBean or MDB. I'm not trying to incrementally deploy any of these.

                A basic object extending EntityHome as generated by SeamGen wouldn't fall into this category would it?

                Thanks,

                D.

                • 5. Re: Incremental 'hot' deployment problem
                  matt.drees

                   

                  "damianharvey" wrote:
                  Sorry to keep dumping on this thread.

                  java.lang.IllegalArgumentException: value of context variable is not an instance of the component bound to the context variable: vesselHome
                  




                  I've seen this when I do a hot redeploy, but don't restart a conversation I'm in. That's not causing the other problem you mentioned, I'm sure, but it might be causing this one.

                  • 6. Re: Incremental 'hot' deployment problem
                    gavin.king

                    Yes, the IAE definitely would occur if you redeploy and try to keep working in the same conversation.

                    • 7. Re: Incremental 'hot' deployment problem
                      damianharvey

                      I see what you mean. It works fine when I do that.

                      I still couldn't resolve the earlier errors that I had, and have resorted to Seam-Gen'ing an updated project and dumping all of my code in there. It works now. No idea why it didn't before, but I suspect that it was due to a project generated with Seam 1.1.5 having some config somewhere causing problems with incremental deploy. No issues (aside from the 'stale' conversation) using Seam 2.0.

                      Thanks for the help.

                      D.

                      • 8. Re: Incremental 'hot' deployment problem
                        damianharvey

                        Another problem related to this. All this works fine on my Mac however the project fails to deploy on a colleague's Windows machine. If I change *only* where the class files are put (eg. not into WEB-INF/dev but into the standard 'cold' location) then it deploys fine.

                        Steps to modify project to get running on Windows:
                        1. Change build path source output folder from resources/WEB-INF/dev to classes/action
                        2. Change build.xml to use standard Seam-Gen build.xml - ie. compile task compiles to ${jar.dir}.

                        Is anyone running the incremental deploy on Windows? If so were there any gotchas?

                        The error is :

                        ClassFormatError: Invalid constant pool index 63 in class file ....


                        Weird eh?

                        D.