把客户端访问EJB的代码修改一下:
Hashtable h = new Hashtable();
h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL,"t3://localhost:7001");
try{
Context initial=new InitialContext(h);
Object object=initial.lookup("jndi的名字");
XXXhome home=(XXXhome)PortableRemoteObject.narrow(object,XXXhome.class);
.....
.....
}catch(Exception e){
e.printStackTrace();
}
Hashtable h = new Hashtable();
h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL,"t3://localhost:7001");
try{
Context initial=new InitialContext(h);
Object object=initial.lookup("jndi的名字");
XXXhome home=(XXXhome)PortableRemoteObject.narrow(object,XXXhome.class);
.....
.....
}catch(Exception e){
e.printStackTrace();
}
解决方案 »
- 使用DOM解析XML命名空间的问题,高手请帮忙!
- 初学struts,出现org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper cannot be cast to com.mysql.jdbc.Connection
- 关于Cglib实现AOP有个大疑惑
- xml汉字导致解析效率超低
- 请问什么是哈希码
- 迫不得已提个很菜的问题
- tomcat的小小问题,
- 大家用过Oracle JDBC驱动调用updateObject吗??
- 为什么找不到class??
- struts2+ ajax跨域访问接返回参数
- 多行表单校验和读取问题,大家请进
- 急:如何实现对JTable的删除行
2004-12-29 10:51:25,578 DEBUG [org.jboss.system.Registry] lookup 1336238651=jboss.j2ee:jndiName=GetData,service=EJB
2004-12-29 10:51:25,578 DEBUG [org.jboss.system.Registry] lookup 1336238651=jboss.j2ee:jndiName=GetData,service=EJB
2004-12-29 10:51:25,593 DEBUG [org.jboss.system.Registry] lookup 1336238651=jboss.j2ee:jndiName=GetData,service=EJB
2004-12-29 10:51:25,593 INFO [STDOUT] ShowOrdersByEmployeesID() error : Employees not bound
2004-12-29 10:51:29,484 DEBUG [org.jboss.system.Registry] lookup 1336238651=jboss.j2ee:jndiName=GetData,service=EJB
2004-12-29 10:51:29,484 DEBUG [org.jboss.system.Registry] lookup 1336238651=jboss.j2ee:jndiName=GetData,service=EJB
2004-12-29 10:51:29,484 DEBUG [org.jboss.system.Registry] lookup 1336238651=jboss.j2ee:jndiName=GetData,service=EJB
2004-12-29 10:51:29,484 INFO [STDOUT] ShowOrdersByEmployeesID() error : Employees not bound
2004-12-29 10:50:12,109 DEBUG [org.jboss.management.j2ee.factory.DefaultManagedObjectFactoryMap] Failed to find factory for event: javax.management.Notification[source=jboss.system:service=ServiceController,type= org.jboss.system.ServiceMBean.create,sequenceNumber=86,timeStamp=1104288612109,message=null,userData=jboss.j2ee:jndiName=local/Employees,service=EJB]
要不大家光从报错信息也不太能看出问题