- PR -

JBOSS-HSQLDBについて質問です。

1
投稿者投稿内容
Hyde
ベテラン
会議室デビュー日: 2005/05/18
投稿数: 63
投稿日時: 2005-06-04 20:05

【概要】
HSQLDBにテーブルを追加してデータも格納しました。
データソースのルックアップも成功しているようです。
HSQLDB のDatabaseManagerを立ち上げてみても存在することを確認しています。
それなのに、なぜか、そんなテーブルないよ。と言われます。

何か設定し忘れているところがあると思うのですが、どなたかご教授ください。
よろしくお願いいたします。

【環境】
JBOSS 3.2.5
eclipse 3.0.1
データソースのルックアップ名:java:/DefaultDS
使用しているJBOSSサーバの場所:jboss-3.2.5\server\default\deploy
※そこにhsqldb-ds.xmlを配置しています。

http://localhost:8080/jmx-console/HtmlAdaptor?action=inspectMBean&name=jboss%3Aservice%3DHypersonic
startDatabaseManager を invoke して、例外にあるSQLを発行すると正しくHITしています。

【結果出力】
19:38:06,924 INFO [Http11Protocol] Coyote HTTP/1.1をポートhttp-0.0.0.0-8080で初期化します
19:38:07,715 INFO [Catalina] Initialization processed in 2373 ms
19:38:07,715 INFO [StandardService] Starting service jboss.web
19:38:07,816 INFO [StandardEngine] Starting Servlet Engine: Apache Tomcat/5.0.26
19:38:07,836 INFO [StandardHost] XML validation disabled
19:38:07,946 INFO [Catalina] Server startup in 231 ms
19:38:08,136 WARN [DeploymentInfo] Only the root deployment can set the loader repository, ingoring config=null
19:38:08,206 INFO [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=file:/C:/jboss-3.2.5/server/default/deploy/http-invoker.sar/invoker.war/
19:38:10,760 WARN [DeploymentInfo] Only the root deployment can set the loader repository, ingoring config=null
19:38:10,780 INFO [TomcatDeployer] deploy, ctxPath=, warUrl=file:/C:/jboss-3.2.5/server/default/deploy/jbossweb-tomcat50.sar/ROOT.war/
19:38:11,140 WARN [DeploymentInfo] Only the root deployment can set the loader repository, ingoring config=null
19:38:11,150 INFO [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil, warUrl=file:/C:/jboss-3.2.5/server/default/deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/
19:38:11,641 INFO [DefaultDS] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=DefaultDS to JNDI name 'java:/DefaultDS'



19:38:18,992 INFO [Http11Protocol] Coyote HTTP/1.1をポート http-0.0.0.0-8080 で起動します
19:38:19,693 INFO [ChannelSocket] JK2: ajp13 listening on /0.0.0.0:8009
19:38:19,733 INFO [JkMain] Jk running ID=0 time=10/120 config=null
19:38:53,471 INFO [STDOUT] FecSystem
19:38:53,601 INFO [FecSystemMsg] [RMI TCP Connection(18)-220.210.14.205]■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
19:38:53,611 INFO [FecSystemMsg] [RMI TCP Connection(18)-220.210.14.205]■■■ リモートアクセス成功 ■■■
19:38:53,611 INFO [FecSystemMsg] [RMI TCP Connection(18)-220.210.14.205]■■■ FecEntranceBean start ■■■
19:38:53,611 INFO [FecSystemMsg] [RMI TCP Connection(18)-220.210.14.205]■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
19:38:53,621 INFO [FecSystemMsg] [RMI TCP Connection(18)-220.210.14.205]■■DSNAME : java:/DefaultDS
19:38:53,621 INFO [FecSystemMsg] [RMI TCP Connection(18)-220.210.14.205]■■■コンテクストの取得:1:javax.naming.InitialContext@1867f7f
19:38:53,621 INFO [FecSystemMsg] [RMI TCP Connection(18)-220.210.14.205]■■■データソースの取得:1:org.jboss.resource.adapter.jdbc.WrapperDataSource@1bd5f28
19:38:53,631 INFO [FecSystemMsg] [RMI TCP Connection(18)-220.210.14.205]■■■contextを閉じました。
19:38:53,682 INFO [FecSystemMsg] [RMI TCP Connection(18)-220.210.14.205]■■■コネクションの取得:2:org.jboss.resource.adapter.jdbc.WrappedConnection@1aedcb3
19:38:53,682 INFO [FecSystemMsg] [RMI TCP Connection(18)-220.210.14.205]■■■prepareStatementの取得:2:null
19:38:53,692 INFO [FecSystemMsg] [RMI TCP Connection(18)-220.210.14.205]========================================================================
19:38:53,692 INFO [FecSystemMsg] [RMI TCP Connection(18)-220.210.14.205]■■■発行前のSQL:
select * from OPE_INF where OPE_ID='fecadmin' and PASSWORD='fecadmin'
19:38:53,692 INFO [FecSystemMsg] [RMI TCP Connection(18)-220.210.14.205]■■■発行前のSQL引数:1:fecadmin
19:38:53,692 INFO [FecSystemMsg] [RMI TCP Connection(18)-220.210.14.205]■■■発行前のSQL引数:2:fecadmin
19:38:53,692 INFO [FecSystemMsg] [RMI TCP Connection(18)-220.210.14.205]========================================================================
19:38:53,702 ERROR [FecSystemMsg] [RMI TCP Connection(18)-220.210.14.205]null
19:38:53,702 ERROR [FecSystemMsg] [RMI TCP Connection(18)-220.210.14.205]null
19:38:53,702 ERROR [FecSystemMsg] [RMI TCP Connection(18)-220.210.14.205]■■■SQLException が発生しました。
19:38:53,712 ERROR [FecSystemMsg] [RMI TCP Connection(18)-220.210.14.205]Table not found: OPE_INF in statement [select * from OPE_INF where OPE_ID='fecadmin' and PASSWORD='fecadmin']
19:38:53,712 INFO [STDOUT] java.sql.SQLException: Table not found: OPE_INF in statement [select * from OPE_INF where OPE_ID='fecadmin' and PASSWORD='fecadmin']
19:38:53,712 INFO [STDOUT] at org.hsqldb.Trace.getError(Unknown Source)
19:38:53,712 INFO [STDOUT] at org.hsqldb.jdbcResultSet.<init>(Unknown Source)
19:38:53,712 INFO [STDOUT] at org.hsqldb.jdbcConnection.executeStandalone(Unknown Source)
19:38:53,712 INFO [STDOUT] at org.hsqldb.jdbcConnection.execute(Unknown Source)
19:38:53,712 INFO [STDOUT] at org.hsqldb.jdbcStatement.fetchResult(Unknown Source)
19:38:53,712 INFO [STDOUT] at org.hsqldb.jdbcStatement.executeQuery(Unknown Source)
19:38:53,712 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.WrappedStatement.executeQuery(WrappedStatement.java:259)
19:38:53,712 INFO [STDOUT] at fec.sb.main.FecEntranceBean.checkAuthority(FecEntranceBean.java:236)
19:38:53,712 INFO [STDOUT] at fec.sb.main.FecEntranceBean.sub_execute(FecEntranceBean.java:163)
19:38:53,712 INFO [STDOUT] at fec.sb.main.FecEntranceBean.execute(FecEntranceBean.java:147)
19:38:53,712 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
19:38:53,712 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
19:38:53,712 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
19:38:53,712 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:324)
19:38:53,712 INFO [STDOUT] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
19:38:53,712 INFO [STDOUT] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
Hyde
ベテラン
会議室デビュー日: 2005/05/18
投稿数: 63
投稿日時: 2005-06-05 18:19
おそらくDBのパスの指定なのだと思います。。。しかし、どこの設定ファイルなのだろう。。。

【試してみたこと】
@jmx-consoleを利用した場合
JBOSSを起動後
http://localhost:8080/jmx-console/
にアクセスして
jboss の
service=Hypersonic
のリンクをたどり、
Databaseがdefaultであることを確認して、
startDatabaseManagerをinvoke
ここには目的のテーブル(OPE_INF)が存在することを確認

で、これが実際どこにあるのかな。。。と探してみると
C:\jboss-3.2.5\server\default\data\hypersonic
にありました。

Aコンソールからキックした場合
hsqldb.jarを探すと、
C:\jboss-3.2.5\server\default\lib
にありました。なのでここからキック。

C:\jboss-3.2.5\server\default\lib>java -cp hsqldb.jar org.hsqldb.Server -databas
e default
server.properties not found, using command line or default properties
Opening database: default
HSQLDB server 1.7.1 is running
Use SHUTDOWN to close normally. Use [Ctrl]+[C] to abort abruptly
Sun Jun 05 18:06:36 JST 2005 Listening for connections ...

そいで、もうひとつコンソール立ち上げて、
java -cp hsqldb.jar org.hsqldb.util.DatabaseManager

すると。。。ない!みえてない。
で、SQLを発行すると
select * from OPE_INF where OPE_ID='fecadmin' and PASSWORD='fecadmin'

【結果】
Table not found: OPE_INF in statement [select * from OPE_INF where OPE_ID='fecadmin' and PASSWORD='fecadmin']

と同じ結果が。。。出てきます。

ということは。。。u-mu ... 作成したところ見にいけてないんですね。。。
デフォルトのままつかってるんですが、どこかを変えないといけないのでしょうか。。。

ちなみに、一番最初に使ったときは、特に何も変更しなくても見にいけてたんです。。。2ヶ月前くらいは。。。おかしいな。

Hyde
ベテラン
会議室デビュー日: 2005/05/18
投稿数: 63
投稿日時: 2005-06-05 18:48
いったー!

原因は、hsqldb-ds.xmlの
<connection-url>jdbc:hsqldb:hsql://localhost:1701</connection-url>
の記述がコメントアウトになっていただけでした!
はずせばいけます。。。

皆様、お騒がせいたしました。
1

スキルアップ/キャリアアップ(JOB@IT)