1
我在spring-boot和jasper中更新鮮,試圖在我的演示項目中添加jasper報告但出現問題。 錯誤顯示每當我添加碧玉依賴項,如果依賴項已刪除或註釋的項目運行完美。「java.lang.NoSuchFieldError:LATEST」錯誤顯示添加了jasper報告依賴項時
的pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
\t xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
\t <modelVersion>4.0.0</modelVersion>
\t <groupId>com.example</groupId>
\t <artifactId>demo-project</artifactId>
\t <version>0.16.01</version>
\t <packaging>jar</packaging>
\t <name>example</name>
\t <description>project descrition not specified yet</description>
\t <parent>
\t \t <groupId>org.springframework.boot</groupId>
\t \t <artifactId>spring-boot-starter-parent</artifactId>
\t \t <version>1.4.2.RELEASE</version>
\t \t <relativePath /> <!-- lookup parent from repository -->
\t </parent>
\t <properties>
\t \t <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
\t \t <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
\t \t <java.version>1.8</java.version>
\t </properties>
\t <dependencies>
\t \t <dependency>
\t \t \t <groupId>org.activiti</groupId>
\t \t \t <artifactId>activiti-spring-boot-starter-basic</artifactId>
\t \t \t <version>5.21.0</version>
\t \t </dependency>
\t \t <dependency>
\t \t \t <groupId>org.springframework.boot</groupId>
\t \t \t <artifactId>spring-boot-starter-data-jpa</artifactId>
\t \t </dependency>
\t \t <dependency>
\t \t \t <groupId>org.springframework.boot</groupId>
\t \t \t <artifactId>spring-boot-starter-jdbc</artifactId>
\t \t </dependency>
\t \t <dependency>
\t \t \t <groupId>org.springframework.boot</groupId>
\t \t \t <artifactId>spring-boot-starter-security</artifactId>
\t \t </dependency>
\t \t <dependency>
\t \t \t <groupId>org.springframework.boot</groupId>
\t \t \t <artifactId>spring-boot-starter-thymeleaf</artifactId>
\t \t </dependency>
\t \t <dependency>
\t \t \t <groupId>org.springframework.boot</groupId>
\t \t \t <artifactId>spring-boot-starter-web</artifactId>
\t \t </dependency>
\t \t <dependency>
\t \t \t <groupId>mysql</groupId>
\t \t \t <artifactId>mysql-connector-java</artifactId>
\t \t \t <scope>runtime</scope>
\t \t </dependency>
\t \t <dependency>
\t \t \t <groupId>org.springframework.boot</groupId>
\t \t \t <artifactId>spring-boot-starter-test</artifactId>
\t \t \t <scope>test</scope>
\t \t </dependency>
\t \t <dependency>
\t \t \t <groupId>org.hibernate</groupId>
\t \t \t <artifactId>hibernate-search-orm</artifactId>
\t \t \t <version>5.5.5.Final</version>
\t \t </dependency>
\t \t <dependency>
\t \t \t <groupId>commons-io</groupId>
\t \t \t <artifactId>commons-io</artifactId>
\t \t \t <version>2.3</version>
\t \t </dependency>
\t \t <dependency>
\t \t \t <groupId>org.apache.chemistry.opencmis</groupId>
\t \t \t <artifactId>chemistry-opencmis-client-impl</artifactId>
\t \t \t <version>1.0.0</version>
\t \t </dependency>
\t \t <dependency>
\t \t \t <groupId>org.springframework.boot</groupId>
\t \t \t <artifactId>spring-boot-devtools</artifactId>
\t \t \t <optional>true</optional>
\t \t </dependency>
\t \t <dependency>
\t \t \t <groupId>org.projectlombok</groupId>
\t \t \t <artifactId>lombok</artifactId>
\t \t \t <scope>provided</scope>
\t \t </dependency>
\t \t <dependency>
\t \t \t <groupId>org.thymeleaf.extras</groupId>
\t \t \t <artifactId>thymeleaf-extras-springsecurity4</artifactId>
\t \t \t <version>2.1.3.RELEASE</version><!--$NO-MVN-MAN-VER$-->
\t \t </dependency>
\t \t <!--jasper Dependancy-->
\t \t <dependency>
\t \t \t <groupId>net.sf.jasperreports</groupId>
\t \t \t <artifactId>jasperreports</artifactId>
\t \t \t <version>5.6.0</version>
\t \t </dependency>
\t </dependencies>
\t <build>
\t \t <plugins>
\t \t \t <plugin>
\t \t \t \t <groupId>org.springframework.boot</groupId>
\t \t \t \t <artifactId>spring-boot-maven-plugin</artifactId>
\t \t \t </plugin>
\t \t </plugins>
\t </build>
</project>
錯誤
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoSuchFieldError: LATEST
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1583) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1081) ~[spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:856) ~[spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) ~[spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE]
at com.example.Demo.main(Demo.java:15) [classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_111]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_111]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_111]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_111]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-1.4.2.RELEASE.jar:1.4.2.RELEASE]
Caused by: java.lang.NoSuchFieldError: LATEST
at org.hibernate.search.cfg.Environment.<clinit>(Environment.java:213) ~[hibernate-search-engine-5.5.5.Final.jar:5.5.5.Final]
at org.hibernate.search.spi.SearchIntegratorBuilder.createCleanFactoryState(SearchIntegratorBuilder.java:280) ~[hibernate-search-engine-5.5.5.Final.jar:5.5.5.Final]
at org.hibernate.search.spi.SearchIntegratorBuilder.buildNewSearchFactory(SearchIntegratorBuilder.java:186) ~[hibernate-search-engine-5.5.5.Final.jar:5.5.5.Final]
at org.hibernate.search.spi.SearchIntegratorBuilder.buildSearchIntegrator(SearchIntegratorBuilder.java:117) ~[hibernate-search-engine-5.5.5.Final.jar:5.5.5.Final]
at org.hibernate.search.hcore.impl.HibernateSearchSessionFactoryObserver.sessionFactoryCreated(HibernateSearchSessionFactoryObserver.java:75) ~[hibernate-search-orm-5.5.5.Final.jar:5.5.5.Final]
at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryCreated(SessionFactoryObserverChain.java:35) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:532) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:879) ~[hibernate-entitymanager-5.0.11.Final.jar:5.0.11.Final]
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:60) ~[spring-orm-4.3.4.RELEASE.jar:4.3.4.RELEASE]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:353) ~[spring-orm-4.3.4.RELEASE.jar:4.3.4.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:373) ~[spring-orm-4.3.4.RELEASE.jar:4.3.4.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:362) ~[spring-orm-4.3.4.RELEASE.jar:4.3.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1642) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1579) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
... 21 common frames omitted