0 Replies Latest reply on Jan 31, 2015 10:25 AM by cricri691

    Error when i  call a EJB session with Widfly 8.2 ... Who can helpe me

    cricri691

      My  EJB

      package conversion;

      import javax.ejb.Stateless;

       

      /**

      * Session Bean implementation class SessionConversion

      * */

       

      @Stateless(name="BeanConversion")

      public class SessionConversion implements SessionConversionRemote {

       

          /**

           * Default constructor.

           */

          public SessionConversion() {

              // TODO Auto-generated constructor stub

          }

         

          public  double donneCelciustoFahrenheit (double t)

          {

            double fahrenheit;

              fahrenheit  = 9.0 / 5.0 * t + 32;

              return fahrenheit;

          }

       

        public double donneFahrenheittoCelcius ( double t)

          {

            double celcius;

              celcius = (t - 32 ) * 5.0 / 9.0 ;

              return celcius;

          }

      }

       

      package conversion;

       

      import javax.ejb.Remote;

       

      @Remote

      public interface SessionConversionRemote {

          public  double donneCelciustoFahrenheit (double t);

          // conversion de Celcius vers Fahrenheit

          public double donneFahrenheittoCelcius (double t);

           // conversion de Fahrenheit vers Celcius

      }

       

      My log server

              /*java:global/EJBAppTemperature/BeanConversion!conversion.SessionConversionRemote

              java:app/EJBAppTemperature/BeanConversion!conversion.SessionConversionRemote

              java:module/BeanConversion!conversion.SessionConversionRemote

              java:jboss/exported/EJBAppTemperature/BeanConversion!conversion.SessionConversionRemote

              java:global/EJBAppTemperature/BeanConversion

              java:app/EJBAppTemperature/BeanConversion

              java:module/BeanConversion */

       

       

      My client

       

      package presentation;

       

       

      import java.util.Properties;

       

      import javax.ejb.EJB;

      import javax.naming.Context;

      import javax.naming.InitialContext;

      import javax.naming.NamingException;

       

       

       

       

       

       

      import conversion.*;

       

      public class Principale {

       

          @EJB

          private static SessionConversionRemote uneconversion;

          private static  Context context;

         

          public static void createInitialContext() throws NamingException {

              Properties prop = new Properties();

               /* prop.put(Context.INITIAL_CONTEXT_FACTORY,

                          "org.jboss.naming.remote.client.InitialContextFactory");*/

             

              prop.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");

               prop.put(Context.PROVIDER_URL, "http-remoting://127.0.0.1:8080");

               prop.put("jboss.naming.client.ejb.context", true);

              context = new InitialContext(prop);

             

              /*

               Properties prop = new Properties();

                  prop.put(Context.INITIAL_CONTEXT_FACTORY,

                  "org.jboss.naming.remote.client.InitialContextFactory");

                  prop.put(Context.PROVIDER_URL, "http-remoting://127.0.0.1:8080");

                  prop.put(Context.SECURITY_PRINCIPAL, "jmsuser");

                  prop.put(Context.SECURITY_CREDENTIALS, "jmsepul98!");

                  prop.put("jboss.naming.client.ejb.context", true);

                 

                  Context context = new InitialContext(prop);

                  */

             

              /*java:global/EJBAppTemperature/BeanConversion!conversion.SessionConversionRemote

              java:app/EJBAppTemperature/BeanConversion!conversion.SessionConversionRemote

              java:module/BeanConversion!conversion.SessionConversionRemote

              java:jboss/exported/EJBAppTemperature/BeanConversion!conversion.SessionConversionRemote

              java:global/EJBAppTemperature/BeanConversion

              java:app/EJBAppTemperature/BeanConversion

              java:module/BeanConversion */

       

              }

           private static SessionConversionRemote lookupSessionConversionRemote() throws NamingException {

                 

                  // The app name is the application name of the deployed EJBs. This is typically the ear name

                  // without the .ear suffix. However, the application name could be overridden in the application.xml of the

                  // EJB deployment on the server.

                  // Since we haven't deployed the application as a .ear, the app name for us will be an empty string

                  final String appName = "EJBAppTemperature";

                  // This is the module name of the deployed EJBs on the server. This is typically the jar name of the

                  // EJB deployment, without the .jar suffix, but can be overridden via the ejb-jar.xml

                  // In this example, we have deployed the EJBs in a jboss-as-ejb-remote-app.jar, so the module name is

                  // jboss-as-ejb-remote-app

                  final String moduleName = "conversion";

                  // AS7 allows each deployment to have an (optional) distinct name. We haven't specified a distinct name for

                  // our EJB deployment, so this is an empty string

                  final String distinctName = "";

                  // The EJB name which by default is the simple class name of the bean implementation class

                  final String beanName = SessionConversion.class.getSimpleName();

                  // the remote view fully qualified class name

                  final String viewClassName = SessionConversionRemote.class.getName();

                  // let's do the lookup

          

                  return (SessionConversionRemote) context.lookup("ejb:" + appName + "/" + moduleName

                          + "/" + distinctName + "/" + beanName + "!" + viewClassName);

                 

                 }   

          public static void main(String[] args) {

              // TODO Auto-generated method stub

       

              // TODO code application logic here

              System.out.println("je suis passé");

              try {

                  // on appelle l’EJB

       

                  createInitialContext();

              

                  uneconversion = lookupSessionConversionRemote();

                 

               

                  menu();

              } catch (NamingException ne) {

                  System.out.println(ne.getMessage());

              }

          }

       

      I have this error

      EJBCLIENT000025: No EJB receiver available for handling [appName:, moduleName:EJBAppTemperature, distinctName:conversion] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@3532ec19