Results 1 to 3 of 3

Thread: problem in HibernateInterceptor

  1. #1
    Join Date
    Dec 2004
    Posts
    14

    Default 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. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    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.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    Jun 2009
    Posts
    24

    Default

    Thanks Costin. The problem was missing aopalliance.jar

Similar Threads

  1. Problem with HibernateInterceptor
    By prane in forum Data
    Replies: 5
    Last Post: Oct 16th, 2007, 08:01 AM
  2. Replies: 1
    Last Post: Jul 5th, 2005, 03:48 AM
  3. pagination and continuation problem in SWF
    By yfmoan in forum Web Flow
    Replies: 6
    Last Post: Jun 29th, 2005, 03:42 AM
  4. Replies: 0
    Last Post: Feb 16th, 2005, 01:45 PM
  5. Lazy Load Problem when Doing UnitTest
    By yoshi in forum Data
    Replies: 7
    Last Post: Sep 29th, 2004, 10:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •