MM请教前辈!

03-12-23 atwinter
我在部署Entity Bean时没有问题,但测试时发现数据库连不上,我用的是jb9+jboss3.1+mysql.

发生了以下异常;

客户端:

Caught an exception.

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

java.rmi.ServerException: EJBException:; nested exception is:

javax.ejb.EJBException: Unable to connect to database. Could not dereference object

at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)

at sun.rmi.transport.Transport$1.run(Transport.java:148)

at java.security.AccessController.doPrivileged(Native Method)

at sun.rmi.transport.Transport.serviceCall(Transport.java:144)

at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)

at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)

at java.lang.Thread.run(Thread.java:534)

at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)

at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)

at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)

at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)

at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:135)

at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:96)

at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)

at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45)

at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:173)

at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)

at $Proxy0.create(Unknown Source)

at savingsaccount.SavingsAccountClient.main(SavingsAccountClient.java:32)

Caused by: java.rmi.ServerException: EJBException:; nested exception is:

javax.ejb.EJBException: Unable to connect to database. Could not dereference object

at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:347)

at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:124)

at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)

at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:484)

at org.jboss.ejb.Container.invoke(Container.java:720)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)

at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)

at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:362)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)

at sun.rmi.transport.Transport$1.run(Transport.java:148)

at java.security.AccessController.doPrivileged(Native Method)

at sun.rmi.transport.Transport.serviceCall(Transport.java:144)

at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)

at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)

at java.lang.Thread.run(Thread.java:534)

Caused by: javax.ejb.EJBException: Unable to connect to database. Could not dereference object

at savingsaccount.SavingsAccountBean.setEntityContext(SavingsAccountBean.java:161)

at org.jboss.ejb.EntityEnterpriseContext.<init>(EntityEnterpriseContext.java:73)

at org.jboss.ejb.plugins.EntityInstancePool.create(EntityInstancePool.java:52)

at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:146)

at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:79)

at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61)

at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28)

at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:88)

at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)

at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:98)

at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:92)

at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)

服务器端:

22:51:15,662 INFO [STDOUT] Caught an InsufficientBalanceException: 0

22:51:15,662 INFO [STDOUT] Caught an InsufficientBalanceException: 1

22:51:15,672 ERROR [LogInterceptor] EJBException:

javax.ejb.EJBException: Unable to connect to database. Could not dereference obj

ect

at savingsaccount.SavingsAccountBean.setEntityContext(SavingsAccountBean

.java:161)

at org.jboss.ejb.EntityEnterpriseContext.<init>(EntityEnterpriseContext.

java:73)

at org.jboss.ejb.plugins.EntityInstancePool.create(EntityInstancePool.ja

va:52)

at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.j

ava:146)

at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInst

anceInterceptor.java:79)

at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInte

rceptor.java:61)

at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCrea

tionInterceptor.java:28)

at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte

rceptor.java:88)

at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep

torCMT.java:267)

at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.ja

va:98)

at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityIntercep

tor.java:92)

at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:1

20)

at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyF

actoryFinderInterceptor.java:93)

at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java

:484)

at org.jboss.ejb.Container.invoke(Container.java:720)

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 org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea

nDispatcher.java:284)

at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)

at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:

362)

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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)

at sun.rmi.transport.Transport$1.run(Transport.java:148)

at java.security.AccessController.doPrivileged(Native Method)

at sun.rmi.transport.Transport.serviceCall(Transport.java:144)

at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4

60)

at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport

.java:701)

at java.lang.Thread.run(Thread.java:534)

atwinter
2003-12-24 17:53
为啥没有人理我!

jxb8901
2003-12-25 09:15
会不会是你的配置文件有错, 你再仔细查一下吧?

arongzai
2003-12-26 10:49
数据库没有配好

猜你喜欢