From: Roland Haeder Date: Mon, 12 Oct 2015 15:00:45 +0000 (+0200) Subject: Remote bean again ... :-( X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e8f867b31de5f606a40c56724002a13ff83db2ec;p=jfinancials-war.git Remote bean again ... :-( --- 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 + } + } }