为什么我的实体bean发布总失败啊!高分求救!

dennis03 2004-10-23 01:38:22
俺跟着吴其庆编写的<<J2EE编程思想与实践>>学习实体bean,生成jar和ear都没有问题,在weblogic7上布署ear时就报错,而布署书中示例ear就正常发布使用,晕死我了,对比了源程序和所有xml源文件都相同,就是布署自已编写的EJB就会失败,我用的是JBuilder9,请各位大佬鼎力相助啊!问题解决即结贴!


以下是发布时weblogic的报错提示:

Unable to deploy EJB: C:\bea\weblogic700\samples\server\config\examples\.\examp
esServer\.wlnotdelete\WareHouseBeanPersistancePro1\WareHouseBeanPersistence.jar
from WareHouseBeanPersistence.jar:

weblogic.ejb20.deployer.DeploymentDescriptorException: Unable to load a class s
ecified in your ejb-jar.xml: Class bytes found but defineClass()failed for: 'wa
ehouse.UserTableBean'
at weblogic.ejb20.deployer.MBeanDeploymentInfoImpl.initializeBeanInfos(
BeanDeploymentInfoImpl.java:431)
at weblogic.ejb20.deployer.MBeanDeploymentInfoImpl.<init>(MBeanDeployme
tInfoImpl.java:164)
at weblogic.ejb20.deployer.EJBDeployer.setupBeanInfo(EJBDeployer.java:9
4)
at weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1251)
at weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:235)
at weblogic.j2ee.J2EEApplicationContainer.prepareModule(J2EEApplication
ontainer.java:1446)
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContai
er.java:654)
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContai
er.java:552)
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(Sl
veDeployer.java:1056)
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDe
loyer.java:724)
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHa
dler.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)



TargetException:

Unable to deploy EJB: C:\bea\weblogic700\samples\server\config\examples\.\examp
esServer\.wlnotdelete\WareHouseBeanPersistancePro1\WareHouseBeanPersistence.jar
from WareHouseBeanPersistence.jar:

weblogic.ejb20.deployer.DeploymentDescriptorException: Unable to load a class s
ecified in your ejb-jar.xml: Class bytes found but defineClass()failed for: 'wa
ehouse.UserTableBean'
at weblogic.ejb20.deployer.MBeanDeploymentInfoImpl.initializeBeanInfos(
BeanDeploymentInfoImpl.java:431)
at weblogic.ejb20.deployer.MBeanDeploymentInfoImpl.<init>(MBeanDeployme
tInfoImpl.java:164)
at weblogic.ejb20.deployer.EJBDeployer.setupBeanInfo(EJBDeployer.java:9
4)
at weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1251)
at weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:235)
at weblogic.j2ee.J2EEApplicationContainer.prepareModule(J2EEApplication
ontainer.java:1446)
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContai
er.java:654)
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContai
er.java:552)
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(Sl
veDeployer.java:1056)
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDe
loyer.java:724)
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHa
dler.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)



}
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContai
er.java:661)
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContai
er.java:552)
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(Sl
veDeployer.java:1056)
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDe
loyer.java:724)
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHa
dler.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
>
...全文
65 4 打赏 收藏 举报
写回复
4 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
dennis03 2004-10-26
  • 打赏
  • 举报
回复
问题已解决,JBuilder9在编译bmp时生成的class文件的确有问题,<<J2EE编程思想与实践>>这本书中的例子是用JBuilder8编写的,所以大家还是不要用JBuilder9了,用JBuilderX吧!
同时谢谢orant(仗剑走天涯) 的回复,虽然不能解决问题,但有回复总比没回复强,所以这100分全给你了!
dennis03 2004-10-26
  • 打赏
  • 举报
回复
经过我的不断测试,终于发现问题的所在,用JBuilder9开发了bmp后,编译生成jar文件,用winrar解压后,发现形成ejb的三个主要class文件不能反编译,其它文件大小和内容与随书附例则完全一至,所以问题最终定位在为什么JBuilder9编译的实体bean三个主要class文件为什么坏了,这也是导至weblogic7发布jar或ear最终失败的原因.
于是我尝试解决问题,先将原书<<J2EE编程思想与实践>>中的关于bmp示例用JBuilder9打开,将ejb打包成jar文件,再解压反编译,全部正常,证明原例在JBuilder9中是正常的,将ejb的三个文件的原文件内容粘贴覆盖自已编写的ejb的三个java文件,保存后重编译打包,再解压反编译,三个主class文件依然不能反编译,目前我还没找到问题的原因所在,是JBuilder9的一个bug还是另有其他编译前的隐秘设置我不清楚,希望JBuilder高手们出手帮助,我现在也在解决中,相信这一问题的解决会使一大批从JBuilder开始学习bmp而倒下的人重新站立起来!
orant 2004-10-24
  • 打赏
  • 举报
回复
你可以配置JB9和WB7一起用啊,很方便的。
JB中TOOLS菜单中可以配置服务器的
dennis03 2004-10-24
  • 打赏
  • 举报
回复
我发现JBuilder9根本就不能编实体bean,我改用JBuilderX后就可以正常编实体bean,并将ear文件正常在weblogic7中布署,可是客户端程序又报告下面错误,我现在觉得JBuilder真是一个鸡肋!

javax.naming.NameNotFoundException: Unable to resolve 'UserTableRemote' Resolved: '' Unresolved:'UserTableRemote' ; remaining name 'UserTableRemote'
at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:109)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:262)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:229)
at weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:338)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:333)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at UserTableClient.main(UserTableClient.java:26)
Exception in thread "main"
相关推荐
发帖
Java

4.9w+

社区成员

Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
帖子事件
创建了帖子
2004-10-23 01:38
社区公告
暂无公告