jboss 3.2.3为何取不到数据源?

04-04-15 husthxd
deploy中已部署了oracle的数据源.(oracle-ds.xml)

<datasources>

<local-tx-datasource>

<jndi-name>DefaultDS</jndi-name>

<connection-url>jdbc:oracle:thin:@<host>:1521:<sid></connection-url>

<!--

Here are a couple of the possible OCI configurations.

For more information, see http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.920/a96654/toc.htm

<connection-url>jdbc:oracle:oci:@youroracle-tns-name</connection-url>

or

<connection-url>jdbc:oracle:oci:@(description=(address=(host=youroraclehost)(protocol=tcp)(port=1521))(connect_data=(SERVICE_NAME=yourservicename)))</connection-url>

Clearly, its better to have TNS set up properly.

-->

<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>

<user-name>jboss</user-name>

<password>password</password>

<!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->

<!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->

<!-- Checks the Oracle error codes and messages for fatal errors -->

<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>

<!-- sql to call when connection is created

<new-connection-sql>select sysdate from dual</new-connection-sql>

-->

<!-- sql to call on an existing pooled connection when it is obtained from pool - the OracleValidConnectionChecker is prefered

<check-valid-connection-sql>select sysdate from dual</check-valid-connection-sql>

-->

<check-valid-connection-sql>select sysdate from dual</check-valid-connection-sql>

</local-tx-datasource>

</datasources>

在客户端lookup数据源的时候出现错误:

javax.naming.NameNotFoundException: No object bound for java:/DefaultDS

at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:116)

除了在deploy下配置oracle-ds.xml外还需要其他的设置的吗?

cqlongman
2004-04-15 15:14
检查一下你发布的时候,服务器报的什么信息哟!

怎么你这个配置文件里面没有指明数据库呢?

windeye
2004-04-15 19:53
jboss中的DataSource只能由jboss容器内的应用访问到,单独的java客户端不能访问DS

husthxd
2004-04-15 23:08
部署实体bean的时候也可以用这个数据源的.

btw:copy代码过来的时候没有copy完全,不好意思.

husthxd
2004-04-15 23:08
噢.

3ks

猜你喜欢