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.

2013年4月18日 星期四

MongoDB 和 Asp.Net MVC

A MONGODB TUTORIAL USING C# AND ASP.NET MVC 使用 ASP.NET MVC 3和 MONGODB實作了一個 BLOG網站,大家可以試試看,我自己還在消化,有幾點可以和大家分享

我使用是 APS.NET MVC 4 和 MONGODB C# DRIVER 1.8.1.20和一個 MONGODB 是放在 SERVER上,所以使用宓碼連結

連結 MONGO的寫法要改成如下

var client = new MongoClient("mongodb://userName:passWord@ipaddress/dbName");
var server = client.GetServer();
var db = server.GetDatabase("dbName");

可以成功執行後,我想要讓 CKEDITOR 可以上傳圖片,就 ASP.NET MVC來說,還是要使用 CK FINDER FOR ASP.NET的版本

可以在 CKEDITOR 的 config.js 內加上
config.filebrowserImageBrowseUrl = '/Scripts/ckfinder/ckfinder.html?type=Images';
config.filebrowserUploadUrl= '/Scripts/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files';
config.filebrowserImageUploadUrl= '/UploadImage/Upload';  //controller/actionName

在 CKFINDER的 config.ascx

public override bool CheckAuthentication() 依權限 return true;

public override void SetConfig()
我的 CKFINDER是放在 Scripts的目錄,所以 BaseUrl = "~/Scripts/ckfinder/userfiles/";


客制的 UPLOAD CONTROLLER
public ActionResult Upload(HttpPostedFileBase upload, string CKEditorFuncNum, string CKEditor, string langCode)
    {
        string url; // url to return
        string message; // message to display (optional)
        //CODE FOR SAVE IMAGE HERE
        url =  "/" + path + "/" + filename;
      string output = @"";

            return Content(output);
        }
參數有三個CKEditor=editor1&CKEditorFuncNum=1&langCode=en

CK Finder for asp.net V2.3.1 download


參考網址
A MONGODB TUTORIAL USING C# AND ASP.NET MVC

CSharp Driver Tutorial

Authenticate to MongoDB with the C# Driver

Integration of CkFinder with Ckeditor failed in my Asp.net mvc3.How can i successfully integrate it?

Integrating CKEditor with a Custom File Browser

Splitting DateTime - Unit Testing ASP.NET MVC Custom Model Binders

ASP.NET MVC Model Binding and Data Annotation

MongoDB实战开发

PHP實作 Ckeditor+Ckfinder檔案上傳 動態指定儲存位置


其它..

在 Global.asax.cs 的 protected void Application_Start() 加上

 ModelBinders.Binders.Add(typeof(ObjectId), new ObjectIdBinder());  //自動產生 mongoID

monogo基本指令

show dbs
show collections
use --dbName  

db.--collectionsName.find()

mogodb C# driver 請直接用 negut就可以找的到



2013年4月11日 星期四

Oracle EBS R12 GL 會科節段(Segment) 的 Account Type選錯了怎麼辦

如果一開始在維護會科節段(Segment)時, Account Type如果選錯的話,比如正確的為 Asset,但選成 Expense,如果已經有產生一個 code combination,其 Type應該為 Expense,但如果後來又再去改會科節段(Segment)的Account Type變成 Asset,這時 已產生code combination的 Type是不會變的,新產生的code combination的 Type才會是正確的,解決的方式如下

You can open a new account with the required account type and then transfer the balance from the previous account to the new account.
Alternatively you can follow the steps to correct a misclassified account to change the account type.

可以參考
R12: Troubleshooting Misclassified Accounts in General Ledger [ID 872162.1]