2 Replies Latest reply on Oct 26, 2012 11:37 AM by aubertinp

    @WebService @Stateless

      Hi,

      I have a little question for you:

       

      When I create a stateless EJB, Jboss deploy it correctly like this:

      @Stateless
      public class ParameterBS implements ParameterBSInterface, Serializable 
      

       

      17:18:25,256 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-8) JNDI bindings for session bean named ParameterBS in deployment unit deployment "Services.jar" are as follows:
      
      
                java:global/Services/ParameterBS!bs.parameter.ParameterBSInterface
                java:app/-Services/ParameterBS!fs.parameter.ParameterBSInterface
                java:module/ParameterBS!bs.parameter.ParameterBSInterface
                java:global/ervices/ParameterBS
                java:app/Services/ParameterBS
                java:module/ParameterBS
      

       

       

       

      But when I decide to expose the EJB as a web service with @WebService, the web service is exposed but not the EJB anymore:

      @Stateless
      @WebService
      public class ParameterBS implements ParameterBSInterface, Serializable 
      

       

       

       

      16:51:20,089 INFO  [org.jboss.weld.deployer] (MSC service thread 1-7) JBAS016005: Starting Services for CDI deployment:Services.jar
      16:51:20,125 INFO  [org.jboss.wsf.stack.cxf.metadata.MetadataBuilder] (MSC service thread 1-7) Add Service
       id=ParameterBS
       address=http://localhost:8080/Services/ParameterBS
       implementor=bs.parameter.ParameterBS
       invoker=org.jboss.wsf.stack.cxf.JBossWSInvoker
       serviceName={http://parameter.bs/}ParameterBSService
       portName={http://parameter.bs/}ParameterBSPort
       wsdlLocation=null
       mtomEnabled=false
       properties=[org.jboss.as.webservices.metadata.modelEjbComponentViewName -> service jboss.deployment.unit."Services.jar".component.ParameterBS.VIEW."bs.parameter.ParameterBS".SERVICE_ENDPOINT]
      

       

       

      My question is: Why JBoss cannot deploy the WebService and the EJB at the same time?

      Thanks by advance for any help,

       

      Philippe

        • 1. Re: @WebService @Stateless
          jaikiran

          In the first case, you are deploying a SLSB which will have an default implicit no-interface view since it doesn't expose any other business views. Now when you add a @WebService to it, it now explicitly exposes the webservice view which disqualifies it from exposing the default implicit view. If you want the no-interface view too along with the webservice view, then just add a @javax.ejb.LocalBean annotation to that class.

          • 2. Re: @WebService @Stateless

            Oh I see, the default behaviour is overrided by @WebService. Thank you !