]> git.mxchange.org Git - addressbook-war.git/commitdiff
Remote bean again ... :-(
authorRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 15:00:45 +0000 (17:00 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 15:00:45 +0000 (17:00 +0200)
src/java/org/mxchange/addressbook/beans/country/CountryWebBean.java
src/java/org/mxchange/jcountry/data/CountryConverter.java

index 553876263a5c57042f9dc73c0049d47be6b9003f..b8dc6c5102a5f8f7e68fd0de7c9e814659af6954 100644 (file)
@@ -25,7 +25,7 @@ import javax.inject.Named;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
-import org.mxchange.jcountry.data.AddressbookCountrySingletonBeanLocal;
+import org.mxchange.jcountry.data.AddressbookCountrySingletonBeanRemote;
 import org.mxchange.jcountry.data.Country;
 
 /**
@@ -45,7 +45,7 @@ public class CountryWebBean implements CountryWebController {
        /**
         * Remote country EJB
         */
-       private final AddressbookCountrySingletonBeanLocal countryBean;
+       private final AddressbookCountrySingletonBeanRemote countryBean;
 
        /**
         * List of all countries
@@ -62,7 +62,7 @@ public class CountryWebBean implements CountryWebController {
                        Context context = new InitialContext();
 
                        // Try to lookup the bean
-                       this.countryBean = (AddressbookCountrySingletonBeanLocal) context.lookup("ejb/addressbook-singleton-country"); //NOI18N
+                       this.countryBean = (AddressbookCountrySingletonBeanRemote) context.lookup("java:global/addressbook-ejb/country!org.mxchange.jcountry.data.AddressbookCountrySingletonBeanLocal"); //NOI18N
                } catch (final NamingException ex) {
                        // Continue to throw
                        throw new FaceletException(ex);
index e54de4956ef23ba6be7b6e5df9711ea4384b6470..139bff04de48c4f6cb205f7912735d9981a2ac1f 100644 (file)
@@ -53,24 +53,6 @@ public class CountryConverter implements Converter {
        @Log
        private LoggerBeanLocal loggerBeanLocal;
 
-       /**
-        * Initialization of this converter
-        */
-       @PostConstruct
-       public void init () {
-               // Try to get it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Lookup logger
-                       this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
-               } catch (final NamingException ex) {
-                       // Continue to throw it
-                       throw new RuntimeException("context.lookup() failed.", ex); //NOI18N
-               }
-       }
-
        @Override
        public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Trace message
@@ -135,4 +117,21 @@ public class CountryConverter implements Converter {
                return String.valueOf(((Country) value).getCountryId());
        }
 
+       /**
+        * Initialization of this converter
+        */
+       @PostConstruct
+       public void init () {
+               // Try to get it
+               try {
+                       // Get initial context
+                       Context context = new InitialContext();
+
+                       // Lookup logger
+                       this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
+               } catch (final NamingException ex) {
+                       // Continue to throw it
+                       throw new RuntimeException("context.lookup() failed.", ex); //NOI18N
+               }
+       }
 }