a.编译部署EJB成功<c:\bea\user_projects\mydomain\myserver\upload下>
b.然后在SampleBean.java中的自定义方法<test>的第二行设置了断点,Debug Project图标,并选择server,启动weblogic,服务器启动起来,错误提示如下:
<2003-5-7 下午02时27分28秒> <Error> <Deployer> <149231> <The slave deployer was unable to set the activation state to true for the application _appsdir_DebugEJB_jarweblogic.management.ApplicationException: activate failed forDebugEJB
{
Module Name: DebugEJB, Error: Exception activating module: EJBModule(DebugEJB,status=PREPARED)
Unable to deploy EJB: Sample from DebugEJB.jar:Unable to bind EJB Home Interface to the JNDI name: Sample. The error was:
javax.naming.NameAlreadyBoundException: Failed to bind remote object (ClusterableRemoteRef(192.168.0.31 null)/275 [debugejb.SampleHome+javax.ejb.EJBHome+weblogic.ejb20.interfaces.RemoteHome]) to replica aware stub at Sample(ClusterableRemoteRef(192.168.0.31 [192.168.0.31/273])/273 [debugejb.SampleHome+javax.ejb.EJBHome+weblogic.ejb20.interfaces.RemoteHome]); remaining name ''
 TargetException: Unable to deploy EJB: Sample from DebugEJB.jar:Unable to bind EJB Home Interface to the JNDI name: Sample. The error was:
javax.naming.NameAlreadyBoundException: Failed to bind remote object (ClusterableRemoteRef(192.168.0.31 null)/275 [debugejb.SampleHome+javax.ejb.EJBHome+weblogic.ejb20.interfaces.RemoteHome]) to replica aware stub at Sample(ClusterableRemoteRef(192.168.0.31 [192.168.0.31/273])/273 [debugejb.SampleHome+javax.ejb.EJBHome+weblogic.ejb20.interfaces.RemoteHome]); remaining name ''
} at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:1093) at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:1022) at weblogic.management.deploy.slave.SlaveDeployer.setActivationStateForAllApplications(SlaveDeployer.java:617) at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.java:376) at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resume(DeploymentManagerServerLifeCycleImpl.java:235) at weblogic.t3.srvr.ServerLifeCycleList.resume(ServerLifeCycleList.java:65) at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:832) at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:300) at weblogic.Server.main(Server.java:32)> <2003-5-7 下午02时27分32秒> <Notice> <Management> <141052> <Application Poller started for development server.> <2003-5-7 下午02时27分56秒> <Notice> <WebLogicServer> <000354> <Thread "SSLListenThread.Default" listening on port 7002> <2003-5-7 下午02时27分56秒> <Notice> <WebLogicServer> <000354> <Thread "ListenThread.Default" listening on port 7001> <2003-5-7 下午02时27分56秒> <Notice> <WebLogicServer> <000331> <Started WebLogic Admin Server "myserver" for domain "mydomain" running in Development Mode> <2003-5-7 下午02时28分02秒> <Notice> <WebLogicServer> <000365> <Server state changed to RUNNING> <2003-5-7 下午02时28分02秒> <Notice> <WebLogicServer> <000360> <Server started in RUNNING mode> 
c.我运行测试程序,错误提示如下:
-- Initializing bean access.-- Succeeded initializing bean access through Home interface.-- Execution time: 37975 ms.-- Calling create()-- Succeeded: create()-- Execution time: 811 ms.-- Return value from create(): [email protected] Calling test()weblogic.rjvm.PeerGoneException: No message was received for: '240' seconds at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:109) at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:263) at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:230)-- Failed: test() at debugejb.SampleBean_u71eeu_EOImpl_WLStub.test(Unknown Source) at debugejb.SampleTestClient1.test(SampleTestClient1.java:121) at debugejb.SampleTestClient1.main(SampleTestClient1.java:162)-- Return value from test(): .The return value from EJB is 各位大哥麻烦帮看看究竟是那个环节出了问题.....多谢了.....

解决方案 »

  1.   

    Simple这个JNDI名称已经被绑定了,你为你的EJB换个JNDI名称.
      

  2.   

    看你什么应用服务器了,weblogic使用的是weblogic.xml,jboss使用的是jboss.xml,如果使用的是jbuilder,选中你的EJB,右键选择DD Editor可以通过界面设置
      

  3.   

    JB中双击EJB即可
    右边就可以修改JNDI Name
      

  4.   

    你到web.xml和weblogic.xml中去找找你的jndi存在不存在
      

  5.   

    在META-INF文件夹里找找,weblogic-ejb-jar.xml文件,里面有个jndi名字的东西
    换个名字,顺便把客户端程序里的名字也改成一样的,比如都改成SimpleHome
    Object ref = context.lookup("SampleHome");
      

  6.   

    谢谢各位,,顺便问一个,每次编译的时侯出现如下提示:
    "example.ejbgrpx": Spaces in the temporary directory path may cause WebLogic EJBC utility to produce fatal compile errors.我的环境变量的tmp,temp,还有工程路径中都没有空格的.....
    好!!!结帖去了.....