3 Replies Latest reply on Jun 16, 2009 5:33 PM by serd SERDAR

    seam on glassfish

    serd SERDAR Newbie
      After I install glassfish everything looked good. I am able to run localhost:8080 and localhost:4848

      but when I try to run ant gf-prepare command from my projects directory I got "glassfish.home does not point to a valid glassfish installation" error.

      I also deploy and run some seam sample applications on glassfish there shouldn't be any problem with glassfish installation.

      I am using Windows XP, glassfish 2.1, seam 2.1.2

      my build.properties file includes

      jboss.home=C:\\tools\\jboss-4.2.3.GA
      jboss.domain=default
      glassfish.home=C:\\glassfish
      glassfish.domain=domain1

      I used to work with jboss and try to migrate to glassfish. My project runs well on jboss server.

      what am I doing wrong. I try to change glassfish.home variable. I tried every possible combination but I still get the same error.
        • 1. Re: seam on glassfish
          Chris Dunphy Newbie

          There is a bug in the glassfish-build.xml file that affects Windows.


          If you notice earlier in the build script, from lines 14-25 there is a condition tag and it differentiates between windows and non-windows hosts..




          <condition>
              <or>
                  <length string="${glassfish.home}" trim="true" length="0"/>
                  <and>
                      <not><os family="windows"/></not>
                      <not><available file="${glassfish.home}/bin/asadmin"/></not>
                  </and>
                  <and>
                      <os family="windows"/>
                      <not><available file="${glassfish.home}/bin/asadmin.bat"/></not>
                  </and>
              </or>
          </condition>




          This part works.  However, if you go down to the gf-deploy hibernate tag, there is a condition tag that starts at line 176.  It is missing the condition for windows hosts.. take a look:



          <fail message="glassfish.home not set" unless="glassfish.home"/>
          <fail message="glassfish.home does not point to a valid GlassFish installation">
              <condition>
                  <or>
                      <length string="${glassfish.home}" trim="true" length="0"/>
                      <not><available file="${glassfish.home}/bin/asadmin"/></not>
                  </or>
              </condition>
          </fail>




          Try replacing the above with:




          <fail message="glassfish.home not set" unless="glassfish.home"/>
          <fail message="glassfish.home does not point to a valid GlassFish installation">
              <condition>
                  <or>
                      <length string="${glassfish.home}" trim="true" length="0"/>
                      <and>
                          <not><os family="windows"/></not>
                          <not><available file="${glassfish.home}/bin/asadmin"/></not>
                      </and>
                      <and>
                          <os family="windows"/>
                          <not><available file="${glassfish.home}/bin/asadmin.bat"/></not>
                      </and>
                  </or>
              </condition>
          </fail>
          




          Be aware that seam-gen support for GlassFish seems to be pretty new and not well tested.  Particularly with EAR based projects I have encountered some annoying issues.


          Hope that helps!

          • 3. Re: seam on glassfish
            serd SERDAR Newbie

            thank you very much it solved my problem.