顯示具有 glassfish 標籤的文章。 顯示所有文章
顯示具有 glassfish 標籤的文章。 顯示所有文章

2013年4月28日 星期日

glassfish domain 無法啟動 - CLI156 Could not start the domain

我使用的是 Glassfish 2 V1的版本,已經跑了3年以上了,不過今天發生如下的錯誤訊息,一直無法開啟。

上網查了一下,有的人建議動新建立一個新的 domain, 不過有人建議如下

Glassfish hangs on OS X 10.5/Java 6
先檢查目錄 /glassfish/domains/domain1/imq/instances/imqbroker/ 是否有個檔案叫 lock(要把隱藏檔顯示),如果有,請把它刪除後再重新啟動看看。

很幸運的,我有這個檔案而且刪除之後就可以正常啟動了。


Timeout waiting for domain domain1 to go to starting state.
CLI156
Could not start the domain domain1.

2012年9月2日 星期日

glassfish 上使用 javaMail

在原廠的文件上在使用 JNDI 找時,會用 initialContext.lookup("java:comp/env/mail/mailSource");
java:comp/env 開頭來找 mail source,但這樣用時會出現錯誤,找不到這個 mail source,
而如果用  initialContext.lookup("mail/mailSource"); 取消 java:comp/env 字串時,捉出來的 object 會是
MailConfiguration 而非 Session,所以網友有分享以下的作法,可以參考看看


                    ic = new InitialContext();
 Object object = ic.lookup(snName);

         if (object instanceof MailConfiguration)
        {
           MailConfiguration configuration = (MailConfiguration) object;
           session1 = Session.getInstance(configuration.getMailProperties());
        }
        else if (object instanceof Session)
        {
           session1 = (Session) object;
       }

2012年8月28日 星期二

Glassfish 上管理 openmq service

參考文章:Configuring JMS Resources in GlassFish: Part 1
Configuring JMS Resources in GlassFish: Part 2

在第二個連結網址設定Object Stores java.naming.provider.url的值要以 file:///開頭,比如
file:///C:\\temp這樣才可以。 其它的按照文件設定即可。

值會儲存在  C:\Documents and Settings\userID\.imq\admin

2010年10月27日 星期三

設定GlassFish 記憶体使用量

參考網站:http://itgeekhelp.blogspot.com/2009/04/increase-glassfish-memoryheap.html

Application Server->JVM Settings->JVM Options

將 -Xmx512m 改為 -Xmx1024m 或更大

將 -XX:MaxPermSize 的值設為256m

2010年7月11日 星期日

自製 Glassfish Realm

目前的需求是想作一個帳號、密碼的登入需求:使用者登入帳號、密碼後檢查的規則如下
1.先檢查ERP的帳號,如果登入失敗則往下檢查
2.檢查 ADD 的帳號,如果失敗覔往下檢查
3.檢查資料庫內某一特定 TABLE的帳號、密碼欄

如果要達到這樣的需求看來好像只能用自製的 Realm and Login Module了

在網路上有找這一篇文章 http://blogs.sun.com/nithya/entry/groups_in_custom_realms
對我來說很有用,應該是符合我的需求,大家可以參考看看,如果有更好建議,希望可以告知我哦

2010年2月11日 星期四

Flex 作品3 - 儀器管理

網址:
作品Demo


為一個儀器管理系統, MSA, Measurement Systems Analysis,目的可以讓使用者管理儀器,而使用者需定期校正儀器,看其功能是否正常,所以最主要就是可以讓使用者把校正結果明確的記錄下來
開發工具為: Flex builder 3
資料庫整合: Clear Data Builder 3.1 (flash builder 4就不建議用了)
CDB 3.1說明

JAVA Application Server: Glassfish 2.1.1

在glassfish 使用的技術如下:
security :採用 jdbc realm
非同步程式更新:建立一個Queus,並使用Meassage Driven Bean
主要程式:建立一war

2009年10月16日 星期五

glassfish jdbc realm 設定

  1. 新增table至資料庫
    前提:在glassfish已設定好 jdbc datasource
    create table usertable(userid varchar2(20),passwd varchar2(20));
    create table grouptable(userid varchar2(20),groupid varchar2(20));

  2. 設定 Realm
    至配置 - 安全性  - 範圍,按下新增


    設定相關參數


  3. 新增一web專案:使用netbeans 建立一web 專案
    修改 web.xml





    修改 sun-web.xml


  4. 建立一login網頁 :其form action input name名稱都不可以更改


  5. 測試:deploy war file至glassfish上

2009年10月11日 星期日

Flex 3 with BlazeDS On Glassfish

相關檔案下載網址:

java ap server :glassfish v2 https://glassfish.dev.java.net/

BlazeDS :http://opensource.adobe.com/wiki/display/blazeds/Release+Builds

Flex Builder 3: http://www.adobe.com/products/flex/


事前準備:
  1. 下載 Flex Builder 3並安裝,有standalone , eclipse build-in 版本
  2. BladeDS:下載檔案並解壓縮後有,目錄會有 blazeds.war,請作解壓縮,其目錄可以更改成你想要的名字,作為待會要設定的root folder用
  3. 建置glassfish server OK



設定如下:


  1. 在Flex Builder 3上開始一新專案,Application Server Type選擇J2EE並勾選 use remote object access service
  2. root folder為java web 的目錄,你可以下載blazeDS turnkey的war 檔後,解壓縮的目錄當成你的root folder,這個folder會有web-inf的目錄,java專有的目錄,最重要的是 context root要設定好,如果你的java war 檔為 Test1.war 這邊就設定 /Test1,按下 validate configuration後,應該就可以了,這樣就可以產生一個 flex project for j2ee.
  3. 檢查設定,開始專案的properties(在project 上按右鍵,選擇properties),選擇Flex Compiler,在additional compile arguments會有 -service ".........."指向root folder內的一個service-config.xml,如果沒有,就代表設定不成功,root folder設定有問題哦。
  4. 設定remoting-config.xml:位置為root folder 內的web-inf\flex目錄內(你可以使用java IDE 如netbeans or eclipse新增一類別,回傳參數為String "hello"的method,source 指向其類別),新增一tag destination








  5. 在flex builder新增的專案內,會有src的目錄,請選擇一mxml並開啟它,加入新的tag mx:RemoteObject ,其destination為remoting-config.xml內所新增的destionation id ,並新增相關呼叫方法後作compile動作,如果沒有問題,把 bin-degug內的檔案copy至root folder下,再把它包裝成war檔



  6. 將war deploy至glassfish上即OK