我在添加一个Java模块作为项目的依赖项时遇到了异常。
例外是:
错误o.s.boot.SpringApplication-应用程序运行失败org.springframework.beans.factory.BeanCreationException:创建类名称为'entityManagerFactory'的bean时出错 资源[org / springframework / boot / autoconfigure / orm / jpa / HibernateJpaConfiguration.class]:通过工厂方法实例化Bean失败;嵌套的异常是org.springframework.beans.BeanInstantiationException:失败 实例化[org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]:工厂方法'entityManagerFactory'抛出异常;嵌套的异常是java.lang.AbstractMethodError: com.zaxxer.hikari.metrics.micrometer.MicrometerMetricsTrackerFactory.create(Ljava / lang / String; Lcom / zaxxer / hikari / metrics / PoolStats;)Lcom / zaxxer / hikari / metrics / MetricsTracker; \ n 在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory处org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:591)\ n。 InstantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1246)\ n在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1096)\ n 位于org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:535)\ n在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory处。 createBean(AbstractAutowireCapableBeanFactory.java:495)\ n 在org.springframework.beans.factory.support.AbstractBeanFactory.lambda $ doGetBean $ 0(AbstractBeanFactory.java:317)\ n在org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)\ n在org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)\ n在org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)\ n在org.springframework。 Context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1109)\ n在org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)\ n在org.springframework.context.support.AbstractApplicationContext.refresh( org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)\ n在org.springframework.boot的AbstractApplicationContext.java:551)\n SpringApplication.refresh(SpringApplication.java:754)\ n在org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:386)\ n在org.springframework.boot.SpringApplication.run(SpringApplication.java:307)\ n在org.springframework.boot.SpringApplication.run(SpringApplication.java:1242)\ n在org.springframework.boot.SpringApplication.run(SpringApplication.java:1230)\ n在com.jpmc.gicb.wfxRequests.WFXRequestApplication.main (WFXRequestApplication.java:17)\n原因:org.springframework.beans.BeanInstantiationException:无法实例化[org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]:工厂方法'entityManagerFactory'抛出异常;嵌套异常为java.lang.AbstractMethodError:com.zaxxer.hikari.metrics.micrometer.MicrometerMetricsTrackerFactory.create(Ljava / lang / String; Lcom / zaxxer / hikari / metrics / PoolStats;)Lcom / zaxxer / hikari / metrics / MetricsTracker; \ n在org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)\ n在org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:583)\ n。 。18个常见的框架被省略\ n原因:java.lang.AbstractMethodError:com.zaxxer.hikari.metrics.micrometer.MicrometerMetricsTrackerFactory.create(Ljava / lang / String; Lcom / zaxxer / hikari / metrics / PoolStats;)Lcom / zaxxer / hikari / metrics / MetricsTracker; \ n在com.zaxxer.hikari.pool.HikariPool.setMetricsTrackerFactory(HikariPool.java:273)\ n在com.zaxxer.hikari.pool.HikariPool。(HikariPool.java:115)\ n在com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:97)\ n在org.springframework.jdbc.dataso urce.DataSourceUtils.fetchConnection(DataSourceUtils.java:157)\ n在org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115)\ n在org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils。 java:78)\ n在org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:323)\ n在org.springframework.boot.jdbc.EmbeddedDatabaseConnection.isEmbedded(EmbeddedDatabaseConnection.java:123)\ n在org .springframework.boot.autoconfigure.orm.jpa.HibernateDefaultDdlAutoProvider.getDefaultDdlAuto(HibernateDefaultDdlAutoProvider.java:42)\ n在org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration.lambda $ getVendorProperties $ 0(HibernateJpaConfiguration .: n在org.springframework.boot.autoconfigure.orm.jpa.HibernateSettings.getDdlAuto(HibernateSettings.java:53)\ n在org.springframework.boot.autoconfigure.orm.jpa.JpaProperties $ Hibernate.determineDdlAuto(JpaProperties.java:247 )\ n在org.springframework.boot.au toconfigure.orm.jpa.JpaProperties $ Hibernate.getAdditionalProperties(JpaProperties.java:216)\ n在org.springframework.boot.autoconfigure.orm.jpa.JpaProperties $ Hibernate.access $ 000(JpaProperties.java:169)\ n在org org.springframework.boot.autoconfigure.orm.jpa.JpaProperties.getHibernateProperties(JpaProperties.java:153)\ n在org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration.getVendorProperties(HibernateJpaConfiguration.java:134)\ n在org .springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.entityManagerFactory(JpaBaseConfiguration.java:136)\ n在org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration $$ EnhancerBySpringCGLIB $ 75e195f5.CGLIB $ entityManagerFactory $ 6() \ n在org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration $$ EnhancerBySpringCGLIB $$ 75e195f5 $$ FastClassBySpringCGLIB $$ 7290b124.invoke()\ n在org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy。 :228)\ n在org.springframework.conte xt.annotation.ConfigurationClassEnhancer $ BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:365)\ n在org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration $$ EnhancerBySpringCGLIB $$ 75e195f5.entityManagerFactory()\ n在sun.reflect.NativeMethodAccess .invoke0(本机方法)\ n在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\ n在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\ n在java.lang.reflect.Method .invoke(Method.java:498)\ n在org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)\ n ...省略了19个常见框架\ n 与目标VM断开连接,地址:“ 127.0.0.1:57203”,传输:“套接字”
以退出代码1完成的过程
我知道,这是依赖性问题。我浏览了其他stackoverflow问题,但似乎无济于事。
主项目的pom.xml
<dependencies>
<dependency>
<groupId>com.something</groupId>
<artifactId>other-project-data</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.1.0.7.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
<version>8.0.53</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.mail/javax.mail-api -->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
</dependency>
</dependencies>
其他项目数据的pom
<dependencies>
<dependency>
<groupId>com.something</groupId>
<artifactId>other-project-commons</artifactId>
<version>1.0.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.11</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.11</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.11</version>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>6.4.1</version>
<exclusions>
<exclusion>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
<version>63.1</version>
</dependency>
<dependency>
<groupId>${app.group.id}</groupId>
<artifactId>jazzy-core</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/${app.lib}/jazzy-core-1.0.jar</systemPath>
</dependency>
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>4.2.1</version>
</dependency>
<dependency>
<groupId>${app.group.id}</groupId>
<artifactId>aspose-cells</artifactId>
<version>8.7.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/${app.lib}/aspose-cells-8.7.0.jar</systemPath>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>${app.group.id}</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
<scope>system</scope>
<systemPath>${project.basedir}/${app.lib}/commons-io-1.4.jar</systemPath>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>xmpbox</artifactId>
<version>1.8.8</version>
</dependency>
</dependencies>
其他项目常用的pom
<properties>
<hibernate.version>3.2.1.GA</hibernate.version>
</properties>
<dependencies>
<!-- add ons -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.18.Final</version>
</dependency>
<dependency>
<groupId>org.apache.ibatis</groupId>
<artifactId>ibatis-core</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<!-- add ons -->
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>${antlr.version}</version>
</dependency>
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>${asm.version}</version>
</dependency>
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>${c3p0.version}</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>${cglib.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts.xwork</groupId>
<artifactId>xwork-core</artifactId>
<version>${strutsframework.version}</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>${dom4j.version}</version>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.11.0.GA</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>${mail.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>${jstl.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>${servlet-api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>${jsp-api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>${jta.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>geronimo-spec</groupId>
<artifactId>geronimo-spec-javamail</artifactId>
</exclusion>
<exclusion>
<groupId>geronimo-spec</groupId>
<artifactId>geronimo-spec-jms</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>ognl</groupId>
<artifactId>ognl</artifactId>
<version>3.0.6</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-spring</artifactId>
<version>5.13.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${springframework.version}</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>${standard.version}</version>
</dependency>
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.2</version>
</dependency>
<!-- QuartzJobBean in spring-context-support.jar -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${springframework.version}</version>
</dependency>
<!-- Spring Batch dependencies --><!--
<dependency>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-core</artifactId>
<version>${spring.batch.version}</version>
</dependency>-->
<dependency>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-infrastructure</artifactId>
<version>${spring.batch.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version> </dependency> -->
<!-- ******* Libraries required for Testing -->
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>${commons-dbcp.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>commons-pool</artifactId>
<groupId>commons-pool</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.owasp</groupId>
<artifactId>csrfguard</artifactId>
<version>${csrfguard.version}</version>
</dependency>
<!-- Specific to Project 1 -->
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>org.owasp.antisamy</groupId>
<artifactId>antisamy</artifactId>
<version>1.4.4</version>
<exclusions>
<exclusion>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-util</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-css</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-full</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>${commons-beanutils.version}</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>${commons-collections.version}</version>
</dependency>
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>${commons-httpclient.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>${commons-lang.version}</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging-adapters</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.owasp.esapi</groupId>
<artifactId>esapi</artifactId>
<version>2.1.0</version>
<exclusions>
<exclusion>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
</dependency>
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>4.2.1</version>
</dependency>
<dependency>
<groupId>javax.j2ee</groupId>
<artifactId>j2ee</artifactId>
<version>1.3.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>avalon-logkit</groupId>
<artifactId>avalon-logkit</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>nekohtml</groupId>
<artifactId>nekohtml</artifactId>
<version>1.9.14</version>
</dependency>
<dependency>
<groupId>ojdbc6</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.1.0.7.0-Production</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.6</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.6</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.6</version>
</dependency>
<dependency>
<groupId>com.crystaldecisions</groupId>
<artifactId>xercesImpl-2.8.1</artifactId>
<version>12.3.1.684</version>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.3.0</version>
</dependency>
</dependencies>
如果休眠依赖项有任何问题或如何解决该问题,有人可以指导我吗?
编辑 在commons pom中,我看到spring-boot-starter-data-jpa显示冲突。
我已经添加了一个屏幕截图,请告诉我是否需要更改某些内容。主项目中也存在此依赖项。我试图将其注释掉并运行该项目,但仍然出现相同的错误。
谢谢
答案 0 :(得分:0)
是否可以从常见pom.xml中删除“休眠核心”的显式依赖关系。
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.18.Final</version>
</dependency>
在主pom.xml中添加的Spring JPA依赖项应该带来休眠依赖项。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
以上依赖项将包括JPA API,JPA实现,JDBC和其他所需的库。由于默认的JPA实现是Hibernate,因此这种依赖关系实际上足以实现它。