X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2Fjava%2Forg%2Fmxchange%2Fjjobs%2Fbeans%2Fphone%2FJobsPhoneWebApplicationBean.java;h=3d14b2894382c5df1e74f4658f3830f12667d759;hb=1e6ec3c65513cfc5a753363c5464c797d9b3b9ae;hp=7c43385594f1b9579b1c70f3121b6bdd08bc5452;hpb=153bb750b1f1eff5041b2accadef81fab048e7e3;p=jjobs-war.git diff --git a/src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebApplicationBean.java b/src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebApplicationBean.java index 7c433855..3d14b289 100644 --- a/src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebApplicationBean.java +++ b/src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebApplicationBean.java @@ -85,17 +85,8 @@ public class JobsPhoneWebApplicationBean extends BaseJobsController implements J * Default constructor */ public JobsPhoneWebApplicationBean () { - // Try it - try { - // Get initial context - Context context = new InitialContext(); - - // Try to lookup the beans - this.phoneBean = (PhoneSessionBeanRemote) context.lookup("java:global/jjobs-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N - } catch (final NamingException e) { - // Throw it again - throw new FaceletException(e); - } + // Call super constructor + super(); // Init all lists this.mobileNumbers = new LinkedList<>(); @@ -450,6 +441,18 @@ public class JobsPhoneWebApplicationBean extends BaseJobsController implements J */ @PostConstruct public void init () { + // Try it + try { + // Get initial context + Context context = new InitialContext(); + + // Try to lookup the beans + this.phoneBean = (PhoneSessionBeanRemote) context.lookup("java:global/jjobs-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N + } catch (final NamingException e) { + // Throw it again + throw new FaceletException(e); + } + // All phone numbers this.allMobileNumbers().addAll(this.phoneBean.allMobileNumbers()); this.allFaxNumbers().addAll(this.phoneBean.allFaxNumbers());