4 Replies Latest reply on Dec 3, 2012 9:14 AM by jaikiran pai

    Using Remote & Local Interfaces in EJB Module on Jboss 7.1

    shaikh dahood Newbie

      Hi Guys,

       

      I have an enterprise application that uses EJB 3.0.

      In one of my Interfaces when i use both Remote and Local interfaces i get error, Below is my interface code,

       

       

      import javax.ejb.Local;

      import javax.ejb.Remote;

       

      @Remote

      @Local

      public interface ApplicationAdminSession  {

       

      }

       

      now when i deploy the app on jboss server i get the below error in console

       

       

                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_14]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_14]

                at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_14]

      Caused by: java.lang.IllegalStateException: JBAS014352: [EJB 3.1 spec, section 4.9.7] - Can't add view class: com.mycompany.common.ejb.ApplicationAdminSession as local view since it's already marked as remote view for bean: ApplicationAdminSessionBean

                at org.jboss.as.ejb3.component.session.SessionBeanComponentDescription.assertNoRemoteView(SessionBeanComponentDescription.java:191)

                at org.jboss.as.ejb3.component.session.SessionBeanComponentDescription.addLocalBusinessInterfaceViews(SessionBeanComponentDescription.java:145)

                at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.processViewAnnotations(BusinessViewAnnotationProcessor.java:131)

                at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.deploy(BusinessViewAnnotationProcessor.java:98)

                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

                ... 5 more

       

      The app works fine when i comment any one of them e.g

      import javax.ejb.Local;

      import javax.ejb.Remote;

       

      @Remote

      //@Local

      public interface ApplicationAdminSession  {

       

      }

       

      Can anyone please help me in this ,as i am new in EJB and not able to find why this error comes up.