EJB 常见错误

Exception1:

Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
 at $Proxy0.createCustomer(Unknown Source)
 at com.lyh.ejb3.clients.Client.main(Client.java:38)
Caused by: java.rmi.MarshalException: Failed to communicate.  Problem during marshalling/unmarshalling; nested exception is:
 java.io.NotSerializableException: com.lyh.ejb3.domain.Customer
 at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:306)
 at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
 at org.jboss.remoting.Client.invoke(Client.java:525)
 at org.jboss.remoting.Client.invoke(Client.java:488)
 at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:41)
 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
 at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:46)
 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
 at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:40)
 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
 at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:77)
 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
 at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
 ... 2 more
Caused by: java.io.NotSerializableException: com.lyh.ejb3.domain.Customer
 at java.io.ObjectOutputStream.writeObject0(Unknown Source)
 at java.io.ObjectOutputStream.writeArray(Unknown Source)
 at java.io.ObjectOutputStream.writeObject0(Unknown Source)
 at java.io.ObjectOutputStream.writeObject(Unknown Source)
 at java.rmi.MarshalledObject.<init>(Unknown Source)
 at org.jboss.aop.joinpoint.MethodInvocation.writeExternal(MethodInvocation.java:261)
 at java.io.ObjectOutputStream.writeExternalData(Unknown Source)
 at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
 at java.io.ObjectOutputStream.writeObject0(Unknown Source)
 at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
 at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
 at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
 at java.io.ObjectOutputStream.writeObject0(Unknown Source)
 at java.io.ObjectOutputStream.writeObject(Unknown Source)
 at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.sendObject(JavaSerializationManager.java:81)
 at org.jboss.remoting.marshal.serializable.SerializableMarshaller.write(SerializableMarshaller.java:84)
 at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:273)
 ... 14 more

Solution:Pojo类实现序列号借口!

 

Exception2:

     [java] Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named titan
     [java] at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
     [java] at com.titan.clients.StandaloneClient.main(StandaloneClient.java:20)
     [java] Java Result: 1


persistence.xml不在classpath中, 修改ant build.xml就可。


Exception3:

Null value was assigned to a property of primitive type setter of 


Solution: This exception is happen when using table per concrete class. When the table data read from DB, it can't initialize instance since some instance is primitive datatype and not allowed null.  To solve it, use wrapper type in the class definition.


 Excepiton 4:

2012-04-11 17:05:20,125 ERROR [org.jboss.deployment.MainDeployer] Could not initialise deployment: file:/C:/AE91/jboss-4.2.3.GA/server/default/deploy/titan.jar
org.jboss.deployment.DeploymentException: Failed to find META-INF/jboss-service.xml for archive titan-mbeans.sar
at org.jboss.deployment.SARDeployer.parseDocument(SARDeployer.java:618)
at org.jboss.deployment.SARDeployer.init(SARDeployer.java:181)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:872)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:895)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:809)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)


Solutions:

 oms-service.xml给的路径不多或者文件名有错。 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值