Results 1 to 7 of 7

Thread: Could not instantiate class SqlMapClientFactoryBean

  1. #1

    Default Could not instantiate class SqlMapClientFactoryBean

    I have problem with iBatis on production environment (Linux + Tomcat 5.0.30).

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean
    with name 'sqlMapClient' defined in ServletContext reso
    urce [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested
    exception is org.springframework.beans.FatalBeanExcepti
    on: Could not instantiate class
    [org.springframework.orm.ibatis.SqlMapClientFactory Bean]; constructor threw
    exception; nested except
    ion is java.lang.NoClassDefFoundError:
    com.ibatis.sqlmap.engine.transaction.external.Exte rnalTransactionConfig
    org.springframework.beans.FatalBeanException: Could not instantiate class
    [org.springframework.orm.ibatis.SqlMapClientFactory Bean];
    constructor threw exception; nested exception is java.lang.NoClassDefFoundError:
    com.ibatis.sqlmap.engine.transaction.external.Exte r
    nalTransactionConfig
    java.lang.NoClassDefFoundError:
    com.ibatis.sqlmap.engine.transaction.external.Exte rnalTransactionConfig
    at
    org.springframework.orm.ibatis.SqlMapClientFactory Bean.class$(SqlMapClientFactoryBean.java:84)
    at
    org.springframework.orm.ibatis.SqlMapClientFactory Bean.<init>(SqlMapClientFactoryBean.java:84)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    at
    sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
    at
    sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Construc tor.java:274)
    at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:78)
    at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:55)
    at
    org.springframework.beans.factory.support.SimpleIn stantiationStrategy.instantiate(SimpleInstantiatio nStrategy.java:48)
    at
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactor
    y.java:310)


    iBatis jars (ibatis-common-2.jar, ibatis-sqlmap-2.jar) are in /WEB-INF/lib. I tried to copy these jars into tomcat_home/shared/lib, but result was same. On windows machine same war works fine. Any suggestion?

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    [org.springframework.orm.ibatis.SqlMapClientFactory Bean];
    constructor threw exception; nested exception is java.lang.NoClassDefFoundError:
    com.ibatis.sqlmap.engine.transaction.external.Exte r
    nalTransactionConfig
    I haven't worked with ibatis but if the classes are inside the .jars you mentioned then make sure they are on the classpath - I assume you have a different configuration on Linux then on Windoze.
    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

    Default

    Quote Originally Posted by costin
    [org.springframework.orm.ibatis.SqlMapClientFactory Bean];
    constructor threw exception; nested exception is java.lang.NoClassDefFoundError:
    com.ibatis.sqlmap.engine.transaction.external.Exte r
    nalTransactionConfig
    I haven't worked with ibatis but if the classes are inside the .jars you mentioned then make sure they are on the classpath - I assume you have a different configuration on Linux then on Windoze.
    How do you set jars from webapplication to classpath inside application server? AFAIK is sufficient place these jars to the webapplication/WEB-INF/lib direcotry. These jars are loaded by specific AS classloader. I don`t know why Tomcat on Linux (Sarge) ignores these jars.

  4. #4
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Does the user/group which under tomcat runs has read right to them ? You can also put them in shared/lib.
    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

  5. #5

    Default

    Quote Originally Posted by costin
    Does the user/group which under tomcat runs has read right to them ? You can also put them in shared/lib.
    I am not sure, is it enough?
    -rw-r--r-- 1 root root 81977 2005-07-31 10:46 ibatis-common-2.jar
    -rw-r--r-- 1 root root 275485 2005-07-31 10:46 ibatis-sqlmap-2.jar

    How i mentioned above, placing these jars into shared/lib, but it hadn`t effect.

  6. #6
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Yes it is. Again make sure no library is missing and that there are no other conflicts (older ibatis libraries) that might get loaded first (somewhere in the shared/lib or common directories).
    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

  7. #7

    Default

    Quote Originally Posted by costin
    Yes it is. Again make sure no library is missing and that there are no other conflicts (older ibatis libraries) that might get loaded first (somewhere in the shared/lib or common directories).
    well problem was in buggy Tomcat classloader, when was ibatis jars deployed to jre/lib/ext application works fine.

Similar Threads

  1. Order of Bean definitions matters?
    By cfuser in forum Container
    Replies: 2
    Last Post: Oct 21st, 2005, 10:29 AM
  2. Spring container fails with no exception
    By naor in forum Container
    Replies: 9
    Last Post: Oct 1st, 2005, 03:39 PM
  3. EHCaching Hibernate
    By dencamel in forum Data
    Replies: 3
    Last Post: Sep 6th, 2005, 09:03 PM
  4. Replies: 3
    Last Post: Sep 4th, 2005, 11:11 PM
  5. Stack Overflow
    By rayho222 in forum Container
    Replies: 6
    Last Post: May 17th, 2005, 03:42 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
  •