bean validator issue in jdk 6

View: New views
2 Messages — Rating Filter:   Alert me  

bean validator issue in jdk 6

by Andrea Nasato :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi to all,

I'm using spring-modules-validation (0.7) BeanValidator with annotations
and I have a strange problem. If I deploy my web applications in Tomcat
running with jdk 5 everything goes well, but if I switch to jdk 6 I get
  a java.lang.NoClassDefFoundError.

This is a snippet of the configuration file of my web app:


<!-- This is the annotation validator -->
        <bean id="validator"
class="org.springmodules.validation.bean.BeanValidator">
                <property name="configurationLoader" ref="configurationLoader"/>
        </bean>
        <bean id="configurationLoader"
class="org.springmodules.validation.bean.conf.loader.annotation.AnnotationBeanValidationConfigurationLoader"
/>
<!-- Abstract Controller -->
     <bean id="abstractController" abstract="true">
         <property name="conf">
             <ref bean="conf"/>
         </property>
         <property name="validators">
             <ref bean="validator"/>
         </property>
         <lookup-method name="dao" bean="daos"/>
         <lookup-method name="blo" bean="blos"/>
     </bean>

and this is the exception:

Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class
[org.springmodules.validation.bean.BeanValidator]: Constructor threw
exception; nested exception is java.lang.NoClassDefFoundError: Could not
initialize class org.springmodules.validation.util.LibraryUtils
         at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:253)

Anyone has the same issue?

Thanks in advance

gtrev


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Parent Message unknown Re: bean validator issue in jdk 6

by Gunnar Hillert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Andrea,

Thanks for your answer! Is this issue somewhere in Jira? (I just want to
make sure this gets resolved for the next version :-)

Regards,

Gunnar

Andrea Nasato wrote:

> On 2/27/07, Gunnar Hillert <gunnar@...> wrote:
>> Hi,
>>
>> I came across the same issue. The error is even worse if you try to use
>> the XML schema configuration (Thought it was a configuration error).
>> Switched back to Java 5 and everything works fine. (??)
>>
>> Regards,
> Hi Gunnar,
>
> I solved my problem updating commons-lang to commons-lang-2.3 :
>
> The validation framework declares a dependency to commons-lang-2.1
> which hasn't got SystemUtils.IS_JAVA_1_6.
>
> Before loading AnnotationValidator, the ValidatorNamespaceHandler
> checks if the vm has annotations enabled, using
> LibraryUtils.JDK_ANNOTATIONS_SUPPORTED, which is:
> SystemUtils.IS_JAVA_1_5 || SystemUtils.IS_JAVA_1_6;
>
> In java 5 the first part of the boolean expression returns true and
> the second isn't evaluated ---> No problems
>
> In java 6 the first part returns false so the second is evaluated --->
> using commons-lang-2.3 solves the problem
>
> Hope this helps
>
> bye
> Andrea
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...