5 Replies Latest reply on Mar 28, 2006 9:14 AM by Emmanuel Bernard

    ValidatorMessages

    Pete Muir Master

      I'm trying to get custom validator messages working.

      I have

      sms.ear
      --> sms.jar
      --> ValidatorMessages.properties
      ...
      --> sms.war
      ...

      When I deploy the ear to Jboss 4.0.4RC1 an exception is thrown complaining that the key postcode cannot be found (see below) however executing

      ResourceBundle rb = ResourceBundle.getBundle("ValidatorMessages");
      log.info(rb.getString("postcode"));
      


      retrieves the key fine.

      I infer that when the ClassValidator is trying to load the ResourceBundle it cannot find it. Can anyone tell me where I should be placing the ValidatorMessages.properties file?

      Cheers

      Peter

      2006-03-17 15:26:03,882 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/sms]] Exception sending context initialized event to listener instance of class org
      .jboss.seam.servlet.SeamListener
      java.lang.IllegalArgumentException: could not instantiate ClassValidator
       at org.hibernate.validator.ClassValidator.createValidator(ClassValidator.java:204)
       at org.hibernate.validator.ClassValidator.createMemberValidator(ClassValidator.java:165)
       at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:134)
       at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:83)
       at org.hibernate.validator.ClassValidator.createChildValidator(ClassValidator.java:156)
       at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:136)
       at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:83)
       at org.hibernate.validator.ClassValidator.createChildValidator(ClassValidator.java:156)
       at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:136)
       at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:83)
       at org.hibernate.validator.ClassValidator.createChildValidator(ClassValidator.java:156)
       at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:136)
       at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:83)
       at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:72)
       at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:64)
       at org.jboss.seam.Component.initValidator(Component.java:214)
       at org.jboss.seam.Component.<init>(Component.java:185)
       at org.jboss.seam.Component.<init>(Component.java:142)
       at org.jboss.seam.Component.<init>(Component.java:137)
       at org.jboss.seam.Component.<init>(Component.java:132)
       at org.jboss.seam.init.Initialization.addComponent(Initialization.java:244)
       at org.jboss.seam.init.Initialization.addComponents(Initialization.java:225)
       at org.jboss.seam.init.Initialization.init(Initialization.java:93)
       at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:30)
       at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3692)
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4127)
       at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
       at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
       at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
       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:585)
       at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
       at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.apache.catalina.core.StandardContext.init(StandardContext.java:5031)
       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:585)
       at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
       at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:297)
       at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103)
       at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371)
       at org.jboss.web.WebModule.startModule(WebModule.java:83)
       at org.jboss.web.WebModule.startService(WebModule.java:61)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:974)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
       at $Proxy30.start(Unknown Source)
       at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:469)
       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:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
       at $Proxy31.start(Unknown Source)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:997)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
       at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
       at $Proxy6.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:334)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:504)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:207)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:218)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:197)
      Caused by: java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key postcode
       at java.util.ResourceBundle.getObject(ResourceBundle.java:325)
       at java.util.ResourceBundle.getString(ResourceBundle.java:285)
       at org.hibernate.validator.ClassValidator.replace(ClassValidator.java:404)
       at org.hibernate.validator.ClassValidator.createValidator(ClassValidator.java:199)
       ... 109 more