我有一個大的Web應用程序(在weblogic的11克運行)的嵌套異常使用春天,彈簧安全,MyBatis的和MyBatis的彈簧的組合。它使用mybatis:使用標記界面(DataAccess
)掃描以將SqlSessionFactory
連接到我們的DAO。我們有61個擴展標記接口的類(接口)。BeanCreationException用的StackOverflowError
當我們添加一個擴展了DataAccess
(標記)的接口時,應用程序無法啓動。我想知道是否有人可以幫助弄清楚爲什麼再添加一個DataAccess
會導致應用程序出現這些錯誤。
我可以提供任何有助於弄清楚這一點的信息,但我不知道我最初的問題中應包括什麼。
這裏是在log4j的日誌文件中的前兩個錯誤:
2014-Jul-14 12:58:22.659 [ACTIVE] ExecuteThread: '40' for queue: 'weblogic.kernel.Default (self-tuning)' DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory Ignoring bean creation exception on FactoryBean type check: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'paymentsDataAccess' defined in file [/opt/..../tmp/_WL_user/..../an9ko4/APP-INF/classes/com/..../payment/app/dao/PaymentsDataAccess.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': : Error creating bean with name 'sqlSessionFactory' defined in class path resource [ServiceConfig.xml]: Instantiation of bean failed; nested exception is java.lang.StackOverflowError; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [ServiceConfig.xml]: Instantiation of bean failed; nested exception is java.lang.StackOverflowError
2014-Jul-14 12:58:22.666 [ACTIVE] ExecuteThread: '40' for queue: 'weblogic.kernel.Default (self-tuning)' DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory Ignoring bean creation exception on FactoryBean type check: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'adminSessionDataAccess' defined in file [/opt/..../tmp/_WL_user/..../an9ko4/APP-INF/classes/com/..../dao/AdminSessionDataAccess.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': : Error creating bean with name 'sqlSessionFactory' defined in class path resource [ServiceConfig.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.mybatis.spring.SqlSessionFactoryBean; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [ServiceConfig.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.mybatis.spring.SqlSessionFactoryBean
的第一個錯誤有StackOverflowError
的嵌套例外,當我看着生成的堆棧跟蹤調用棧是深度超過1000種方法。如果被問到,我可以提供堆棧跟蹤,但是如此大,除非有興趣,否則我不想包含它。
PaymentsDataAccess
類不是什麼特別的 - 它就像應用程序中的其他數據訪問類一樣。
當應用程序沒有啓動看起來也似乎是另一個錯誤(server.log中),但我不知道這是否是相關的:
java.lang.instrument ASSERTION FAILED: "!errorOutstanding" with message transform method call failed at ../../../src/share/instrument/JPLISAgent.c line: 805
java.lang.NoClassDefFoundError:無法初始化類org.mybatis.spring.SqlSessionFactoryBean – JamesB
是的,但是當少一個DataAccess bean時初始化就好了。另外,除非是儀器故障,否則沒有任何跡象表明初始化失敗。 –