7 Replies Latest reply on Jun 8, 2007 2:49 AM by atao

    seam 1.3.0.alpha seam-gen error

    lschaffer

      Hello
      I have trouble with latest seam-gen 'generate-entities' (jboss-seam-CVS.20070603 )


      first ehcache is missing from the lib (i have copied it)
      but I have got this exception

      java.lang.IllegalAccessError: tried to access field org.hibernate.cfg.Collection
      SecondPass.collection from class org.hibernate.cfg.JDBCBinder$JDBCCollectionSecondPass


      any idea?

        • 1. Re: seam 1.3.0.alpha seam-gen error
          lowecg2004

          I had that earlier. I have no solution at this time, just a work around.

          I had two entities in my seam-gen.reveng.xml that had previously generated fine. The first time I got the error all I had to do was delete the entities and run seam-gen again. I was not successful with subsequent retries, where I ended up having to delete the entities and run seam-gen once per table:

          <hibernate-reverse-engineering>
           <schema-selection match-schema="DCSCORE"/>
           <table-filter match-name="SYS_GROUPS"/>
          </hibernate-reverse-engineering>


          I would like to know a better solution to this...

          Cheers,

          Chris.

          • 2. Re: seam 1.3.0.alpha seam-gen error
            lschaffer

            finally I have found the solution
            *CollectionSecondPass*.class have two versions
            one in lib\hibernate-all.jar another in seam-gen\lib\hibarnate.jar
            I have renamed (temp) lib\hibernate-all.jar to hibernate-all.jar.x then it has worked fine

            • 3. Re: seam 1.3.0.alpha seam-gen error
              awhitford

              Are you sure that did the trick? I see the same hibernate-all.jar in project\lib as seam-gen\lib. Renaming the one in project\lib doesn't change a thing for me...

              I recall I had this problem in the past and I had gotten around it by removing tables and constraints...

              • 4. Re: seam 1.3.0.alpha seam-gen error
                awhitford

                I traced the problem to having a foreign key constraint. If I drop the constraint, seam-gen works fine...

                (But I want that constraint, and I'm expecting seam-gen will generate code with convert-entity...)

                • 5. Re: seam 1.3.0.alpha seam-gen error
                  atao

                  lschaffer is right. It's aN issue with the version of hibernat in seam-csv/lib/hibernate-all.jar.

                  Even if you specify an other archive file for hibernate, seam always uses seam-csv/lib/hibernate-all.jar as there is

                  java -cp "%JAVA_HOME%\lib\tools.jar;%DIRNAME%lib\ant-launcher.jar" -Dant.home="%DIRNAME%lib" -Dant.library.dir="%DIRNAME%lib" org.apache.tools.ant.launch.Launcher -buildfile "%SEAMGENDIR%\build.xml" %ARGS%
                  


                  in seam.bat under windows

                  and

                  java -cp "${JAVA_HOME}/lib/tools.jar:../lib/ant-launcher.jar" -Dant.home=../lib -Dant.library.dir=../lib org.apache.tools.ant.launch.Launcher ${*}
                  


                  in seam under linux.

                  A turnaround is to remove hibernate-all.jar from seam-csv/lib when using seam generate-entities.


                  • 6. Re: seam 1.3.0.alpha seam-gen error
                    gavin.king

                    That should now be fixed in current CVS, please test it for us.

                    • 7. Re: seam 1.3.0.alpha seam-gen error
                      atao

                      First try: everything seems ok now.