EJB查询语言问题,在线等待............
我有这样一个EJB:
组件接口:Bank
实现类:BankBean
主接口:BankHome
我添加了这样一个查询表中所有内容的方法:
public Collection findAllCustomer() throws FinderException;
在EJB Designer中的该方法的设置窗口中的Query下加上了下面的EJB QL:
select object(o) from Bank as o
结果,编译是通过了,也发布了,可是在调用该方法的时候出现了下面的错误:
-- Calling loadCustomerInfo()
-- Failed: loadCustomerInfo()
javax.ejb.EJBException: Attempt to pass a reference to an EJBLocalObject to a remote client. A local EJB component may only be accessed by clients co-located in the same ear or standalone jar file.
at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)
at mybank.TestBank_k7j0gk_EOImpl_811_WLStub.loadCustomerInfo(Unknown Source)
at mybank.TestBankTestClient.loadCustomerInfo(TestBankTestClient.java:270)
at mybank.TestBankTestClient.main(TestBankTestClient.java:333)
Caused by: javax.ejb.EJBException: Attempt to pass a reference to an EJBLocalObject to a remote client. A local EJB component may only be accessed by clients co-located in the same ear or standalone jar file.
at mybank.Bank_5niz5k_ELOImpl.writeObject(Bank_5niz5k_ELOImpl.java:856)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
请问是什么原因,怎么解决????????
还有,我以同样的方法加其它字段的find方法,然后再加上相应的EJB QL语句,如:
select object(b) from Bank as b where b.fieldname=?1
在调用时,也是出现相同的错误