0
下面是我的代碼EJB 2.1 ClassCastException異常
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。任何想法,我可能做錯了什麼?謝謝。
將**完整堆棧跟蹤**添加到您的問題。 –
什麼是InitialContext?你對我們有什麼期望? –