感谢sharetop(天生不笨)!
另有一事不明:~/server/default/conf下standardjbosscmp-jdbc.xml何用?
这是俺在自己的环境下配置成功的步骤,供大家参考:
同Jboss 2.4.x不同,需要在~/server/default/deploy 目录下添加文件oracle-service.xml,这个文件可参看~/docs/examples/jca/目录下(该目录存有多种数据库配置文件模板)oracle-service.xml文件。
具体步骤如下:
1、 删除~/server/default/deploy下文件hsqldb-service.xml
2、 复制一份oracle-service.xml文件到~/server/default/deploy下
3、 修改该文件:
a) <!--comment out this line if you want component managed security or want
to use the default values in the ManagedConnectionFactoryProperties -->
<attribute name="SecurityDomainJndiName">OracleDbRealm</attribute>
改为:
<!--comment out this line if you want component managed security or want
to use the default values in the ManagedConnectionFactoryProperties
<attribute name="SecurityDomainJndiName">OracleDbRealm</attribute>
-->
b) 配置ConnectionURL:jjdbc:oracle:thin:@192.168.16.68:1521:ORA816
c) 配置下面的用户名和口令
4、 修改~/server/default/conf/standardjaws.xml文件(只是头几行)
<jaws>
<datasource>java:/DefaultDS</datasource>
<type-mapping>Hypersonic SQL</type-mapping>
<debug>false</debug>
改为:
<jaws>
<datasource>java:/OracleDS</datasource>
<type-mapping>Oracle8</type-mapping>
<debug>false</debug>
5、 将class12.jar添加到CLASSPATH当中。
<!-- Include a login module configuration named HsqlDbRealm.
Update your login-conf.xml, here is an example for a
ConfiguredIdentityLoginModule:
<application-policy name = "HsqlDbRealm">
<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=hsqldbDS</module-option>
</login-module>
</authentication>
</application-policy>
NOTE: the application-policy name attribute must match
SecurityDomainJndiName, and the
module-option name = "managedConnectionFactoryName"
must match the object name of the ConnectionManager you are configuring here.
-->
<!--uncomment out this line if you are using the DB2DbRealm above
<attribute name="SecurityDomainJndiName">HsqlDbRealm</attribute>
-->