]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sun, 3 Sep 2017 02:40:58 +0000 (04:40 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 3 Sep 2017 02:40:58 +0000 (04:40 +0200)
- if you get something about non-serializable injection, strange things happen,
  sometimes it works here, sometimes not ... :-(
- had to go back to programatic JNDI lookup in converters/validators as the JSF
  2.3 version + xsd reference did mess around with faces-config.xml
  auto-complete (NetBeans) and it looks like that context parameters are not
  loaded
- this way, some lookup() calls are not saved (unmanaged by container) but at
  least it works

Signed-off-by: Roland Häder <roland@mxchange.org>
23 files changed:
src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBusinessDataWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsCompanyEmployeeWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/contact/phone/FinancialsContactPhoneWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/country/FinancialsCountryWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperBean.java
src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsMobileProviderWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/phone/FinancialsPhoneWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/activity/FinancialsUserActivityWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/email_address/FinancialsEmailChangeWebRequestBean.java
src/java/org/mxchange/jfinancials/converter/business/basicdata/FinancialsBusinessContactConverter.java
src/java/org/mxchange/jfinancials/converter/business/company_employee/FinancialsCompanyEmployeeConverter.java
src/java/org/mxchange/jfinancials/converter/business/headquarters/FinancialsCompanyHeadquartersConverter.java
src/java/org/mxchange/jfinancials/converter/contact/FinancialsContactConverter.java
src/java/org/mxchange/jfinancials/converter/country/FinancialsCountryConverter.java
src/java/org/mxchange/jfinancials/converter/fax/FinancialsFaxNumberConverter.java
src/java/org/mxchange/jfinancials/converter/landline/FinancialsLandLineNumberConverter.java
src/java/org/mxchange/jfinancials/converter/mobile/FinancialsMobileNumberConverter.java
src/java/org/mxchange/jfinancials/converter/user/FinancialsUserConverter.java
src/java/org/mxchange/jfinancials/validator/business/basicdata/FinancialsCompanyNameValidator.java
src/java/org/mxchange/jfinancials/validator/emailaddress/FinancialsEmailAddressValidator.java
src/java/org/mxchange/jfinancials/validator/user/FinancialsUserIdValidator.java

index b9a26cb7bde2b627f211c44c401885e0c38096e4..d2d581819ee0c2608da40b64f71f511354452d4f 100644 (file)
@@ -60,8 +60,8 @@ public class FinancialsBusinessDataWebRequestBean extends BaseFinancialsControll
         * A list of all registered companies (globally)
         */
        @Inject
-       @NamedCache (cacheName = "basicDataCache", managementEnabled = true)
-       private transient Cache<Long, BusinessBasicData> basicDataCache;
+       @NamedCache (cacheName = "basicDataCache")
+       private Cache<Long, BusinessBasicData> basicDataCache;
 
        /**
         * EJB for general basic business data purposes
index f4ca6008b2e08c8dac335390c6691b14d220974f..edf21434db702bf813e8631db6970dac98029367 100644 (file)
@@ -54,8 +54,8 @@ public class FinancialsCompanyEmployeeWebRequestBean extends BaseFinancialsContr
         * List of all company employees
         */
        @Inject
-       @NamedCache (cacheName = "companyEmployeeCache", managementEnabled = true)
-       private transient Cache<Long, Employee> companyEmployeeCache;
+       @NamedCache (cacheName = "companyEmployeeCache")
+       private Cache<Long, Employee> companyEmployeeCache;
 
        /**
         * Default constructor
index 7443a08ec81ae635af95bd7ecb373fb3f328e61a..7a819789af309b7e0b320b4bf6b47afafd71f685 100644 (file)
@@ -102,8 +102,8 @@ public class FinancialsContactWebRequestBean extends BaseFinancialsController im
         * Contact list
         */
        @Inject
-       @NamedCache (cacheName = "contactsCache", managementEnabled = true)
-       private transient Cache<Long, Contact> contactsCache;
+       @NamedCache (cacheName = "contactsCache")
+       private Cache<Long, Contact> contactsCache;
 
        /**
         * Country instance
@@ -119,8 +119,8 @@ public class FinancialsContactWebRequestBean extends BaseFinancialsController im
         * Email address list
         */
        @Inject
-       @NamedCache (cacheName = "emailAddressCache", managementEnabled = true)
-       private transient Cache<Long, String> emailAddressCache;
+       @NamedCache (cacheName = "emailAddressCache")
+       private Cache<Long, String> emailAddressCache;
 
        /**
         * Email address repeated
index c43241abc4fed619d83887edd143dd2d9648e9ef..912e88c1c7dd05481c7533fe92cb6cced56a00b7 100644 (file)
@@ -69,8 +69,8 @@ public class FinancialsContactPhoneWebRequestBean extends BaseFinancialsControll
         * relationship (one contact, many numbers).
         */
        @Inject
-       @NamedCache (cacheName = "contactsPhoneCache", managementEnabled = true)
-       private transient Cache<DialableNumber, List<Contact>> contactsPhoneCache;
+       @NamedCache (cacheName = "contactsPhoneCache")
+       private Cache<DialableNumber, List<Contact>> contactsPhoneCache;
 
        /**
         * fax number
index 1b99bd270b149f5bbd7a7c82492826661c548ad0..ea8c526500cb301879c241a07781391d03676e3a 100644 (file)
@@ -57,8 +57,8 @@ public class FinancialsCountryWebRequestBean extends BaseFinancialsController im
         * List of all countries
         */
        @Inject
-       @NamedCache (cacheName = "countryCache", managementEnabled = true)
-       private transient Cache<Long, Country> countryCache;
+       @NamedCache (cacheName = "countryCache")
+       private Cache<Long, Country> countryCache;
 
        /**
         * Default constructor
index a1d6a3788eaed84328b012f1cca0370099fc3b41..3586a4bc0594490631dbf81cfe565d77f02ec179 100644 (file)
@@ -29,6 +29,7 @@ import org.mxchange.jfinancials.beans.BaseFinancialsController;
 import org.mxchange.jfinancials.beans.contact.FinancialsAdminContactWebRequestController;
 import org.mxchange.jfinancials.beans.phone.FinancialsAdminPhoneWebRequestController;
 import org.mxchange.jfinancials.beans.user.FinancialsAdminUserWebRequestController;
+import org.mxchange.jfinancials.beans.user.FinancialsUserWebRequestController;
 import org.mxchange.jphone.events.fax.created.CreatedFaxNumberEvent;
 import org.mxchange.jphone.events.fax.created.ObservableCreatedFaxNumberEvent;
 import org.mxchange.jphone.events.landline.created.CreatedLandLineNumberEvent;
@@ -41,7 +42,6 @@ import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jusercore.events.user.created.CreatedUserEvent;
 import org.mxchange.jusercore.events.user.created.ObservableCreatedUserEvent;
 import org.mxchange.jusercore.model.user.User;
-import org.mxchange.jfinancials.beans.user.FinancialsUserWebRequestController;
 
 /**
  * A general helper for beans
index 51aac6d3bf19c28f0f58b39e38610ec628e4ea07..76ab69de06fd61f6c80c894d30546c8c0919b9ac 100644 (file)
@@ -57,8 +57,8 @@ public class FinancialsMobileProviderWebRequestBean extends BaseFinancialsContro
         * "Cached" list of mobile providers
         */
        @Inject
-       @NamedCache (cacheName = "mobileProviderCache", managementEnabled = true)
-       private transient Cache<Long, MobileProvider> mobileProviderCache;
+       @NamedCache (cacheName = "mobileProviderCache")
+       private Cache<Long, MobileProvider> mobileProviderCache;
 
        /**
         * Default constructor
index 2ff45ecd730b4843b39ae9e23af172ea99b84688..b773700e5da6db73ebb320c1e9e5a327efff4720 100644 (file)
@@ -66,22 +66,22 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsController impl
         * All fax numbers
         */
        @Inject
-       @NamedCache (cacheName = "faxNumberCache", managementEnabled = true)
-       private transient Cache<Long, DialableFaxNumber> faxNumberCache;
+       @NamedCache (cacheName = "faxNumberCache")
+       private Cache<Long, DialableFaxNumber> faxNumberCache;
 
        /**
         * All land-line numbers
         */
        @Inject
-       @NamedCache (cacheName = "landLineNumberCache", managementEnabled = true)
-       private transient Cache<Long, DialableLandLineNumber> landLineNumberCache;
+       @NamedCache (cacheName = "landLineNumberCache")
+       private Cache<Long, DialableLandLineNumber> landLineNumberCache;
 
        /**
         * All mobile numbers
         */
        @Inject
-       @NamedCache (cacheName = "mobileNumberCache", managementEnabled = true)
-       private transient Cache<Long, DialableMobileNumber> mobileNumberCache;
+       @NamedCache (cacheName = "mobileNumberCache")
+       private Cache<Long, DialableMobileNumber> mobileNumberCache;
 
        /**
         * General EJB for phone numbers
index e6c1df1d9b7cef45e1cdf3d73560ad847b47e4e5..e0c3519a7bc6235c29c220c59bd626d8aeb21e1a 100644 (file)
@@ -119,8 +119,8 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsController imple
         * A list of all user profiles
         */
        @Inject
-       @NamedCache (cacheName = "userCache", managementEnabled = true)
-       private transient Cache<Long, User> userCache;
+       @NamedCache (cacheName = "userCache")
+       private Cache<Long, User> userCache;
 
        /**
         * User id
@@ -142,8 +142,8 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsController imple
         * User name list
         */
        @Inject
-       @NamedCache (cacheName = "userNameCache", managementEnabled = true)
-       private transient Cache<Long, String> userNameCache;
+       @NamedCache (cacheName = "userNameCache")
+       private Cache<Long, String> userNameCache;
 
        /**
         * User password (clear-text from web form)
index d9565b89f16af90684b62808460b8c6713d5e4c0..dc0b7f232bcfe6789e5da4ad982b32a61e5778eb 100644 (file)
@@ -79,8 +79,8 @@ public class FinancialsUserActivityWebRequestBean extends BaseFinancialsControll
         * "Cache" for activity log per user
         */
        @Inject
-       @NamedCache (cacheName = "userActivityCache", managementEnabled = true)
-       private transient Cache<User, List<LogableUserActivity>> userActivityCache;
+       @NamedCache (cacheName = "userActivityCache")
+       private Cache<User, List<LogableUserActivity>> userActivityCache;
 
        /**
         * Default constructor
index 0eb28e83467702f58745b6a61fb37397b8b71587..9ded8b583ce1bb6adc6ba040b3d9f667b6f9efa8 100644 (file)
@@ -79,8 +79,8 @@ public class FinancialsEmailChangeWebRequestBean extends BaseFinancialsControlle
         * Local list of already queued email addresses
         */
        @Inject
-       @NamedCache (cacheName = "queuedEmailCache", managementEnabled = true)
-       private transient Cache<String, Boolean> queuedEmailCache;
+       @NamedCache (cacheName = "queuedEmailCache")
+       private Cache<String, Boolean> queuedEmailCache;
 
        /**
         * Login controller (bean)
index 6c2d275f67f0a2bba9a5ac01bee982e104ffeafa..cec53b3489f2082a2812853e4c8afeb0d120bd9e 100644 (file)
  */
 package org.mxchange.jfinancials.converter.business.basicdata;
 
-import javax.ejb.EJB;
+import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.convert.Converter;
 import javax.faces.convert.ConverterException;
 import javax.faces.convert.FacesConverter;
+import javax.faces.validator.ValidatorException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
 import org.mxchange.jcontactsbusiness.basicdata.BusinessBasicData;
 import org.mxchange.jcontactsbusiness.basicdata.BusinessDataSessionBeanRemote;
 import org.mxchange.jcontactsbusiness.exceptions.basicdata.BusinessDataNotFoundException;
@@ -31,14 +35,13 @@ import org.mxchange.jcontactsbusiness.exceptions.basicdata.BusinessDataNotFoundE
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@FacesConverter (value = "BusinessContactConverter", managed = true)
+@FacesConverter (value = "BusinessContactConverter")
 public class FinancialsBusinessContactConverter implements Converter<BusinessBasicData> {
 
        /**
         * Business contact EJB
         */
-       @EJB (lookup = "java:global/jfinancials-ejb/businessData!org.mxchange.jcontactsbusiness.basicdata.BusinessDataSessionBeanRemote")
-       private BusinessDataSessionBeanRemote basicDataBean;
+       private static BusinessDataSessionBeanRemote BASIC_DATA_BEAN;
 
        /**
         * Default constructor
@@ -48,6 +51,20 @@ public class FinancialsBusinessContactConverter implements Converter<BusinessBas
 
        @Override
        public BusinessBasicData getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+               // Is the instance there?
+               if (BASIC_DATA_BEAN == null) {
+                       try {
+                               // Not yet, attempt lookup
+                               Context initial = new InitialContext();
+
+                               // Lookup EJB
+                               BASIC_DATA_BEAN = (BusinessDataSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/businessData!org.mxchange.jcontactsbusiness.basicdata.BusinessDataSessionBeanRemote");
+                       } catch (final NamingException ex) {
+                               // Throw it again
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                       }
+               }
+
                // Is the value null or empty?
                if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
                        // Warning message
@@ -65,7 +82,7 @@ public class FinancialsBusinessContactConverter implements Converter<BusinessBas
                        Long contactId = Long.valueOf(submittedValue);
 
                        // Try to get user instance from it
-                       businessContact = this.basicDataBean.findBasicDataById(contactId);
+                       businessContact = BASIC_DATA_BEAN.findBasicDataById(contactId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index 62738e14143c39f908e41f667a371492b1b655b3..1ca1397fc74b7d409532257e1de709d16d852c8c 100644 (file)
  */
 package org.mxchange.jfinancials.converter.business.company_employee;
 
-import javax.ejb.EJB;
+import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.convert.Converter;
 import javax.faces.convert.ConverterException;
 import javax.faces.convert.FacesConverter;
+import javax.faces.validator.ValidatorException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
 import org.mxchange.jcontactsbusiness.employee.CompanyEmployeeSessionBeanRemote;
 import org.mxchange.jcontactsbusiness.employee.Employee;
 import org.mxchange.jcontactsbusiness.exceptions.employee.CompanyEmployeeNotFoundException;
@@ -31,14 +35,13 @@ import org.mxchange.jcontactsbusiness.exceptions.employee.CompanyEmployeeNotFoun
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@FacesConverter (value = "CompanyEmployeeConverter", managed = true)
+@FacesConverter (value = "CompanyEmployeeConverter")
 public class FinancialsCompanyEmployeeConverter implements Converter<Employee> {
 
        /**
         * CompanyEmployee EJB
         */
-       @EJB (lookup = "java:global/jfinancials-ejb/companyEmployee!org.mxchange.jcontactsbusiness.employee.CompanyEmployeeSessionBeanRemote")
-       private CompanyEmployeeSessionBeanRemote companyEmployeeBean;
+       private static CompanyEmployeeSessionBeanRemote COMPANY_EMPLOYEE_BEAN;
 
        /**
         * Default constructor
@@ -48,6 +51,20 @@ public class FinancialsCompanyEmployeeConverter implements Converter<Employee> {
 
        @Override
        public Employee getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+               // Is the instance there?
+               if (COMPANY_EMPLOYEE_BEAN == null) {
+                       try {
+                               // Not yet, attempt lookup
+                               Context initial = new InitialContext();
+
+                               // Lookup EJB
+                               COMPANY_EMPLOYEE_BEAN = (CompanyEmployeeSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/companyEmployee!org.mxchange.jcontactsbusiness.employee.CompanyEmployeeSessionBeanRemote");
+                       } catch (final NamingException ex) {
+                               // Throw it again
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                       }
+               }
+
                // Is the value null or empty?
                if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
                        // Warning message
@@ -65,7 +82,7 @@ public class FinancialsCompanyEmployeeConverter implements Converter<Employee> {
                        Long employeeId = Long.valueOf(submittedValue);
 
                        // Try to get user instance from it
-                       companyEmployee = this.companyEmployeeBean.findCompanyEmployeeById(employeeId);
+                       companyEmployee = COMPANY_EMPLOYEE_BEAN.findCompanyEmployeeById(employeeId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index ecc131074bf7bbc01757b031c3a1b0e87a7ddd83..a5e95756650efd9f831b978eca1a7f630902ef97 100644 (file)
  */
 package org.mxchange.jfinancials.converter.business.headquarters;
 
-import javax.ejb.EJB;
+import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.convert.Converter;
 import javax.faces.convert.ConverterException;
 import javax.faces.convert.FacesConverter;
+import javax.faces.validator.ValidatorException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
 import org.mxchange.jcontactsbusiness.exceptions.headquarters.CompanyHeadquartersNotFoundException;
 import org.mxchange.jcontactsbusiness.headquarters.CompanyHeadquartersSessionBeanRemote;
 import org.mxchange.jcontactsbusiness.headquarters.HeadquartersData;
@@ -31,14 +35,13 @@ import org.mxchange.jcontactsbusiness.headquarters.HeadquartersData;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@FacesConverter (value = "CompanyHeadquartersConverter", managed = true)
+@FacesConverter (value = "CompanyHeadquartersConverter")
 public class FinancialsCompanyHeadquartersConverter implements Converter<HeadquartersData> {
 
        /**
         * CompanyEmployee EJB
         */
-       @EJB (lookup = "java:global/jfinancials-ejb/companyEmployee!org.mxchange.jcontactsbusiness.headquarters.CompanyHeadquartersSessionBeanRemote")
-       private CompanyHeadquartersSessionBeanRemote companyHeadquartersBean;
+       private static CompanyHeadquartersSessionBeanRemote COMPANY_HEADQUARTERS_BEAN;
 
        /**
         * Default constructor
@@ -48,6 +51,20 @@ public class FinancialsCompanyHeadquartersConverter implements Converter<Headqua
 
        @Override
        public HeadquartersData getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+               // Is the instance there?
+               if (COMPANY_HEADQUARTERS_BEAN == null) {
+                       try {
+                               // Not yet, attempt lookup
+                               Context initial = new InitialContext();
+
+                               // Lookup EJB
+                               COMPANY_HEADQUARTERS_BEAN = (CompanyHeadquartersSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/companyEmployee!org.mxchange.jcontactsbusiness.headquarters.CompanyHeadquartersSessionBeanRemote");
+                       } catch (final NamingException ex) {
+                               // Throw it again
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                       }
+               }
+
                // Is the value null or empty?
                if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
                        // Warning message
@@ -65,7 +82,7 @@ public class FinancialsCompanyHeadquartersConverter implements Converter<Headqua
                        Long headquartersId = Long.valueOf(submittedValue);
 
                        // Try to get user instance from it
-                       companyHeadquarters = this.companyHeadquartersBean.findCompanyHeadquartersById(headquartersId);
+                       companyHeadquarters = COMPANY_HEADQUARTERS_BEAN.findCompanyHeadquartersById(headquartersId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index 8832300a53a7e3d872772b51c6b61c1fb68b0591..01b36fcda4fcca88ab4289a49621bc0e116512bf 100644 (file)
  */
 package org.mxchange.jfinancials.converter.contact;
 
-import javax.ejb.EJB;
+import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.convert.Converter;
 import javax.faces.convert.ConverterException;
 import javax.faces.convert.FacesConverter;
+import javax.faces.validator.ValidatorException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcontacts.contact.ContactSessionBeanRemote;
 import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
@@ -31,14 +35,13 @@ import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@FacesConverter (value = "ContactConverter", managed = true)
+@FacesConverter (value = "ContactConverter")
 public class FinancialsContactConverter implements Converter<Contact> {
 
        /**
         * Contact EJB
         */
-       @EJB (lookup = "java:global/jfinancials-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote")
-       private ContactSessionBeanRemote contactBean;
+       private static ContactSessionBeanRemote CONTACT_BEAN;
 
        /**
         * Default constructor
@@ -48,6 +51,20 @@ public class FinancialsContactConverter implements Converter<Contact> {
 
        @Override
        public Contact getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+               // Is the instance there?
+               if (CONTACT_BEAN == null) {
+                       try {
+                               // Not yet, attempt lookup
+                               Context initial = new InitialContext();
+
+                               // Lookup EJB
+                               CONTACT_BEAN = (ContactSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote");
+                       } catch (final NamingException ex) {
+                               // Throw it again
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                       }
+               }
+
                // Is the value null or empty?
                if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
                        // Warning message
@@ -65,7 +82,7 @@ public class FinancialsContactConverter implements Converter<Contact> {
                        Long contactId = Long.valueOf(submittedValue);
 
                        // Try to get user instance from it
-                       contact = this.contactBean.findContactById(contactId);
+                       contact = this.CONTACT_BEAN.findContactById(contactId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index b7689982645cfe67b311e0a463e4ca259451b7bd..953527bf3ea7958b71a855ca639292e2d7e42355 100644 (file)
@@ -18,12 +18,16 @@ package org.mxchange.jfinancials.converter.country;
 
 import java.util.List;
 import java.util.Objects;
-import javax.ejb.EJB;
+import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.convert.Converter;
 import javax.faces.convert.ConverterException;
 import javax.faces.convert.FacesConverter;
+import javax.faces.validator.ValidatorException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jcountry.data.CountrySingletonBeanRemote;
 
@@ -32,14 +36,13 @@ import org.mxchange.jcountry.data.CountrySingletonBeanRemote;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@FacesConverter (value = "CountryConverter", managed = true)
+@FacesConverter (value = "CountryConverter")
 public class FinancialsCountryConverter implements Converter<Country> {
 
        /**
         * Country bean
         */
-       @EJB (lookup = "java:global/jfinancials-ejb/country!org.mxchange.jcountry.data.CountrySingletonBeanRemote")
-       private CountrySingletonBeanRemote countryBean;
+       private static CountrySingletonBeanRemote COUNTRY_BEAN;
 
        /**
         * Default constructor
@@ -49,6 +52,20 @@ public class FinancialsCountryConverter implements Converter<Country> {
 
        @Override
        public Country getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+               // Is the instance there?
+               if (COUNTRY_BEAN == null) {
+                       try {
+                               // Not yet, attempt lookup
+                               Context initial = new InitialContext();
+
+                               // Lookup EJB
+                               COUNTRY_BEAN = (CountrySingletonBeanRemote) initial.lookup("java:global/jfinancials-ejb/country!org.mxchange.jcountry.data.CountrySingletonBeanRemote");
+                       } catch (final NamingException ex) {
+                               // Throw it again
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                       }
+               }
+
                // Is the value null or empty?
                if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
                        // Warning message
@@ -59,7 +76,7 @@ public class FinancialsCountryConverter implements Converter<Country> {
                }
 
                // Get full list
-               List<Country> countryList = this.countryBean.allCountries();
+               List<Country> countryList = COUNTRY_BEAN.allCountries();
 
                // Init value
                Country country = null;
index 41a269bf5bc72f52b56dc0d95cfd94bb9c0c70eb..64da22316c89d18d09c44f2e91f8485e08d5e780 100644 (file)
  */
 package org.mxchange.jfinancials.converter.fax;
 
-import javax.ejb.EJB;
+import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.convert.Converter;
 import javax.faces.convert.ConverterException;
 import javax.faces.convert.FacesConverter;
+import javax.faces.validator.ValidatorException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
 import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;
@@ -31,14 +35,13 @@ import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@FacesConverter (value = "FaxNumberConverter", managed = true)
+@FacesConverter (value = "FaxNumberConverter")
 public class FinancialsFaxNumberConverter implements Converter<DialableFaxNumber> {
 
        /**
         * Phone EJB
         */
-       @EJB(lookup = "java:global/jfinancials-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote")
-       private PhoneSessionBeanRemote phoneBean;
+       private static PhoneSessionBeanRemote PHONE_BEAN;
 
        /**
         * Default constructor
@@ -48,6 +51,20 @@ public class FinancialsFaxNumberConverter implements Converter<DialableFaxNumber
 
        @Override
        public DialableFaxNumber getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+               // Is the instance there?
+               if (PHONE_BEAN == null) {
+                       try {
+                               // Not yet, attempt lookup
+                               Context initial = new InitialContext();
+
+                               // Lookup EJB
+                               PHONE_BEAN = (PhoneSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote");
+                       } catch (final NamingException ex) {
+                               // Throw it again
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                       }
+               }
+
                // Log message
                // @TODO Not possible here: this.loggerBeanLocal.logTrace(MessageFormat.format("{0}.getAsObject: context={1},component={2},submittedValue={3} - CALLED!", this.getClass().getSimpleName(), context, component, submittedValue)); //NOI18N
 
@@ -70,7 +87,7 @@ public class FinancialsFaxNumberConverter implements Converter<DialableFaxNumber
                        // Log message
                        // @TODO Not possible here: this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject: faxNumberId={1}", this.getClass().getSimpleName(), faxNumberId)); //NOI18N
                        // Try to get mobile instance from it
-                       faxNumber = this.phoneBean.findFaxNumberById(faxNumberId);
+                       faxNumber = PHONE_BEAN.findFaxNumberById(faxNumberId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index 070f99c6c3dfcd2743d6847fa307bea398ab532d..13d0b2d7c84893fafffb064454b2b39799cc8992 100644 (file)
  */
 package org.mxchange.jfinancials.converter.landline;
 
-import javax.ejb.EJB;
+import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.convert.Converter;
 import javax.faces.convert.ConverterException;
 import javax.faces.convert.FacesConverter;
+import javax.faces.validator.ValidatorException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
 import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;
@@ -31,14 +35,13 @@ import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@FacesConverter (value = "LandLineNumberConverter", managed = true)
+@FacesConverter (value = "LandLineNumberConverter")
 public class FinancialsLandLineNumberConverter implements Converter<DialableLandLineNumber> {
 
        /**
         * Phone EJB
         */
-       @EJB(lookup = "java:global/jfinancials-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote")
-       private PhoneSessionBeanRemote phoneBean;
+       private static PhoneSessionBeanRemote PHONE_BEAN;
 
        /**
         * Default constructor
@@ -48,6 +51,20 @@ public class FinancialsLandLineNumberConverter implements Converter<DialableLand
 
        @Override
        public DialableLandLineNumber getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+               // Is the instance there?
+               if (PHONE_BEAN == null) {
+                       try {
+                               // Not yet, attempt lookup
+                               Context initial = new InitialContext();
+
+                               // Lookup EJB
+                               PHONE_BEAN = (PhoneSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote");
+                       } catch (final NamingException ex) {
+                               // Throw it again
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                       }
+               }
+
                // Is the value null or empty?
                if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
                        // Warning message
@@ -65,7 +82,7 @@ public class FinancialsLandLineNumberConverter implements Converter<DialableLand
                        Long landLineNumberId = Long.valueOf(submittedValue);
 
                        // Try to get mobile instance from it
-                       landLineNumber = this.phoneBean.findLandLineNumberById(landLineNumberId);
+                       landLineNumber = PHONE_BEAN.findLandLineNumberById(landLineNumberId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index 9ec30910873dc0f1afca0fdf70f6b879a1256a2d..6a398593dc0e489e9f79db75f12e4e948c8dc432 100644 (file)
  */
 package org.mxchange.jfinancials.converter.mobile;
 
-import javax.ejb.EJB;
+import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.convert.Converter;
 import javax.faces.convert.ConverterException;
 import javax.faces.convert.FacesConverter;
+import javax.faces.validator.ValidatorException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
 import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;
 import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;
@@ -31,14 +35,13 @@ import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@FacesConverter (value = "MobileNumberConverter", managed = true)
+@FacesConverter (value = "MobileNumberConverter")
 public class FinancialsMobileNumberConverter implements Converter<DialableMobileNumber> {
 
        /**
         * Phone EJB
         */
-       @EJB (lookup = "java:global/jfinancials-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote")
-       private PhoneSessionBeanRemote phoneBean;
+       private static PhoneSessionBeanRemote PHONE_BEAN;
 
        /**
         * Default constructor
@@ -48,6 +51,20 @@ public class FinancialsMobileNumberConverter implements Converter<DialableMobile
 
        @Override
        public DialableMobileNumber getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+               // Is the instance there?
+               if (PHONE_BEAN == null) {
+                       try {
+                               // Not yet, attempt lookup
+                               Context initial = new InitialContext();
+
+                               // Lookup EJB
+                               PHONE_BEAN = (PhoneSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote");
+                       } catch (final NamingException ex) {
+                               // Throw it again
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                       }
+               }
+
                // Is the value null or empty?
                if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
                        // Warning message
@@ -65,7 +82,7 @@ public class FinancialsMobileNumberConverter implements Converter<DialableMobile
                        Long mobileId = Long.valueOf(submittedValue);
 
                        // Try to get mobile instance from it
-                       mobile = this.phoneBean.findMobileNumberById(mobileId);
+                       mobile = PHONE_BEAN.findMobileNumberById(mobileId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index 32d3e1e2a6d49e27f0d2dfc130744df7c67ba399..ac63fe6d78f23997a7fac1e8df5438b6f06a0c00 100644 (file)
  */
 package org.mxchange.jfinancials.converter.user;
 
-import javax.ejb.EJB;
+import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.convert.Converter;
 import javax.faces.convert.ConverterException;
 import javax.faces.convert.FacesConverter;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
 import org.mxchange.jusercore.model.user.User;
 import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
@@ -31,14 +34,13 @@ import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@FacesConverter (value = "UserConverter", managed = true)
+@FacesConverter (value = "UserConverter")
 public class FinancialsUserConverter implements Converter<User> {
 
        /**
         * User EJB
         */
-       @EJB(lookup = "java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote")
-       private UserSessionBeanRemote userBean;
+       private static UserSessionBeanRemote USER_BEAN;
 
        /**
         * Default constructor
@@ -48,6 +50,20 @@ public class FinancialsUserConverter implements Converter<User> {
 
        @Override
        public User getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+               // Is the instance there?
+               if (USER_BEAN == null) {
+                       try {
+                               // Not yet, attempt lookup
+                               Context initial = new InitialContext();
+
+                               // Lookup EJB
+                               USER_BEAN = (UserSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote");
+                       } catch (final NamingException ex) {
+                               // Throw it again
+                               throw new ConverterException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                       }
+               }
+
                // Is the value null or empty?
                if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
                        // Warning message
@@ -65,7 +81,7 @@ public class FinancialsUserConverter implements Converter<User> {
                        Long userId = Long.valueOf(submittedValue);
 
                        // Try to get user instance from it
-                       user = this.userBean.findUserById(userId);
+                       user = USER_BEAN.findUserById(userId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index 258303e20d3ee83da95d1e2c8dfb1fe1a0c4a2a9..968ec1a9a58f062f2476bf6be3a0e4f51ed61d5c 100644 (file)
 package org.mxchange.jfinancials.validator.business.basicdata;
 
 import java.text.MessageFormat;
-import javax.ejb.EJB;
 import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.validator.FacesValidator;
 import javax.faces.validator.ValidatorException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
 import org.mxchange.jcontactsbusiness.basicdata.BusinessDataSessionBeanRemote;
 import org.mxchange.jcoreee.validator.string.BaseStringValidator;
 
@@ -31,22 +33,35 @@ import org.mxchange.jcoreee.validator.string.BaseStringValidator;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@FacesValidator (value = "CompanyNameValidator", managed = true)
+@FacesValidator (value = "CompanyNameValidator")
 public class FinancialsCompanyNameValidator extends BaseStringValidator {
 
        /**
-        * Serial number
+        * Business contact EJB
         */
-       private static final long serialVersionUID = 57_283_657_476_561L;
+       private static BusinessDataSessionBeanRemote BASIC_DATA_BEAN;
 
        /**
-        * Business contact EJB
+        * Serial number
         */
-       @EJB (lookup = "java:global/jfinancials-ejb/businessData!org.mxchange.jcontactsbusiness.basicdata.BusinessDataSessionBeanRemote")
-       private BusinessDataSessionBeanRemote basicDataBean;
+       private static final long serialVersionUID = 57_283_657_476_561L;
 
        @Override
        public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
+               // Is the instance there?
+               if (BASIC_DATA_BEAN == null) {
+                       try {
+                               // Not yet, attempt lookup
+                               Context initial = new InitialContext();
+
+                               // Lookup EJB
+                               BASIC_DATA_BEAN = (BusinessDataSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/businessData!org.mxchange.jcontactsbusiness.basicdata.BusinessDataSessionBeanRemote");
+                       } catch (final NamingException ex) {
+                               // Throw it again
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                       }
+               }
+
                // All accepted, required fields
                String[] requiredFields = {"companyName"}; //NOI18N
 
@@ -75,7 +90,7 @@ public class FinancialsCompanyNameValidator extends BaseStringValidator {
                }
 
                // Check if name is already used
-               Boolean nameExists = this.basicDataBean.isCompanyNameUsed(companyName);
+               Boolean nameExists = BASIC_DATA_BEAN.isCompanyNameUsed(companyName);
 
                // Is the user id valid?
                if ((!nameExists) && (checkExisting)) {
index a185a4fdd9f0afccf2965d533548758acfff430d..e9a0a2aeca6c0b7b23a761649b524c53eeab431f 100644 (file)
@@ -18,12 +18,14 @@ package org.mxchange.jfinancials.validator.emailaddress;
 
 import java.text.MessageFormat;
 import java.util.regex.Pattern;
-import javax.ejb.EJB;
 import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.validator.FacesValidator;
 import javax.faces.validator.ValidatorException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
 import org.mxchange.jcontacts.contact.ContactSessionBeanRemote;
 import org.mxchange.jcoreee.validator.string.BaseStringValidator;
 
@@ -32,14 +34,13 @@ import org.mxchange.jcoreee.validator.string.BaseStringValidator;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@FacesValidator (value = "EmailAddressValidator", managed = true)
+@FacesValidator (value = "EmailAddressValidator")
 public class FinancialsEmailAddressValidator extends BaseStringValidator {
 
        /**
         * Contact session-scoped bean
         */
-       @EJB (lookup = "java:global/jfinancials-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote")
-       private ContactSessionBeanRemote contactBean;
+       private static ContactSessionBeanRemote CONTACT_BEAN;
 
        /**
         * Email pattern
@@ -64,6 +65,20 @@ public class FinancialsEmailAddressValidator extends BaseStringValidator {
 
        @Override
        public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
+               // Is the instance there?
+               if (CONTACT_BEAN == null) {
+                       try {
+                               // Not yet, attempt lookup
+                               Context initial = new InitialContext();
+
+                               // Lookup EJB
+                               CONTACT_BEAN = (ContactSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote");
+                       } catch (final NamingException ex) {
+                               // Throw it again
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                       }
+               }
+
                System.out.println(this.getClass().getSimpleName() + ".validate(): component.clientId=" + component.getClientId());
                // The required field
                String[] requiredFields = {"emailAddress", "emailAddressRepeat", "resendEmailAddress"}; //NOI18N
@@ -121,7 +136,7 @@ public class FinancialsEmailAddressValidator extends BaseStringValidator {
                String clientId = component.getClientId();
 
                // Is it registered?
-               Boolean isRegistered = this.contactBean.isEmailAddressRegistered(emailAddress);
+               Boolean isRegistered = CONTACT_BEAN.isEmailAddressRegistered(emailAddress);
 
                // Is the email address already registered?
                if ((!clientId.endsWith("resendEmailAddress")) && (isRegistered)) { //NOI18N
index ff6ec55a807c7d8842dafcd2f27540d1567a5cd6..da0ccdab10a16890d41d31764cf2f6aebf3e1528 100644 (file)
 package org.mxchange.jfinancials.validator.user;
 
 import java.text.MessageFormat;
-import javax.ejb.EJB;
 import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.validator.FacesValidator;
 import javax.faces.validator.ValidatorException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
 import org.mxchange.jcoreee.validator.number.BaseNumberValidator;
 import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
 
@@ -31,19 +33,18 @@ import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@FacesValidator (value = "UserIdValidator", managed = true)
+@FacesValidator (value = "UserIdValidator")
 public class FinancialsUserIdValidator extends BaseNumberValidator {
 
        /**
-        * Serial number
+        * Remote bean
         */
-       private static final long serialVersionUID = 12_869_569_314_764_690L;
+       private static UserSessionBeanRemote USER_BEAN;
 
        /**
-        * Remote bean
+        * Serial number
         */
-       @EJB (lookup = "java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote")
-       private UserSessionBeanRemote userBean;
+       private static final long serialVersionUID = 12_869_569_314_764_690L;
 
        /**
         * Default constructor
@@ -53,6 +54,20 @@ public class FinancialsUserIdValidator extends BaseNumberValidator {
 
        @Override
        public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
+               // Is the instance there?
+               if (USER_BEAN == null) {
+                       try {
+                               // Not yet, attempt lookup
+                               Context initial = new InitialContext();
+
+                               // Lookup EJB
+                               USER_BEAN = (UserSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote");
+                       } catch (final NamingException ex) {
+                               // Throw it again
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                       }
+               }
+
                // All accepted, required fields
                String[] requiredFields = {"userId"}; //NOI18N
 
@@ -63,7 +78,7 @@ public class FinancialsUserIdValidator extends BaseNumberValidator {
                Long userId = (Long) value;
 
                // Define variable
-               Boolean ifUserExists = this.userBean.ifUserIdExists(userId);
+               Boolean ifUserExists = USER_BEAN.ifUserIdExists(userId);
 
                // Is the user id valid?
                if (!ifUserExists) {