spring - Junit hibernate-validation error -


I am using hibernate-validated annotations in my organizations and this is the reason for exception in my junior tests. I disable Hibernate Verification with property:

  & lt; Prop key = "javax.persistence.validation.mode" & gt; No & lt; / Prop & gt;  

Then JUnit test works very well otherwise I get the following error:

  due to: java.lang.ClassFormatError: absent in method code feature native or class file java.lang.ClassLoader.defineClass1 (Native method L / ExpressionFactory java.lang.ClassLoader.defineClassCond (ClassLoader.java:637) is not of the essence in javax / java.lang.ClassLoader.defineClass) at (classloader java: 621) java.security.SecureClassLoader.defineClass (SecureClassLoader.java:141) on java.net.URLClassLoader.defineClass (URLClassLoader.java:283) in java.net.URLClassLoader.access $ 000 (URLClassLoader.java : 58) java.net.URLClassLoader $ 1.run (URLClassLoader.ja va: 197) .loadClass on java.security.AccessController.doPrivileged (Native Method) at java.net.URLClassLoader.findClass (URLClassLoader.java:190) on java.lang.ClassLoader sun.misc.Launcher $ AppClassLoader.loadClass (Launcher.java:301) to (ClassLoader.java:306) org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator on java.lang.ClassLoader.loadClass (ClassLoader.java:247) or Org.hibernate.validator. And lieutenant; Init & gt; (ResourceBundleMessageInterpolator.java:118) g.hibernate.validator.messageinterpolation.ResourceBundleMessageInterolator & Lt; Init & gt; (ResourceBundleMessageInterpolator.java:169). Internal.engine.ConfigurationImpl. & Lt; Init & gt; (ConfigurationImpl.java:110) at org.hibernate.validator.internal.engine.ConfigurationImpl. & Lt; Init & gt; Org.hibernate.validator.HebernateValidator (ConfigurationImpl.java:86). Make GenericConfiguration (HibernateValidator.java41) at Javax.validation.Validation. Validation $ jenx.validation.configure (validation.java. 776) at javax.validation.Validation.buildDefaultValidatorFactory (ValidationWeb 10) org.hibernate.cfg.binvalidation.TypeSafeActivator at .getValidatorFactory org.hibernate.cfg.beanvalidation.TypeSafeActivator. activate (TypeSafeActivator.java:96) to (TypeSafeActivator.java:445) sun.reflect.DelegatingMethodAccessorImpl un.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) on sun.reflect.NativeMethodAccessorImpl.invoke0 (Native method) at s .invoke (DelegatingMethodAccessorImpl.java:25) .cfg.beanvalidation.BeanValidationIntegrator.integrate (BeanValidationIntegrator.java:148) on org.hibernate on java.lang.reflect.Method.invoke (Method.java:597) ... 61 More  

JUnit test:

  @RunWith (SpringJUnit4ClassRunner.class) @ContextConfi Guration ("classpath: spring-config-test.xml") @transactional public class BaseTest {@Test public zero init () {Assert.assertEquals (15,15); }}  

Any suggestions?

due to: java.lang.ClassFormatError :. The attribute of the missing code ...

Indicates that you are a jar that involves not just the class and method signature but the method implementation is included

Often the reason That is, use one from javaee-api.jar .

Remove this jar! (And when necessary, replace it with the correct jar containing the code)

@See


Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

class - Kivy: how to instantiate a dynamic classes in python -

python - mayavi mapping a discrete colorbar on a surface -