引起:org.springframework.beans.factory.CannotLoadBeanClassException:

时间:2017-07-05 05:58:20

标签: spring hibernate

WebDriverWait wait = new WebDriverWait(driver, 10);
WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.id(>someid>)));

2 个答案:

答案 0 :(得分:0)

i changed
  org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
 by 

org.springframework.orm.hibernate4.LocalSessionFactoryBean

Because in Hibernate4 AnnotationSessionFactoryBean is replaced by LocalSessionFactoryBean

替换

 <bean   class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFacoryBean" id="sessionFactory">

通过

<bean    class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" id="sessionFactory">

这解决了问题

答案 1 :(得分:0)

从错误日志中可以清楚地看出jvm找不到类

org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean

确保项目中存在依赖jar。如果您使用maven,则另外明智的做法是确保在spring-orm文件中添加相应的依赖项(pom.xml)。

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-orm</artifactId>
    <version>3.1.1.RELEASE</version>
</dependency>