下面是我的代码
Properties localProperties = new Properties();
localProperties.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
localProperties.setProperty("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
localProperties.setProperty("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
localProperties.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");
localProperties.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
InitialContext localInitialContext = new InitialContext(localProperties);
SanityAutomationAvailabilityMain localSanityAutomationAvailabilityMain = (SanityAutomationAvailabilityMain)localInitialContext.lookup("ejb/com/cw/wad/sanity/ejb/session/interfaces/SanityAutomationAvailabilityMain");
我用上面的代码得到了一个classcastexception。关于我可能做错了什么的任何想法?谢谢。