Announcement Announcement Module
Collapse
No announcement yet.
Using declarative transactions: BeanCreationException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using declarative transactions: BeanCreationException

    I'm using the latest Spring JAR, JVM 1.4, Sun AppServer.
    I wrote a declarative transaction to proxy one of my service classes (which calls a number of methods in DAOs that use Spring JDBC.)
    In principle, everything's fine because it works - at least here in my develpment PC (Sun Application Server is running locally on Windows). But... the same WAR file that works here doesn't work on another machine, a Unix system. Something about this proxied service is failing. I tend to think it's some missing dependency, but how come it works in my system?!

    I get this:

    org.springframework.beans.factory.BeanCreationExce ption
    Error creating bean with name 'portfolioSvc' defined in class path resource [beans.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError

    Here's part of the stack trace (ask for more if relevant!):

    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1336)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:471)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:409)
    java.security.AccessController.doPrivileged(Native Method)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:380)
    (...)

    This is the tail of the app log when it fails:

    17 Apr 2008 12:42:16,376 DEBUG AbstractAutowireCapableBeanFactory:1532 - portfolioSvc {org.springframework.transaction.interceptor.Trans actionProxyFactoryBean}
    17 Apr 2008 12:42:16,379 DEBUG AbstractAutowireCapableBeanFactory:1569 - Invoking afterPropertiesSet() on bean with name 'portfolioSvc'
    17 Apr 2008 12:42:16,383 DEBUG DefaultListableBeanFactory:1572 - Invoking afterPropertiesSet() on bean with name 'portfolioSvc'
    17 Apr 2008 12:42:16,454 DEBUG CollectionFactory:203 - Falling back to plain synchronized [java.util.HashMap] for concurrent map
    17 Apr 2008 12:42:16,651 DEBUG Cglib2AopProxy:150 - Creating CGLIB2 proxy: target source is SingletonTargetSource for target object [com.equifax.alertas.service.PortfolioService@1aa70 ef]
    17 Apr 2008 12:42:16,953 INFO DefaultListableBeanFactory:392 - Destroying singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@85ba73: defining beans [appModules,EFXDataSource,transactionManager,custom erTestDao,userTestDao,clientTestDao,confMailTestDa o,customerDao,clientDao,userDao,moduleDao,clientPa rser,moduleSvc,userSvc,customerSvc,confMailSvc,por tfolioTxSvc,resultFileSvc,portfolioSvc]; root of factory hierarchy

    Of course, in my system it goes on, and the "Destroying singletons" message is not present.
    I have asked the admins here to deploy a version that has additional debug messages in Cglib2AopProxy to see if I find something, but it's frustrating because I can't control that server to redeploy at will. If only I could make it fail in my system.
    Does anybody know where I should look? Any pointers? Need any more info?
    Thanks !!!!

  • #2
    There is a jar missing. Which one ishard to tell because you ommitted the most important part . Please post the full strack trace.

    Code:
    Error creating bean with name 'portfolioSvc' defined in class path resource [beans.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError
    This indicates that there is a class/jar missing from the classpath, so there must be a difference in your local and the servers classpath.
    Pleaes next time wheb posting code/stacktraces etc. use [ code][/code ] tags.

    Comment


    • #3
      Thanks Marten.
      Out of frustration, and because I submitted a number of WARs for deployment in that server trying to solve the problem (without success), I opted to switch to programmatic transaction management.
      Although this is a "solution" for the guy who sees the app working, I'm not satisfied and I would like to know what's missing. I'll come back if I can get that darn log.
      Thanks again!

      Comment

      Working...
      X