NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
MrTerry
Joined: 01 Jun 2012 Posts: 1
|
Posted: Fri Jun 01, 2012 1:50 pm Post subject: Validation.buildDefaultValidatorFactory() throws error |
|
|
Hi,
im quite new to Maven/Hibernate
anyway... I've searched quite a while the google sites which provided the "answer" to my problem... but it didnt work out...
my Problem is, that i tried to validate my Entity "Card"
for that reason i wrote this :
| Code: |
ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
Validator validator = factory.getValidator();
if (validator.validate(newCard).isEmpty()) {
....
|
and got this error message for initialization of the ValidatorFactory :
Exception in thread "AWT-EventQueue-0" java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/validation/Validation
I've read that i need set dependencies, but nothing helped so far.
For my pom.xml :
Repositories :
| Code: |
<repository>
<url>http://download.java.net/maven/2/</url>
<id>hibernate-support</id>
<layout>default</layout>
<name>Repository for library Library[hibernate-support]</name>
</repository>
<repository>
<url>http://repo1.maven.org/maven2/</url>
<id>hibernate-support2</id>
<layout>default</layout>
<name>Repository for library Library[hibernate-support]</name>
</repository>
|
and dependencies :
| Code: |
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.0.2.GA</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>1.0.0.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.5.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.3.2.GA</version>
</dependency>
<dependency>
<groupId>javax.sql</groupId>
<artifactId>jdbc-stdext</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.0.1B</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-cglib-repack</artifactId>
<version>2.1_3</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.3.2.GA</version>
</dependency>
<dependency>
<groupId>unknown.binary</groupId>
<artifactId>mysql-connector-java-5.1.13-bin</artifactId>
<version>SNAPSHOT</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<type>jar</type>
</dependency>
|
i know it looks a bit messy, since i tried a bit before i postet here.
I hope u guys can help me!
Thx in advance!
Terry |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|