1 Reply Latest reply on Apr 2, 2006 9:14 PM by Nick Hynes

    Session EJB with Local Interface Problem.

    Michael Anderson Newbie

      I just can not get this going, I get this error on deploy.

      The methods defined in the local interface must have a matching method in the bean's class with the same name and same number and types of arguments.

      jboss.xml

      <enterprise-beans>

      <ejb-name>LicenseAPIBean</ejb-name>
      <jndi-name>LicenseAPI</jndi-name>
      <local-jndi-name>LocalLicenseAPI</local-jndi-name>

      </enterprise-beans>


      ejb-jar.xml (snippet)

      <![CDATA[]]>

      <ejb-name>LicenseAPIBean</ejb-name>

      <local-home>com.websidestory.services.licenseapi.LocalLicenseAPIHome</local-home>
      com.websidestory.services.licenseapi.LocalLicenseAPI
      <ejb-class>com.websidestory.services.licenseapi.LicenseAPIBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>

      <security-role-ref>
      <role-name>licenseapi</role-name>
      <role-link>licenseapi</role-link>
      </security-role-ref>



      LocalLicenseAPI
      package com.websidestory.services.licenseapi;
      public interface LocalLicenseAPI
      extends javax.ejb.EJBLocalObject
      {
      public com.websidestory.services.licenseapi.EchoResponse echo( com.websidestory.services.licenseapi.Echo message ) throws com.we
      bsidestory.services.licenseapi.InternalErrorFault, com.websidestory.services.licenseapi.AuthenticationFault;
      }

      LocalLicenseAPIHome
      package com.websidestory.services.licenseapi;

      /**
      * Local home interface for LicenseAPIBean.
      */
      public interface LocalLicenseAPIHome
      extends javax.ejb.EJBLocalHome
      {
      public static final String COMP_NAME="java:comp/env/ejb/LicenseAPIBeanLocal";
      public static final String JNDI_NAME="LicenseAPIBeanLocal";

      public com.websidestory.services.licenseapi.LocalLicenseAPI create()
      throws javax.ejb.CreateException;

      }

      LicenseAPIBean (snippet)
      package com.websidestory.services.licenseapi;

      import javax.ejb.*;
      import java.util.*;
      import java.io.*;
      import java.security.*;

      /**
      * @ejb.bean name="LicenseAPIBean" view-type="local" jndi-name="LicenseAPI"
      * @ejb.home
      * local-class="com.websidestory.services.licenseapi.LocalLicenseAPIHome"
      * @ejb.interface
      * service-endpoint-class="com.websidestory.services.licenseapi.LicenseAPISoap"
      * local-class="com.websidestory.services.licenseapi.LocalLicenseAPI"
      * @ejb.security-role-ref role-name="licenseapi" role-link="licenseapi"
      * @wsee.port-component name="LicenseAPISoap" local-part="LicenseAPI"
      * display-name="LicenseAPI"
      * description="Session Bean exposed as a webservice"
      */
      public class LicenseAPIBean implements SessionBean
      {
      ...
      /**
      * @ejb.interface-method view-type="local"
      **/
      public EchoResponse echo(Echo message) throws InternalErrorFault, AuthenticationFault
      {
      System.out.println("LicenseAPI/echo invoked");
      Map params = getStandardParams();
      EchoHandler handler = new EchoHandler();
      handler.init(params);
      logUsage("echo", (String)params.get("API_KEY"), (String)params.get("ACCOUNT"));
      return handler.handleRequest(message);
      }

      The signatures match, am I misconfigured in my deployment?

        • 1. Re: Session EJB with Local Interface Problem.
          Nick Hynes Newbie

           

          "manderson" wrote:
          The methods defined in the local interface must have a matching method in the bean's class with the same name and same number and types of arguments.


          I hoped you resolved this problem.

          For anyone else who sees this error: it is telling you that one of your Local or Remote interfaces is out of synch with your Bean class.

          The most common reasons for this are:
          You've changed a method signature on an EJB and forgotten to update your remote interface (or forgotten to run XDoclet, if you use that).
          You've update the remote/local interface but haven't built it or update the jar file you deploy it in
          You've update the jar file and deployed it but have another (older) copy of the class files in another jar.