下面才是正解 In JBoss4 you can bind the ConnectionFactory/DataSource in the global namespace <local-tx-datasource> <jndi-name>GenericDS</jndi-name> <use-java-context>false</use-java-context> <connection-url>[jdbc: url for use with Driver class]</connection-url> <driver-class>[fully qualified class name of java.sql.Driver implementation]</driver-class> <user-name>x</user-name> <password>y</password> </local-tx-datasource>
这一句有问题,是JNDI的可访问性造成的。java:/ssDS不是全局可访问的,只能本地访问,如果你绑定jdni的时候用ssDS,则ssDS是全局可见。用jboss 的jndiview可以看到这种变化。
In JBoss4 you can bind the ConnectionFactory/DataSource in the global namespace <local-tx-datasource>
<jndi-name>GenericDS</jndi-name>
<use-java-context>false</use-java-context>
<connection-url>[jdbc: url for use with Driver class]</connection-url>
<driver-class>[fully qualified class name of java.sql.Driver implementation]</driver-class>
<user-name>x</user-name>
<password>y</password>
</local-tx-datasource>