Announcement Announcement Module
Collapse
No announcement yet.
problem in HibernateInterceptor Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • problem in HibernateInterceptor

    hi,
    I am using the following code it is giving the exeception

    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverM anagerDataSource"><property name="driverClassName">
    <value>oracle.jdbc.driver.OracleDriver</value>
    </property>
    <property name="url">
    <value>jdbc:oracle:oci:@//localhost:1521/ORCL</value>
    </property>
    <property name="username"> <value>scott</value> </property>
    <property name="password"> <value>tiger</value> </property>
    </bean>

    <bean id="hibernateSessionFactory" class="org.springframework.orm.hibernate.LocalSess ionFactoryBean">
    <property name="mappingResources">
    <list>
    <value>example.hbm.xml</value>
    <value>example1.hbm.xml</value>
    </list>
    </property>
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">net.sf.hibernate.dialect.O racleDialect</prop>
    <prop key="hibernate.show_sql">true</prop>
    <prop key="hibernate.cglib.use_reflection_optimizer">tru e</prop>
    </props>
    </property>
    <property name="dataSource">
    <ref bean="dataSource"/>
    </property>
    </bean>

    <bean id="hibernateInterceptor" class="org.springframework.orm.hibernate.Hibernate Interceptor">
    <property name="sessionFactory">
    <ref bean="hibernateSessionFactory"/>
    </property>
    </bean>


    org.springframework.beans.factory.BeanDefinitionSt oreException: Error registering bean with name 'hibernateInterceptor' defined in resource [/WEB-INF/spring-config.xml] of ServletContext: Class that bean class [org.springframework.orm.hibernate.HibernateInterce ptor] depends on not found; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor

    where is the problem.

    Thanks & regards
    Ajay

  • #2
    epends on not found; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor
    If you look closely at the exception you'll see that a class is not found - the dependencies of Spring (in this case aopalliance.jar) are not inside the classpath. Download spring-with-dependecies.jar and make sure to put spring.jar but also it's dependencies in your classpath/application server.

    Comment


    • #3
      Thanks Costin. The problem was missing aopalliance.jar

      Comment

      Working...
      X