应该可以,没试过,你初始化Context的时候指定连接的服务器,如
      Hashtable props = new Hashtable();      props.put(InitialContext.INITIAL_CONTEXT_FACTORY,
                SystemProperty.getProperty(DefaultConfigDriver.
                                           INITIAL_CONTEXT_FACTORY));
      props.put(InitialContext.PROVIDER_URL,
                SystemProperty.getProperty(DefaultConfigDriver.PROVIDER_URL));      //This establishes the security for authorization/authentication
      props.put(InitialContext.SECURITY_PRINCIPAL,
                SystemProperty.getProperty(DefaultConfigDriver.
                                           SECURITY_PRINCIPAL));
      props.put(InitialContext.SECURITY_CREDENTIALS,
                SystemProperty.getProperty(DefaultConfigDriver.
                                           SECURITY_CREDENTIALS));      context = new InitialContext(props);

解决方案 »

  1.   

    web application 的部署只需要将*.war包部署就可以了,至于EJB应该可以的!
      

  2.   

    谢谢楼上两位,
    继续。
    是的。我也是这样设置的。
    不知道为什么不行,好像是bea的问题。
    现在后台抛
    java.sql.SQLException: XA error: XAER_RMERR : A resource manager error has occured in the transaction branch start() failed on resource 'xaPool': XAER_RMERR : A resource manager error has occured in the transaction branch
    oracle.jdbc.xa.OracleXAException
      

  3.   

    我用的是weblgic7,这是不是weblogic7的问题。
    可是在同一个版本的weblogic上就没有什么问题啊。
    郁闷啊。