1 Reply Latest reply: Jun 28, 2012 6:04 AM by gimbal2 RSS

    ComplianceException: Home methods are not allowed on session beans

    946357
      Getting ComplianceException we try to deploy the EJB2.0 in Weblogic 10.3 application server. Exception is not thrown when we remove getEJBMetaData(), getHomeHandle(), remove(Object p0), remove(Handle p0) from the home interface.

      Same code works in Weblogic 8.1

      weblogic.ejb.container.compliance.ComplianceException: Home methods are not allowed on session beans: service.endorsement.EndorsementServiceBean.getEJBMetaData()
           at weblogic.ejb.container.compliance.SessionHomeInterfaceChecker.checkNoHomeMethods(SessionHomeInterfaceChecker.java:132)
           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:597)
           at weblogic.ejb.container.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:331)
           at weblogic.ejb.container.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBComplianceChecker.java:280)
           at weblogic.ejb.container.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:789)
           at weblogic.ejb.container.ejbc.EJBCompiler.doCompile(EJBCompiler.java:222)
           at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:461)
           at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:428)
           at weblogic.ejb.container.deployer.EJBDeployer.runEJBC(EJBDeployer.java:437)
           at weblogic.ejb.container.deployer.EJBDeployer.compileJar(EJBDeployer.java:795)
           at weblogic.ejb.container.deployer.EJBDeployer.compileIfNecessary(EJBDeployer.java:683)
           at weblogic.ejb.container.deployer.EJBDeployer.prepare(EJBDeployer.java:1254)
           at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:442)
           at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
           at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:517)
           at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
           at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:159)
           at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:45)
           at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:613)
           at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
           at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:184)
           at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:43)
           at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
           at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
           at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:207)
           at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
           at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
           at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
           at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
           at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
           at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
           at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
           at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
           at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
           at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
           at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
           at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)


           at weblogic.ejb.container.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:321)
           at weblogic.ejb.container.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBComplianceChecker.java:280)
           at weblogic.ejb.container.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:789)
           at weblogic.ejb.container.ejbc.EJBCompiler.doCompile(EJBCompiler.java:222)
           at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:461)
           Truncated. see log file for complete stacktrace
      >

      Home Interface:

      public interface EndorsementServiceHome extends EJBHome
      {
      public EndorsementService create()
      throws CreateException, RemoteException;
      /**
      * @exception java.rmi.RemoteException
      * @return EJBMetaData
      */
      public EJBMetaData getEJBMetaData()
      throws RemoteException;

      /**
      * @exception java.rmi.RemoteException
      * @return
      */
      public HomeHandle getHomeHandle()
      throws RemoteException;
      /**
      * @param Object
      * @exception java.rmi.RemoteException
      * @exception RemoveException
      */
      public void remove(Object p0)
      throws RemoteException, RemoveException;

      /**
      * @param Handle
      * @exception java.rmi.RemoteException
      * @exception RemoveException
      */
      public void remove(Handle p0)
      throws RemoteException, RemoveException;
      }

      SessionBean:
      public class EndorsementServiceBean extends CommandInvokerImpl
      implements SessionBean
      {
      private SessionContext ctx;

      public EndorsementServiceBean()
      {
      super("com.thehartford.pnc.service.endorsement.command");
      }



      /**
      * @param SessionContext
      */
      public void setSessionContext(SessionContext aCtx)
      {
      ctx = aCtx;
      }

      /**
      * This method is invoked when a client invokes the matching create()
      * on the home interface.
      */
      public void ejbCreate()
      {
      }
      public void ejbActivate()
      {
      }

      public void ejbPassivate()
      {
      }

      public void ejbRemove()
      {
      }