我有一个用Java(jdk 11)编写的Spring应用程序。
当我在机器上运行mvn clean package时,它会创建一个无法使用的jar。 如果另一台计算机创建了相同的jar,则它可以工作。 我在带有openjdk 11的ubuntu 19.04上运行mvn软件包,我的同事在具有相同jdk的ubuntu 18.10上运行相同的命令。
当我在计算机上部署jar时,出现了以下异常:
Error creating bean with name 'webSecurityConfig':
Unsatisfied dependency expressed through field 'userServices';
nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'userServices':
Unsatisfied dependency expressed through field 'esercenteUserRepository';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'esercenteUserRepository':
Cannot create inner bean '(inner bean)#150d80c4' of type
[org.springframework.orm.jpa.SharedEntityManagerCreator]
while setting bean property 'entityManager';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name '(inner bean)#150d80c4':
Cannot resolve reference to bean 'multiEntityManager' while setting
constructor argument;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'routingDataSourceConfig' defined in
URL [jar:file:/*.jar!/BOOT-INF/classes!/*/repos/RoutingDataSourceConfig.class]:
Invocation of init method failed;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'masterTransactionManager' defined in class path
resource [*/repos/DataSourceConfig.class]:
Initialization of bean failed;
nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException:
Error creating bean with name 'multiEntityManager':
Requested bean is currently in creation:
Is there an unresolvable circular reference?