使用propertiesLauncher(布局为ZIP)时,我们似乎遇到了问题。当我们使用或不使用-Dloader.path运行jar时
java -jar myuberjar.jar
我们一直收到错误消息,说它无法找到myuberjar.jar中存在的jar文件
Caused by: java.lang.IllegalArgumentException: File [/Users/myuser/myuberjar.jar!/lib/jackson-module-jaxb-annotations-2.5.4.jar] referenced by given URL [file:/Users/myuser/myuberjar.jar!/lib/jackson-module-jaxb-annotations-2.5.4.jar] does not exist
at org.hibernate.jpa.boot.archive.internal.StandardArchiveDescriptorFactory.buildArchiveDescriptor(StandardArchiveDescriptorFactory.java:73)
at org.hibernate.jpa.boot.archive.internal.JarProtocolArchiveDescriptor.<init>(JarProtocolArchiveDescriptor.java:71)
at org.hibernate.jpa.boot.archive.internal.StandardArchiveDescriptorFactory.buildArchiveDescriptor(StandardArchiveDescriptorFactory.java:55)
at org.hibernate.jpa.boot.archive.internal.StandardArchiveDescriptorFactory.buildArchiveDescriptor(StandardArchiveDescriptorFactory.java:48)
at org.hibernate.jpa.boot.scan.spi.AbstractScannerImpl.buildArchiveDescriptor(AbstractScannerImpl.java:95)
at org.hibernate.jpa.boot.scan.spi.AbstractScannerImpl.scan(AbstractScannerImpl.java:70)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.scan(EntityManagerFactoryBuilderImpl.java:725)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:221)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:188)
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider$1.<init>(SpringHibernateJpaPersistenceProvider.java:49)
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:49)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:343)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
不确定我们缺少什么。
SpringBoot - 1.2.4.RELEASE JDK1.8 PropertiesLauncher
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<layout>ZIP</layout>
</configuration>
</plugin>
当我提取uberjar时,我可以看到lib文件夹中的所有jar。 Bellow是清单文件的内容
Manifest-Version: 1.0
Implementation-Title: AppService
Implementation-Version: 0.0.1-SNAPSHOT
Archiver-Version: Plexus Archiver
Built-By: avinash
Start-Class: com.company.app.AppServiceApplication
Implementation-Vendor-Id: com.company.services.app
Spring-Boot-Version: 1.2.4.RELEASE
Created-By: Apache Maven 3.2.1
Build-Jdk: 1.8.0_25
Implementation-Vendor: Pivotal Software, Inc.
Main-Class: org.springframework.boot.loader.PropertiesLauncher
答案 0 :(得分:0)
问题不在于Spring Boot属性启动器,而是在Hibernate jar中有更多问题,如下面的错误所述。