...
This is a deployment issue in Glassfish (esp. v3.0.1).
injectionPoint.getBean() returns null in this case (which is wrong in any case).
Workaround
Code Block |
---|
| java |
---|
| java |
---|
title | Deactivation of the InvalidValueAwareMessageInterpolatorjava |
---|
|
@ApplicationScoped
@Alternative
public class CustomJsfModuleConfig extends JsfModuleConfig
{
@Override
public boolean isInvalidValueAwareMessageInterpolatorEnabled()
{
return false;
}
}
|
Due to https://issues.jboss.org/browse/WELD-802 it's required to use @Alternative (+ xml config) instead of @Specializes.
Console output
Code Block |
---|
| html |
---|
| html |
---|
title | Example for the console outputhtml |
---|
|
INFO: GlassFish Server Open Source Edition 3.0.1 (22) startup time : Felix(2241ms) startup services(16170ms) total(18411ms)
INFO: [Thread[GlassFish Kernel Main Thread,5,main]] started
INFO: start init of org.apache.myfaces.extensions.validator.beanval.startup.JSF2AwareBeanValidationStartupListener
INFO: global property [org.apache.myfaces.extensions.validator.core.ProjectStageResolver] added
INFO: init of org.apache.myfaces.extensions.validator.beanval.startup.JSF2AwareBeanValidationStartupListener finished
INFO: start init of org.apache.myfaces.extensions.validator.beanval.startup.BeanValidationStartupListener
INFO: global property [javax.validation.ValidatorFactory] added
INFO: global property [org.apache.myfaces.extensions.validator.beanval.payload.ViolationSeverity$Info] added
INFO: global property [org.apache.myfaces.extensions.validator.beanval.payload.ViolationSeverity$Warn] added
INFO: global property [org.apache.myfaces.extensions.validator.beanval.payload.ViolationSeverity$Fatal] added
INFO: global property [org.apache.myfaces.extensions.validator.beanval.payload.DisableClientSideValidation] added
INFO: init of org.apache.myfaces.extensions.validator.beanval.startup.BeanValidationStartupListener finished
INFO: start init of org.apache.myfaces.extensions.validator.core.startup.ExtValStartupListener
INFO: config for key [class org.apache.myfaces.extensions.validator.core.DefaultExtValCoreConfiguration] added
INFO: starting up MyFaces Extensions Validator v2.0.5-SNAPSHOT
INFO: class org.apache.myfaces.extensions.validator.core.validation.parameter.DefaultViolationSeverityInterpreter is used
INFO: global property [org.apache.myfaces.extensions.validator.core.validation.parameter.ViolationSeverity] added
INFO: global property [org.apache.myfaces.extensions.validator.core.validation.parameter.DisableClientSideValidation] added
INFO: global property [mode:init:required] added
INFO: global property [mode:reset:required] added
INFO: init of org.apache.myfaces.extensions.validator.core.startup.ExtValStartupListener finished
INFO: start init of org.apache.myfaces.extensions.validator.PropertyValidationModuleStartupListener
INFO: config for key [class org.apache.myfaces.extensions.validator.baseval.DefaultExtValBaseValidationModuleConfiguration] added
INFO: config for key [class org.apache.myfaces.extensions.validator.crossval.DefaultExtValCrossValidationModuleConfiguration] added
INFO: adding support for @SkipValidation
INFO: class org.apache.myfaces.extensions.validator.PropertyValidationSkipValidationEvaluator is used
INFO: org.apache.myfaces.extensions.validator.JoinValidationMetaDataStorageFilter added
INFO: init of org.apache.myfaces.extensions.validator.PropertyValidationModuleStartupListener finished
INFO: [Started] MyFaces CODI JSF-Module v0.9.3 for JSF 2.0
Used JSF implementation: Mojarra v2.0.2-FCS
config implementation: org.apache.myfaces.extensions.cdi.jsf.api.config.JsfModuleConfig
method: isInitialRedirectEnabled
value: true
method: isUseViewConfigsAsNavigationCasesEnabled
value: true
method: isInvalidValueAwareMessageInterpolatorEnabled
value: true
method: isAlwaysKeepMessages
value: true
config implementation: org.apache.myfaces.extensions.cdi.core.api.scope.conversation.config.WindowContextConfig
method: isUrlParameterSupported
value: true
method: isUnknownWindowIdsAllowed
value: false
method: isAddWindowIdToActionUrlsEnabled
value: false
method: getWindowContextTimeoutInMinutes
value: 60
method: getMaxWindowContextCount
value: 64
method: isCloseEmptyWindowContextsEnabled
value: false
method: isEagerWindowContextDetectionEnabled
value: true
method: isCreateWindowContextEventEnabled
value: false
method: isCloseWindowContextEventEnabled
value: false
config implementation: org.apache.myfaces.extensions.cdi.core.api.scope.conversation.config.ConversationConfig
method: getConversationTimeoutInMinutes
value: 30
method: isScopeBeanEventEnabled
value: false
method: isAccessBeanEventEnabled
value: false
method: isUnscopeBeanEventEnabled
value: false
method: isStartConversationEventEnabled
value: false
method: isCloseConversationEventEnabled
value: false
method: isRestartConversationEventEnabled
value: false
MessageContextConfig class: org.apache.myfaces.extensions.cdi.message.impl.DefaultMessageContextConfig
MessageInterpolator class: class org.apache.myfaces.extensions.cdi.jsf.impl.message.FacesMessageInterpolator
MessageResolver class: class org.apache.myfaces.extensions.cdi.jsf.impl.message.JsfAwareApplicationMessagesMessageResolver
MessageHandler class: class org.apache.myfaces.extensions.cdi.jsf.impl.message.JsfAwareMessageHandler
LocaleResolver class: class org.apache.myfaces.extensions.cdi.jsf.impl.message.JsfAwareLocaleResolver
FormatterFactory class: class org.apache.myfaces.extensions.cdi.message.impl.DefaultFormatterFactory
INFO: [Started] MyFaces CODI JPA-Module v0.9.3
INFO: [Started] MyFaces CODI (Extensions CDI) Core v0.9.3
Used CDI implementation: Weld v1.0.1.SP3
project-stage: Production
project-stage class: org.apache.myfaces.extensions.cdi.core.api.projectstage.ProjectStage$Production
application-parameters:
name: javax.faces.PROJECT_STAGE
value: Development
name: com.sun.faces.validateXml
value: true
name: com.sun.faces.forceLoadConfiguration
value: true
config implementation: org.apache.myfaces.extensions.cdi.core.api.config.CodiCoreConfig
method: isAdvancedQualifierRequiredForDependencyInjection
value: true
method: isConfigurationLoggingEnabled
value: true
WARNUNG: The value of the JSF 2 project stage (Development) is different from the CODI project stage (Production)
INFO: [Started] MyFaces CODI Scripting-Module v0.9.3
INFO: [Started] MyFaces CODI Bean-Validation-Module v0.9.3
SCHWERWIEGEND: Error Rendering View[/pages/login.xhtml]
java.lang.NullPointerException
at org.apache.myfaces.extensions.cdi.core.impl.logging.LoggerProducer.getLogger(LoggerProducer.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:304)
at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:298)
at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:200)
at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstance(MethodInjectionPoint.java:164)
at org.jboss.weld.bean.ProducerMethod$1.produce(ProducerMethod.java:143)
at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:360)
at org.jboss.weld.context.DependentContext.get(DependentContext.java:62)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:709)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:771)
at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:794)
at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:108)
at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:790)
at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:802)
at org.jboss.weld.manager.SimpleInjectionTarget$1.proceed(SimpleInjectionTarget.java:122)
at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:130)
at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:47)
at org.jboss.weld.manager.SimpleInjectionTarget.inject(SimpleInjectionTarget.java:116)
at org.apache.myfaces.extensions.cdi.core.impl.util.CodiUtils.tryToInjectFields(CodiUtils.java:225)
at org.apache.myfaces.extensions.cdi.core.impl.util.CodiUtils.injectFields(CodiUtils.java:196)
at org.apache.myfaces.extensions.cdi.jsf.impl.bv.resolver.InvalidValueAwareValidatorFactory.getMessageInterpolator(InvalidValueAwareValidatorFactory.java:48)
at org.apache.myfaces.extensions.cdi.bv.impl.CdiAwareValidatorFactory.getValidator(CdiAwareValidatorFactory.java:52)
at org.apache.myfaces.extensions.cdi.bv.impl.InjectableValidatorFactory.getValidator(InjectableValidatorFactory.java:71)
at org.apache.myfaces.extensions.validator.beanval.ValidatorFactoryProxy.getValidator(ValidatorFactoryProxy.java:86)
at org.apache.myfaces.extensions.validator.beanval.util.BeanValidationUtils.getElementDescriptor(BeanValidationUtils.java:108)
at org.apache.myfaces.extensions.validator.beanval.BeanValidationModuleValidationInterceptorInternals.initComponentWithPropertyDetails(BeanValidationModuleValidationInterceptorInternals.java:104)
at org.apache.myfaces.extensions.validator.beanval.BeanValidationModuleValidationInterceptor.initComponentWithPropertyDetails(BeanValidationModuleValidationInterceptor.java:70)
at org.apache.myfaces.extensions.validator.beanval.BeanValidationModuleValidationInterceptor.initComponent(BeanValidationModuleValidationInterceptor.java:60)
at org.apache.myfaces.extensions.validator.core.interceptor.AbstractValidationInterceptor.beforeEncodeBegin(AbstractValidationInterceptor.java:112)
at org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeBegin(ExtValRendererWrapper.java:162)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:823)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:285)
at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:185)
at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:129)
at org.apache.myfaces.extensions.validator.core.renderkit.ExtValLazyRendererProxy.encodeChildren(ExtValLazyRendererProxy.java:70)
at org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeChildren(ExtValRendererWrapper.java:251)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:848)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1613)
at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
at org.apache.myfaces.extensions.validator.core.renderkit.ExtValLazyRendererProxy.encodeChildren(ExtValLazyRendererProxy.java:70)
at org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeChildren(ExtValRendererWrapper.java:251)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:848)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1613)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:380)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at org.apache.myfaces.extensions.cdi.jsf2.impl.listener.phase.CodiLifecycleWrapper.render(CodiLifecycleWrapper.java:98)
at org.apache.myfaces.extensions.validator.core.startup.ExtValLifecycleWrapper.render(ExtValLifecycleWrapper.java:79)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:662)
|
...