Announcement Announcement Module
Collapse
No announcement yet.
Missing error messages for SingletonBeanFactoryLocator Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Missing error messages for SingletonBeanFactoryLocator

    Hello,

    we use the SingletonBeanFactoryLocator for accessing our Spring Beans. When we upgraded from Spring 1.0.2 to Spring 1.1.1 we realized that errors during the creation of our ApplicationContexts are not reported in detail anymore. With Spring 1.0.2 we saw "nice" stack traces and nested exceptions which were always quite instructive for finding our errors (e.g., bean property not writable, ...).

    But now, even in the Spring debug log there is no indication of what happended; the ApplicationContexts are destroyed and the SingletonBeanFactoryLocator throws a FatalBeanException (log below).

    Code:
    12:09:03,632 INFO  [DefaultListableBeanFactory] Creating shared instance of singleton bean 'ESNDataSource'
    12:09:03,632 DEBUG [DefaultListableBeanFactory] Creating instance of bean 'ESNDataSource' with merged definition [Root bean with class [org.apache.commons.dbcp.BasicDataSource] defined in class path resource [EsnDataAccessBeans.xml]]
    12:09:03,632 DEBUG [CachedIntrospectionResults] Getting BeanInfo for class [org.apache.commons.dbcp.BasicDataSource]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Caching PropertyDescriptors for class [org.apache.commons.dbcp.BasicDataSource]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'accessToUnderlyingConnectionAllowed' of type [boolean]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'class' of type [class java.lang.Class]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'connection' of type [interface java.sql.Connection]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'defaultAutoCommit' of type [boolean]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'defaultCatalog' of type [class java.lang.String]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'defaultReadOnly' of type [boolean]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'defaultTransactionIsolation' of type [int]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'driverClassName' of type [class java.lang.String]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'initialSize' of type [int]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'logAbandoned' of type [boolean]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'logWriter' of type [class java.io.PrintWriter]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'loginTimeout' of type [int]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'maxActive' of type [int]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'maxIdle' of type [int]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'maxOpenPreparedStatements' of type [int]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'maxWait' of type [long]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'minEvictableIdleTimeMillis' of type [long]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'minIdle' of type [int]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'numActive' of type [int]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'numIdle' of type [int]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'numTestsPerEvictionRun' of type [int]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'password' of type [class java.lang.String]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'poolPreparedStatements' of type [boolean]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'removeAbandoned' of type [boolean]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'removeAbandonedTimeout' of type [int]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'testOnBorrow' of type [boolean]; editor=[null]
    12:09:03,648 DEBUG [CachedIntrospectionResults] Found property 'testOnReturn' of type [boolean]; editor=[null]
    12:09:03,664 DEBUG [CachedIntrospectionResults] Found property 'testWhileIdle' of type [boolean]; editor=[null]
    12:09:03,664 DEBUG [CachedIntrospectionResults] Found property 'timeBetweenEvictionRunsMillis' of type [long]; editor=[null]
    12:09:03,664 DEBUG [CachedIntrospectionResults] Found property 'url' of type [class java.lang.String]; editor=[null]
    12:09:03,664 DEBUG [CachedIntrospectionResults] Found property 'username' of type [class java.lang.String]; editor=[null]
    12:09:03,664 DEBUG [CachedIntrospectionResults] Found property 'validationQuery' of type [class java.lang.String]; editor=[null]
    12:09:03,664 DEBUG [CachedIntrospectionResults] Class [org.apache.commons.dbcp.BasicDataSource] is cache-safe
    12:09:03,664 INFO  [DefaultListableBeanFactory] Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [x,ESNDataSource,ESNSessionFactory,transactionManager,commandDao,businessDataDao,viewDataDao,ESNTransactionManager,businessDataService,filterSettlsTrades,filterStandings,filterKontrahenten,filterStati,filterDataDao,filterDataDaoTarget,availStati]; Root of BeanFactory hierarchy}
    12:09:03,664 INFO  [DefaultListableBeanFactory] Destroying inner beans in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [x,ESNDataSource,ESNSessionFactory,transactionManager,commandDao,businessDataDao,viewDataDao,ESNTransactionManager,businessDataService,filterSettlsTrades,filterStandings,filterKontrahenten,filterStati,filterDataDao,filterDataDaoTarget,availStati]; Root of BeanFactory hierarchy}
    12:09:03,664 INFO  [DefaultListableBeanFactory] Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [baag.boa.esn.dataAccess,baag.boa.esn.commands,baag.boa.esn]; Root of BeanFactory hierarchy}
    12:09:03,664 INFO  [DefaultListableBeanFactory] Destroying inner beans in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [baag.boa.esn.dataAccess,baag.boa.esn.commands,baag.boa.esn]; Root of BeanFactory hierarchy}
    org.springframework.beans.FatalBeanException: Unable to load group definition. Group resource name [classpath*:beanRefFactory.xml], factory key [baag.boa.esn]
    	at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.createDefinition(SingletonBeanFactoryLocator.java:479)
    	at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:373)
    	at baag.boa.esn.server.workflowfwtest.SettlementGenerationTest.init(SettlementGenerationTest.java:89)
    	at baag.boa.esn.server.workflowfwtest.SettlementGenerationTest.main(SettlementGenerationTest.java:39)
    Exception in thread "main"
    Did we miss something important here?
    Does anybody have the same problem?

    Thanks in advance for any comments!

  • #2
    So, to answer it myself (after looking at the source code of
    SingletonBeanFactoryLocator), a BeansException ist caught, but not used any
    further as nested exception to the FatalBeanException or for a log message.

    Comment


    • #3
      This code got refactored for 1.1.1 to work better in some appservers like Orion, and the nested error, which _was_ being attached before (1.1 and before), accidentally stopped being included.

      This was discovered and fixed about 3 weeks ago. You may use the CVS version, which should generally be quite safe, as we are ready to release 1.1.2 this weekend...

      Comment

      Working...
      X