From e8f867b31de5f606a40c56724002a13ff83db2ec Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 12 Oct 2015 17:00:45 +0200 Subject: [PATCH] Remote bean again ... :-( --- .../beans/country/CountryWebBean.java | 6 ++-- .../jcountry/data/CountryConverter.java | 35 +++++++++---------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/java/org/mxchange/addressbook/beans/country/CountryWebBean.java b/src/java/org/mxchange/addressbook/beans/country/CountryWebBean.java index 55387626..b8dc6c51 100644 --- a/src/java/org/mxchange/addressbook/beans/country/CountryWebBean.java +++ b/src/java/org/mxchange/addressbook/beans/country/CountryWebBean.java @@ -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); diff --git a/src/java/org/mxchange/jcountry/data/CountryConverter.java b/src/java/org/mxchange/jcountry/data/CountryConverter.java index e54de495..139bff04 100644 --- a/src/java/org/mxchange/jcountry/data/CountryConverter.java +++ b/src/java/org/mxchange/jcountry/data/CountryConverter.java @@ -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 + } + } } -- 2.39.5