スタンドアロン アプリケーションに問題があります。以前は起動していましたが、eclipse を更新したか、それ以外の可能性があり、デスクトップ アプリケーションが起動できなくなりました。
そこでは SPRING 3.2.3、HIBERNATE 4.1、SQLite を使用しています。私は 64x ウィンドウで 32x Eclipse を使用し、Eclipse は 32x を使用しました Java JDK プロジェクトには Java コンパイラ v1.7 があります プロジェクトには JRE システム ライブラリ 1.7.0_21 があります (rt.jar が含まれています)
すべての組み合わせを試しましたが、まだ何も役に立ちませんでした。
それが何を意味するのか、そしてこの愚かな例外をどのように解決できるのかを理解するのを手伝ってください。
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'ABNHibSessionFactory' defined in URL
[file:/Q:/!PROJECTS/!JAVA/!DeskTop.PRJ/ABNPostBlank02/target/classes/META-
INF/database/Hibernate.xml]: Invocation of init method failed; nested exception is
java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract
in class file javax/validation/Validation
スタックトレースは次のとおりです。
>> !
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ABNHibSessionFactory' defined in URL [file:/Q:/!PROJECTS/!JAVA/!DeskTop.PRJ/ABNPostBlank02/target/clas
ses/META-INF/database/Hibernate.xml]: Invocation of init method failed; nested exception is java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in clas
s file javax/validation/Validation
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at info.abnsoft.java.postblank.gui.MainAppWindow.initMGroups(MainAppWindow.java:605)
at info.abnsoft.java.postblank.gui.MainAppWindow.createContents(MainAppWindow.java:135)
at org.eclipse.jface.window.Window.create(Window.java:431)
at org.eclipse.jface.window.Window.open(Window.java:790)
at info.abnsoft.java.postblank.gui.MainAppWindow$4.run(MainAppWindow.java:732)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at info.abnsoft.java.postblank.gui.MainAppWindow.main(MainAppWindow.java:723)
Caused by: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/validation/Validation
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:266)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:170)
at org.hibernate.cfg.beanvalidation.BeanValidationActivator.applyDDL(BeanValidationActivator.java:103)
at org.hibernate.cfg.Configuration.applyBeanValidationConstraintsOnDDL(Configuration.java:1704)
at org.hibernate.cfg.Configuration.applyConstraintsToDDL(Configuration.java:1654)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1445)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1856)
at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:184)
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:314)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
... 18 more
私の pom.xml :
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ABNPostBlank02</groupId>
<artifactId>ABNPostBlank02</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.applerao</groupId>
<artifactId>hibernatesqlite</artifactId>
<version>1.0</version>
<exclusions>
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.7.2</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.6</version>
</dependency>
<dependency>
<groupId>org.apache.directory.studio</groupId>
<artifactId>org.apache.commons.collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time-hibernate</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.1.6.Final</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>3.2.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.2.3.RELEASE</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.1.3dep-brew</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>hibernatesqlite-maven</id>
<url>https://hibernate-sqlite.googlecode.com/svn/trunk/mavenrepo</url>
</repository>
</repositories>
<properties>
<spring.orm.version>3.2.3.RELEASE</spring.orm.version>
</properties>
</project>