刚学EJB3,如题,调用远程接口报出  Exception in thread "main" javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection
at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:304)
at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:809)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:608)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:406)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:173)
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection我的mysql-ds.xml 为
  <datasources>
  <local-tx-datasource>
    <jndi-name>MySqlDS</jndi-name>
    <connection-url>jdbc:mysql://localhost:3306/ejb3</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>root</user-name>
    <password>test</password>
    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
     <metadata>
       <type-mapping>mySQL</type-mapping>
    </metadata>
  </local-tx-datasource>
  <local-tx-datasource>
    <jndi-name>MySqlDS2</jndi-name>
    <connection-url>jdbc:mysql://localhost:3306/ejb32</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>root</user-name>
    <password>test</password>
    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
    <metadata>
       <type-mapping>mySQL</type-mapping>
    </metadata>
  </local-tx-datasource>
</datasources>我的persistence.xml 配置:<persistence-unit name="test" transaction-type="JTA">
   <jta-data-source>java:/MySqlDS</jta-data-source>
   <class>com.ni.jpa.User</class>
   <exclude-unlisted-classes>true</exclude-unlisted-classes>
     <properties>
        <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
<property  name="hibernate.hbm2ddl.auto" value="update"/>
<property  name="hibernate.show_sql" value="true"/>
     </properties>
</persistence-unit>
  <persistence-unit name="test2" transaction-type="JTA">
   <jta-data-source>java:/MySqlDS2</jta-data-source>
   <class>com.ni.jpa.Person</class>
   <exclude-unlisted-classes>true</exclude-unlisted-classes>
     <properties>
        <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
<property  name="hibernate.hbm2ddl.auto" value="update"/>
<property  name="hibernate.show_sql" value="true"/>
     </properties>
</persistence-unit>调用的UserManagerBean 的addUser方法,我注入了针对2个数据源的EntityManager
@Remote(UserManager.class)
@Stateless(name="UserManager")
public class UserManagerBean implements UserManager {
// 注入EntityManager
@PersistenceContext(unitName = "test")
private EntityManager em; @PersistenceContext(unitName = "test2")
private EntityManager em2;

public void addUser(String name) {
User user = new User();
user.setName(name+"_User");
em.persist(user);

Person p = new Person();
p.setName(name+"_Person");
em2.persist(p);
}
我想调用addUser方法把2个对象放在指定的数据库中,一运行就会发现这个错误,在网上也找过,没发现相类似的,同一个事务中对同一个数据库的不同的数据源插入数据报出Cannot open connection,我在事务中只放了一个插入(user或者person)对象的方法,都能成功,就是2个放在一个事务中不行啊,高手求救啊