当前位置: 技术问答>java相关
websphere的client问题?最多的分了..多谢..
来源: 互联网 发布时间:2015-01-17
本文导语: 想知道, 1. com.ibm.ejs.ns.jndi.CNInitialContextFactory 2. iiop://localhost:9019 这个端口9019对吗? 还是别的什么原因让我出错, 我已经将我的Entity Bean成功地deploy到websphere3.5上,and it is running.. 多谢了... package record; import jav...
想知道,
1. com.ibm.ejs.ns.jndi.CNInitialContextFactory
2. iiop://localhost:9019
这个端口9019对吗?
还是别的什么原因让我出错,
我已经将我的Entity Bean成功地deploy到websphere3.5上,and it is running..
多谢了...
package record;
import java.sql.Date;
import java.util.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
public class RecordClient {
public static void main(String[] args) {
try {
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
h.put(Context.PROVIDER_URL,"iiop://localhost:9019");
Context initial = new InitialContext(h);
Object objref = initial.lookup("Record");
RecordHome home = (RecordHome)PortableRemoteObject.
narrow(objref, RecordHome.class);
if(args.length > 0 && args[0].equals("-c")) {
for(int i = 0; i java record.RecordClient -c
Caught an exception.
javax.naming.NamingException: Error during resolve. Root exception is
java.lang .NullPointerException
at com.ibm.ejs.ns.jndi.CNContextImpl.doLookup(CNContextImpl.java:726)
at com.ibm.ejs.ns.jndi.CNContextImpl.lookup(CNContextImpl.java:584)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at record.RecordClient.main(RecordClient.java:18)
1. com.ibm.ejs.ns.jndi.CNInitialContextFactory
2. iiop://localhost:9019
这个端口9019对吗?
还是别的什么原因让我出错,
我已经将我的Entity Bean成功地deploy到websphere3.5上,and it is running..
多谢了...
package record;
import java.sql.Date;
import java.util.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
public class RecordClient {
public static void main(String[] args) {
try {
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
h.put(Context.PROVIDER_URL,"iiop://localhost:9019");
Context initial = new InitialContext(h);
Object objref = initial.lookup("Record");
RecordHome home = (RecordHome)PortableRemoteObject.
narrow(objref, RecordHome.class);
if(args.length > 0 && args[0].equals("-c")) {
for(int i = 0; i java record.RecordClient -c
Caught an exception.
javax.naming.NamingException: Error during resolve. Root exception is
java.lang .NullPointerException
at com.ibm.ejs.ns.jndi.CNContextImpl.doLookup(CNContextImpl.java:726)
at com.ibm.ejs.ns.jndi.CNContextImpl.lookup(CNContextImpl.java:584)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at record.RecordClient.main(RecordClient.java:18)
|
请将Jar文件,与源代码发给我,
hicharlie@sina.com
hicharlie@sina.com
|
关注,我也是PB程序员,现在也准备转行了:)
|
for(int i = 0; i