java.rmi.ServerException: RemoteException occurred in server thread; nested exce

fionna 2004-07-13 10:40:31
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
请高手帮忙!!!
...全文
518 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
rosen 2004-07-13
  • 打赏
  • 举报
回复
嗯,结果集越界。

看看你的循环
hq1305018 2004-07-13
  • 打赏
  • 举报
回复
Column index 2 is out of range
SQL语句问题,是不是取了第2列,但结果集里没有第2列。
fionna 2004-07-13
  • 打赏
  • 举报
回复
怎么没人回复啊!急ing

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧