NetBeans6.1 RC2でDBにアクセスするWebアプリを作ろうと思う。
とりあえず、データベースが無いと始まらないので、お手軽にDerbyを使うことにした。
ServersウィンドウにDatabaseというノードがあって、そこにJava DBというのがあるので、右クリックして起動する。
Outputウィンドウに下のようなメッセージが表示され、DBが起動する。
サーバーは、ポート 1527 で接続を受け入れる準備ができました。
新しいDBを作成するぞ!JavaDBで右クリックしてDBを作成する。
empmngという名前で作ってみた。
と思ったらDBが出来上がったような、出来上がらなかったような…必要項目を入れてOKを押したら何もリアクションを返してくれずにダイアログが閉じた。
ん~…DBのフォルダを覗いてみるとフォルダは出来上がってるので、多分作成は成功したのだろう。
次は、そのDBへの接続を追加しようとするんだけど…追加できない。
下のようなエラーが出てしまう。
java.lang.IllegalStateException: Error in org.openide.nodes.AsynchChildren with entry Children.Keys.KE[maxRowSizeIncludeBlobs: false
catalogAtStart: false
minimumSQLGrammar: false
rem,0] from among null in {Children.Array.AE[]=Children.Info[Children.Array.AE[],length=0], Children.Keys.KE[iconbase: org/netbeans/modules/db/resources/database
properties: []
options: {}
,0]=Children.Info[Children.Keys.KE[iconbase: org/netbeans/modules/db/resources/database
properties: []
options: {}
,0],length=1], Children.Keys.KE[maxRowSizeIncludeBlobs: false
catalogAtStart: false
minimumSQLGrammar: false
rem,0]=Children.Info[Children.Keys.KE[maxRowSizeIncludeBlobs: false
catalogAtStart: false
minimumSQLGrammar: false
rem,0],length=1]} probably caused by faulty key implementation. The key hashCode() and equals() methods must behave as for an IMMUTABLE object and the hashCode() must return the same value for equals() keys.
at org.openide.nodes.Children.checkInfo(Children.java:889)
at org.openide.nodes.Children.updateRemove(Children.java:909)
at org.openide.nodes.Children.setEntries(Children.java:872)
at org.openide.nodes.Children$Keys$2.run(Children.java:2136)
at org.openide.util.Mutex.postRequest(Mutex.java:1251)
at org.openide.util.Mutex.postWriteRequest(Mutex.java:582)
at org.openide.nodes.Children$Keys.applyKeys(Children.java:2145)
at org.openide.nodes.Children$Keys.setKeys(Children.java:2090)
at org.openide.nodes.AsynchChildren.run(AsynchChildren.java:147)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
うちの環境がVistaでNetBeansのインストールとアンインストールを繰り返してるせいかなぁ…
そのせいならいいけど、そうじゃないならこのままリリースされるとちょっと嫌かな。
今までちょっとつついただけでGlassFishでWebアプリを起動できない、DBの接続が追加できないっていうのにぶちあたったから…。