6 Replies Latest reply on Mar 1, 2006 10:56 PM by Andrew

    Message bundle issues

    Andrew Apprentice

      Okay, I am trying to make a patch from the hibernate annotations validator to support child objects. One of my objects has the email validator annotation on it. My faces configuration file is setting the message bundle. However, I am getting an error when seam starts. It loads some kind of generic "messages" bundle that I cannot find the .proeprties file for. Wherever this bundle is, it is missing the standard validation messages:

      ERROR 18-02 16:09:17,761 (StandardContext.java:listenerStart:3731) -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:257)
       at org.hibernate.validator.ClassValidator.createMemberValidator(ClassValidator.java:217)
       at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:140)
       at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:89)
       at org.hibernate.validator.ClassValidator.createChildValidator(ClassValidator.java:172)
       at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:142)
       at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:89)
       at org.hibernate.validator.ClassValidator.createChildValidator(ClassValidator.java:177)
       at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:142)
       at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:89)
       at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:78)
       at org.jboss.seam.Component.initValidator(Component.java:218)
       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:3727)
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4162)
       at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
       at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
       at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
       at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
       at org.apache.catalina.core.StandardService.start(StandardService.java:450)
       at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
       at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
       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.catalina.startup.Bootstrap.start(Bootstrap.java:275)
       at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
      Caused by: java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key validator.email
       at java.util.ResourceBundle.getObject(ResourceBundle.java:326)
       at java.util.ResourceBundle.getString(ResourceBundle.java:286)
       at org.hibernate.validator.ClassValidator.replace(ClassValidator.java:479)
       at org.hibernate.validator.ClassValidator.createValidator(ClassValidator.java:252)
       ... 34 more
      Feb 18, 2006 4:09:17 PM org.apache.catalina.core.StandardContext start


      Earlier in the startup log I saw:
      INFO 18-02 16:08:39,738 (Component.java:<init>:168) -Component: resourceBundle, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.ResourceBundle
      INFO 18-02 16:08:39,832 (Component.java:<init>:168) -Component: org.jboss.seam.debug.introspector, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.debug.Introspector
      INFO 18-02 16:08:55,009 (ResourceBundle.java:loadBundle:58) -loaded resource bundle: messages


      1) Why is seam not finding my bundle?
      2) Why is there no "validator.email" key in the default bundle

      FYI: section from faces config:


      Thanks!
      <application>
       <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
       <locale-config>
       <default-locale>en</default-locale>
       </locale-config>
       <message-bundle>DefaultMessages</message-bundle>
       </application>