浏览 1771 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2008-05-15
<datasources> <local-tx-datasource> <jndi-name>jdbc/mydatasource </jndi-name> <connection-url>jdbc:oracle:thin:@192.168.18.7:1521:hrgl </connection-url> <driver-class>oracle.jdbc.driver.OracleDriver </driver-class> <user-name>test </user-name> <password>test </password> <metadata> <type-mapping>Oracle9i </type-mapping> </metadata> </local-tx-datasource> </datasources> 启动时报: 10:11:32,828 INFO [STDOUT] Can not get DataBase connection from DB!!!com.lbs.sieaf.exception.NoConnectionException 10:11:32,828 INFO [STDOUT] trans init finish 10:11:32,859 INFO [STDOUT] catch NamingException when trying to lookup DataSource name javax.naming.NameNotFoundException: jdbc not bound 10:11:32,859 ERROR [STDERR] com.lbs.sieaf.exception.NoConnectionException 在控制台中,可以看到两个: jboss.jdbc datasource=DefaultDS,service=metadata datasource=jdbc/mydatasource,service=metadata service=SQLExceptionProcessor service=metadata 第一个是默认的java数据源 第二个是我要用的oracle的数据源 在网上搜索到jboss配置的文章,按照上面介绍的方法: 在login-config.xml里面配置: <application-policy name = "OracleDbRealm"> <authentication> <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required"> <module-option name = "principal">sa </module-option> <module-option name = "userName">sa </module-option> <module-option name = "password"> </module-option> <module-option name ="managedConnectionFactoryName"> jboss.jca:service=LocalTxCM,name=jdbc/mydatasource </module-option> </login-module> </authentication> </application-policy> 在standardjaws.xml里面配置: <jaws> <datasource>jdbc/mydatasource </datasource> <type-mapping>Oracle9i </type-mapping> </jaws> 在standardjbosscmp-jdbc.xml里面配置: <jbosscmp-jdbc> <defaults> <datasource>jdbc/mydatasource </datasource> <datasource-mapping>Oracle9i </datasource-mapping> </defaults> </jbosscmp-jdbc> 结果测试还是不行,在pl/sql里面有看到连接过去,但是调用启动时候都会出现如下错误: 10:11:32,828 INFO [STDOUT] Can not get DataBase connection from DB!!!com.lbs.sieaf.exception.NoConnectionException 10:11:32,828 INFO [STDOUT] trans init finish 10:11:32,859 INFO [STDOUT] catch NamingException when trying to lookup DataSource name javax.naming.NameNotFoundException: jdbc not bound 10:11:32,859 ERROR [STDERR] com.lbs.sieaf.exception.NoConnectionException 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |