Bean查找错误

时间:2016-06-29 06:05:21

标签: java jboss tomcat6

以下代码在JBoss中运行良好,但在Apache Tomcat中部署时,它提供了

  

javax.naming.NameNotFoundException:名称[SPConnectorClient]未绑定在此Context中。无法找到[SPConnectorClient]。

代码:

logger.info("SPConnectorClientEJB::callSubmitRequest");
        SPResponse response = new SPResponse();
        Object responseObj = null;
        try
        {
          InitialContext ctx = null;

          ctx = new InitialContext();
          logger.info("Got InitialContext");

          SPConnectorClientHome home = (SPConnectorClientHome)ctx.lookup("SPConnectorClient");

          SPConnectorClientRemote remote = null;
          remote = home.create();
          logger.info("Got Remote Object!");

Setenv.sh文件中的代码:

JAVA_OPTS="$JAVA_OPTS -DSPAppspecificJNDI=java:global/SP/sp_app_specific/SPConnectorClient!com.cdac.sp.SPConnectorClientRemote"

0 个答案:

没有答案