有没有尝试过以下方法
private static Context getInitialContext() throws Exception {
String url = "localhost:1099";
String user = null;
String password = null;
Properties properties = null;
try {
properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
properties.put(Context.PROVIDER_URL, url);
if (user != null) {
properties.put(Context.SECURITY_PRINCIPAL, user);
properties.put(Context.SECURITY_CREDENTIALS, password == null ? "" : password);
} return new InitialContext(properties);
}
catch(Exception e) {
throw e;
}
}
......
public static void main(String[] args)
{
Context initial = getInitialContext();
private static Context getInitialContext() throws Exception {
String url = "localhost:1099";
String user = null;
String password = null;
Properties properties = null;
try {
properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
properties.put(Context.PROVIDER_URL, url);
if (user != null) {
properties.put(Context.SECURITY_PRINCIPAL, user);
properties.put(Context.SECURITY_CREDENTIALS, password == null ? "" : password);
} return new InitialContext(properties);
}
catch(Exception e) {
throw e;
}
}
......
public static void main(String[] args)
{
Context initial = getInitialContext();
BMP已经得到数据的情况之下,通过Remote interface 去获取数据总是放回null
thank you very much!
the code that you give me only is to gain the remote interface. in fact,i have get the remote interface and call the remote interface bussiness function successfully.
贴出下载地址也可以
http://www.cjsdn.com/post/view?bid=2&id=53912&sty=1&tpg=1&age=0