無為

          無為則可為,無為則至深!

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            190 Posts :: 291 Stories :: 258 Comments :: 0 Trackbacks

          公告

          與有奉獻精神和分享精神的人做朋友!

          Locations of visitors to this page
          Subscribe by Anothr

          搜索

          •  

          積分與排名

          • 積分 - 582151
          • 排名 - 83

          最新評論

          閱讀排行榜

          Recently Guillaume reported to me about his Grail app not deploying on GlassFish v3 Preview 2. The problem reported was that the Grail app was taking lots of time to deploy on GlassFish v3 Preview 2. Although such failures are not acceptable but considering GlassFish v3 is a complete new architecture, is still under development and feature incomplete and above all the preview releases do not go thru the normal test cycle so such bugs can appear.

          This issue was discussed at the GlassFish mailing list, see the discussion here and the corresponding bug.

          The good news is that Jerome quickly found out what the problem was and after the code went thru reviews, it was checked in and the fix went into yesterday's nightly build.

          Here is how I created and deployed a Grails application on GlassFish v3:

          Create a simple Grails app

          Setup Grails This is the standard way you would setup the Grails environments:

              export PATH=$GRAILS_HOME/bin:$PATH
          export GRAILS_HOME=/tools/grails
          

           

           

          Create a simple Grails app
              vivekmz@boson(555)> grails create-app MyFirstGrailsApp
          Welcome to Grails 1.0.1 - http://grails.org/
          Licensed under Apache Standard License 2.0
          Grails home is set to: /tools/grails
          Base Directory: /ws/sb
          Environment set to development
          Note: No plugin scripts found
          Running script /tools/grails/scripts/CreateApp.groovy
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/src
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/src/java
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/src/groovy
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/grails-app
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/grails-app/controllers
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/grails-app/services
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/grails-app/domain
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/grails-app/taglib
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/grails-app/utils
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/grails-app/views
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/grails-app/views/layouts
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/grails-app/i18n
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/grails-app/conf
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/test
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/test/unit
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/test/integration
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/scripts
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/web-app
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/web-app/js
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/web-app/css
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/web-app/images
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/web-app/META-INF
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/lib
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/grails-app/conf/spring
          [mkdir] Created dir: /ws/sb/MyFirstGrailsApp/grails-app/conf/hibernate
          [propertyfile] Creating new property file:
          /ws/sb/MyFirstGrailsApp/application.properties
          [copy] Copying 2 files to /ws/sb/MyFirstGrailsApp
          [copy] Copying 2 files to /ws/sb/MyFirstGrailsApp/web-app/WEB-INF
          [copy] Copying 5 files to /ws/sb/MyFirstGrailsApp/web-app/WEB-INF/tld
          [copy] Copying 87 files to /ws/sb/MyFirstGrailsApp/web-app
          [copy] Copying 17 files to /ws/sb/MyFirstGrailsApp/grails-app
          [copy] Copying 1 file to /ws/sb/MyFirstGrailsApp
          [copy] Copying 1 file to /ws/sb/MyFirstGrailsApp
          [copy] Copying 1 file to /ws/sb/MyFirstGrailsApp
          [propertyfile] Updating property file:
          /ws/sb/MyFirstGrailsApp/application.properties
          Created Grails Application at /ws/sb/MyFirstGrailsApp
          

          Start GlassFish v3

              vivekmz@boson(735)> glassfish/bin/asadmin start-domain
          Mar 7, 2008 7:43:04 PM com.sun.enterprise.v3.server.AppServerStartup run
          INFO: HK2 initialized in 281 ms
          Mar 7, 2008 7:43:04 PM com.sun.enterprise.v3.server.AppServerStartup run
          INFO: com.sun.enterprise.naming.impl.ServicesHookup@51b48197 Init done in 307 ms
          Mar 7, 2008 7:43:04 PM com.sun.enterprise.v3.server.AppServerStartup run
          INFO: com.sun.enterprise.v3.services.impl.CmdLineParamProcessor@9c0ec97 Init done in 310 ms
          Mar 7, 2008 7:43:04 PM com.sun.enterprise.v3.server.AppServerStartup run
          INFO: com.sun.enterprise.v3.server.SystemTasks@1fd0fafc Init done in 382 ms
          Mar 7, 2008 7:43:04 PM com.sun.enterprise.v3.server.AppServerStartup run
          INFO: com.sun.enterprise.v3.services.impl.LogManagerService@388ee016 Init done in 411 ms
          Mar 7, 2008 7:43:04 PM com.sun.enterprise.v3.server.AppServerStartup run
          INFO: com.sun.enterprise.v3.services.impl.HouseKeeper@a210b5b Init done in 413 ms
          Mar 7, 2008 7:43:04 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start
          INFO: Listening on port 8080
          Mar 7, 2008 7:43:04 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start
          INFO: Listening on port 8181
          Mar 7, 2008 7:43:04 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start
          INFO: Listening on port 4848
          Mar 7, 2008 7:43:04 PM com.sun.enterprise.v3.server.AppServerStartup run
          INFO: com.sun.enterprise.v3.services.impl.GrizzlyService@506f9b8e startup done in 630 ms
          Mar 7, 2008 7:43:04 PM com.sun.enterprise.v3.server.AppServerStartup run
          INFO: com.sun.enterprise.security.SecurityServicesUtil@585976c2 startup done in 732 ms
          Mar 7, 2008 7:43:04 PM com.sun.enterprise.v3.server.AppServerStartup run
          INFO: Glassfish v3 started in 733 ms
          

          You can see above it took 733ms to boot up!

          Deploy the Grails App

          Now that I have built MyFirstGrailsApp, it is time to deploy. So first I will create a war file:

              vivekmz@boson(558)> cd MyFirstGrailsApp/
          vivekmz@boson(559)> grails war
          

           

          Now Let's deploy to GlassFish v3:
              vivekmz@boson(749)> ../glassfish/bin/asadmin deploy MyFirstGrailsApp-0.1.war
          SUCCESS : MyFirstGrailsApp-0.1 deployed successfully
          properties=(name=MyFirstGrailsApp-0.1)
          

          The server log tells, it took about 9.7 seconds to deploy it:

          [#|2008-03-07T20:19:03.580+0000|INFO|GlassFish10.0|javax.enterprise.system.tools.deployment|_ThreadID=12;_ThreadName=Thread-4;|Deployment of MyFirstGrailsApp-0.1 done is 9765 ms|#]

          Now when I accessing http://localhost:8080/MyFirstGrailsApp-0.1/ my Grails app appears in the Firefox:

           

          GlassFish v3 has been going thru continuous improvements and the development team is busy making it rock solid while adding new features to it. Continue sending your feedbacks to users@glassfish.dev.java.net.

          凡是有該標志的文章,都是該blog博主Caoer(草兒)原創,凡是索引、收藏
          、轉載請注明來處和原文作者。非常感謝。

          posted on 2008-03-10 11:53 草兒 閱讀(1935) 評論(0)  編輯  收藏 所屬分類: JAVA WEB應用
          主站蜘蛛池模板: 岑巩县| 光泽县| 保德县| 福泉市| 苏尼特左旗| 搜索| 睢宁县| 江陵县| 重庆市| 连江县| 宁波市| 龙州县| 雷州市| 白河县| 天柱县| 开平市| 梁平县| 临沂市| 富民县| 廉江市| 天门市| 文成县| 达拉特旗| 乌海市| 轮台县| 日照市| 扎兰屯市| 保靖县| 托克托县| 疏勒县| 焦作市| 河津市| 边坝县| 肇东市| 汕头市| 南岸区| 江北区| 修文县| 洛隆县| 钟山县| 和静县|