以下代码在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"