Results 1 to 4 of 4

Thread: Can someone explain this bean instantiation error

  1. #1

    Default Can someone explain this bean instantiation error

    I added a bean to my Spring daoContext.xml and I'm getting the following error message when the container tries to instantiate the bean.

    org.springframework.beans.FatalBeanException: Could not instantiate class[myapp.dao.inventoryDao];
    has class definition changed?
    Is there a public no-arg constructor?;
    nested exception is java.lang.IllegalAccessException:
    Class org.springframework.beans.BeanUtils can not access a member of class myapp.dao.inventoryDao with modifiers "public"

    I am not trying to set any properties. The definition is:
    <bean id="inventoryDao" class="myapp.dao.inventoryDao" >
    </bean>

    There is a public no-arg constructor and the class file is current.

    What is the error message referring to?

  2. #2

    Default

    Hi,

    are you sure your actual class is InventorDao - or is it possible that this is only an interface?

    Only a thought ...

    Simon

  3. #3
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    Some more thoughts:

    - It could be a typo. You wrote "inventoryDao" with a lowercase "i"
    - The class is possibly not public

    Regards,
    Andreas

  4. #4

    Default Thanks Andreas

    Andreas, your second thought was correct. The class was not declared public. The error message had me focused on attributes and I did not see the forest for the trees.

    Thanks again!

Similar Threads

  1. Spring container fails with no exception
    By naor in forum Container
    Replies: 9
    Last Post: Oct 1st, 2005, 03:39 PM
  2. Context initialization failed
    By kanonmicke in forum Container
    Replies: 7
    Last Post: Sep 29th, 2005, 12:35 AM
  3. EHCaching Hibernate
    By dencamel in forum Data
    Replies: 3
    Last Post: Sep 6th, 2005, 09:03 PM
  4. could not satisfy dependencies
    By springuser in forum Container
    Replies: 4
    Last Post: Apr 26th, 2005, 01:15 PM
  5. Replies: 1
    Last Post: Apr 25th, 2005, 07:37 PM

Posting Permissions

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