相关疑难解决方法(0)

强制maven更新

我在其他计算机上导入了我的工作项目,因此它开始下载依赖项.

显然在此期间我的互联网连接崩溃了.现在我得到:

为漫画构建错误; org.apache.maven.lifecycle.LifecycleExecutionException:无法在项目漫画上执行目标测试:无法解析项目漫画的依赖项测试:漫画测试:war:0.0.1-SNAPSHOT:无法解析以下工件:org.springframework:spring- context:jar:3.0.5.RELEASE,org.hibernate:hibernate-entitymanager:jar:3.6.0.Final,org.hibernate:hibernate-core:jar:3.6.0.Final,org.hibernate:hibernate-commons-注释:jar:3.2.0.Final,org.aspectj:aspectjweaver:jar:1.6.8,commons-lang:commons-lang:jar:2.5,

mysql:mysql-connector-java:jar:5.1.13:无法传输org.springframework:来自http://repo1.maven.org/maven2的 spring-context:jar:3.0.5.RELEASE 缓存在本地存储库中,在中心的更新间隔过去或强制更新之前,不会重新尝试解析.

原始错误:无法传输工件org.springframework:spring-context:jar:3.0.5.RELEASE from central(http://repo1.maven.org/maven2):60000后没有收到回复

我不知道如何强制maven更新?

maven

682
推荐指数
12
解决办法
79万
查看次数

java.lang.ClassNotFoundException:org.hibernate.ejb.HibernatePersistence

我正在尝试在以下环境中部署应用程序.

  • JPA 2.0
  • 春天3.2.2
  • MySQL 5.6.11

到目前为止我在application-context.xml文件中的配置如下.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:p="http://www.springframework.org/schema/p"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">


    <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
        <property name="persistenceUnitName" value="WebAppPU"/>
        <!--<property name="jpaVendorAdapter">
            <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                <property name="showSql" value="true"/>
                <property name="generateDdl" value="true"/>
                <property name="databasePlatform" value="org.hibernate.dialect.HSQLDialect"/>
            </bean>
        </property>-->
    </bean>

    <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>

    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory"/>
    </bean>

    <tx:annotation-driven transaction-manager="transactionManager"/>

    <bean id="testDAOService" class="admin.dao.TestDAO"/>
</beans>
Run Code Online (Sandbox Code Playgroud)

这可以正常工作,直到上面的xml文件中的注释行被取消注释.当这些行被取消注释时,我得到以下异常.

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot create inner …
Run Code Online (Sandbox Code Playgroud)

spring hibernate jpa

21
推荐指数
1
解决办法
9万
查看次数

标签 统计

hibernate ×1

jpa ×1

maven ×1

spring ×1