java.rmi.ServerException: RemoteException occurred in server thread; nested exce
F:\ch07\ejb\jar>runclient -client EmployeeApp.ear -name EmployeeSessionClient 10
6 -textauth
Initiating login ...
Enter Username:sa
Enter Password:
Binding name:`java:comp/env/ejb/EmployeeSession`
-- 初始化ejb home.
-- 成功初始化ejb home接口的引用
-- 执行时间:31 ms.
-- 调用create()方法
-- 成功调用create()方法
-- 执行时间:16 ms.
-- create()方法的返回值:IOR:0000000000000035524d493a636830372e656a622e656e746974
792e456d7 ...
java.rmi.ServerException: RemoteException occurred in server thread; nested exce
ption is:
java.rmi.RemoteException: nested exception is: javax.ejb.EJBException: n
ested exception is: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC]Column index 2 is out of range.; nested exception is:
javax.ejb.EJBException: nested exception is: java.sql.SQLException: [Mic
rosoft][SQLServer 2000 Driver for JDBC]Column index 2 is out of range.
at com.sun.corba.ee.internal.iiop.ShutdownUtilDelegate.mapSystemExceptio
n(ShutdownUtilDelegate.java:64)
at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
at ch07.ejb.entity._EmployeeSession_Stub.getEmpSalary(Unknown Source)
at ch07.ejb.client.EmployeeSessionClient.main(EmployeeSessionClient.java
:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:22
9)
at com.sun.enterprise.appclient.Main.main(Main.java:155)
Caused by: java.rmi.RemoteException: nested exception is: javax.ejb.EJBException
: nested exception is: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver
for JDBC]Column index 2 is out of range.; nested exception is:
javax.ejb.EJBException: nested exception is: java.sql.SQLException: [Mic
rosoft][SQLServer 2000 Driver for JDBC]Column index 2 is out of range.
at com.sun.enterprise.iiop.POAProtocolMgr.mapException(POAProtocolMgr.ja
va:389)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:43
1)
at ch07.ejb.entity.EmployeeSessionBean_EJBObjectImpl.getEmpSalary(Employ
eeSessionBean_EJBObjectImpl.java:27)
at ch07.ejb.entity._EmployeeSessionBean_EJBObjectImpl_Tie._invoke(Unknow
n Source)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(Ge
nericPOAServerSC.java:520)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.internalDispatch(Gen
ericPOAServerSC.java:210)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatch(GenericPOAS
erverSC.java:112)
at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:255)
at com.sun.corba.ee.internal.iiop.RequestProcessor.process(RequestProces
sor.java:84)
at com.sun.corba.ee.internal.orbutil.ThreadPool$PooledThread.run(ThreadP
ool.java:99)
Caused by: javax.ejb.EJBException: nested exception is: java.sql.SQLException: [
Microsoft][SQLServer 2000 Driver for JDBC]Column index 2 is out of range.
at com.sun.ejb.EJBUtils.throwEJBException(EJBUtils.java:48)
at com.sun.ejb.persistence.PersistenceManagerImpl.loadRow(PersistenceMan
agerImpl.java:252)
at com.sun.ejb.persistence.PartitionImpl.getOrLoadPersistentState(Partit
ionImpl.java:398)
at com.sun.ejb.persistence.PartitionImpl.ejbLoad(PartitionImpl.java:532)
at ch07.ejb.entity.EmployeeBean_PM.ejbLoad(EmployeeBean_PM.java:158)
at com.sun.ejb.containers.EntityContainer.callEJBLoad(EntityContainer.ja
va:1632)
at com.sun.ejb.containers.EntityContainer.afterBegin(EntityContainer.jav
a:848)
at com.sun.ejb.containers.BaseContainer.startNewTx(BaseContainer.java:11
19)
at com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:1
030)
at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:375
)
at ch07.ejb.entity.EmployeeBean_PM_EJBLocalObjectImpl.getSalary(Employee
Bean_PM_EJBLocalObjectImpl.java:127)
at ch07.ejb.entity.EmployeeSessionBean.getEmpSalary(EmployeeSessionBean.
java:40)
at ch07.ejb.entity.EmployeeSessionBean_EJBObjectImpl.getEmpSalary(Employ
eeSessionBean_EJBObjectImpl.java:23)
... 7 more
不知道是什么原因?
我另外写了一个程序能连通sqlserver2000
请高手帮忙!!!