[kaffe] Bug Report: kaffe doesn't work with spring framework's IoC container
    Aldous Penaranda 
    adpenaranda at gmail.com
       
    Tue Jul 12 20:40:30 PDT 2005
    
    
  
Hello,
I tried using kaffe to run a simple application that uses the spring
framework[1]'s IoC[2] container (version 1.2.2).
My main method looks like this:
  public static void main( String[] args ) {
    XmlBeanFactory factory = new XmlBeanFactory(new
    ClassPathResource("beans.xml"));
    /*
     * Abstract is an abstract class and "bean" is a concrete
     * implementation of that class. "bean" is defined in beans.xml
     */
    Abstract abs = (Abstract)factory.getBean("bean");
  }
My beans.xml file contains this:
  <beans>
    <bean id="bean" class="testing.Concrete" />
  </beans>
testing.Concrete extends the Abstract class.
My main method basically means that I want to instantiate a class that
implements/inherits from Abstract.
Yesterday, I tried to run my app using kaffe, and got this error:
  org.springframework.beans.factory.NoSuchBeanDefinitionException: No
  bean named '' is defined:
  org.springframework.beans.factory.xml.XmlBeanFactory defining beans
  [bean]; root of BeanFactory hierarchy
Notice that it seems to be trying to get a bean named '' (null string)
but I have already specified in my code that I want a bean named
'bean'. Also note that it had successfully read my beans.xml file
because it listed my defined bean -> [bean].
I tried this with Debian stable's kaffe and kaffe from CVS. Both tries
resulted in the above errors. I then tried it using Sun's JVM and it
worked, resulting in the testing.Concrete class being instantiated.
I then tried to change:
  Abstract abs = (Abstract)factory.getBean("bean");
to
  Abstract abs = (Abstract)factory.getBean("test");
The error becomes:
  org.springframework.beans.factory.NoSuchBeanDefinitionException: No
  bean named 'test' is defined:
  org.springframework.beans.factory.xml.XmlBeanFactory defining beans
  [bean]; root of BeanFactory hierarchy
which is correct, because there really is no 'test' bean defined in
beans.xml. Both kaffe and Sun's jvm fails here.
I hope I provided enough information. :)
[1] http://www.springframework.org/
[2] Inversion of Control or Dependency Injection
--
GPG Key ID: 0xD6655C18
Linux Just Simply Rocks!
http://deathwing.penarmac.com/
Registered Linux User #327776
    
    
More information about the kaffe
mailing list