EJB 3.1とOracle 12.1 DBのJNDIコンフィグレーション終了に問題があります。 私のコード:EJBコンフィグレーションのJava JNDI
private static NewSessionBeanRemote lookupRemoteSessionBean() throws NamingException {
final Hashtable jndiProperties = new Hashtable();
jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
final Context context = new InitialContext(jndiProperties);
final String appName = "";
final String moduleName = "EjbComponent";
final String distinctName = "";
final String beanName = NewSessionBean.class.getSimpleName();
final String viewClassName = NewSessionBeanRemote.class.getName();
System.out.println("ejb:" + appName + "" + moduleName + "" + distinctName + "/" + beanName + "!" + viewClassName);
return (NewSessionBeanRemote) context.lookup("ejb:" + appName + "" + moduleName + "" + distinctName + "/" + beanName + "!" + viewClassName);
}
ERROR iはJNDIルックアップしようとすると:以外
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:350)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at com.studio.java.client.EjbTester.lookupRemoteSessionBean(EjbTester.java:73)
at com.studio.java.client.EjbTester.invokeStatelessBean(EjbTester.java:51)
at com.studio.java.client.EjbTester.main(EjbTester.java:41)
[NoInitialContextExceptionエラー]の複製があります(http://stackoverflow.com/questions/1525385/noinitialcontextexception-error) – SkyWalker
どのアプリケーションサーバーを使用していますか? – aribeiro