Announcement Announcement Module
No announcement yet.
Something wrong with TransactionProxyFactoryBean Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Something wrong with TransactionProxyFactoryBean

    Hi I pretty new to spring and I've already made some small things.
    Yesterday I wanted to extend my project a bit but I did 2 things at the same time (I know step by step, but evil is done now).

    So what I did:
    1) Because is was following a books instructions I used an older version of Hibernate (I'm new to this also). So I swiched to Hibernate3 (shouldn't make much difference I guess).This can be a cause of my troubles perhaps?

    2) I added a new mapping for a new table with associations in my database. Maybe I did something wrong here with the associations...

    All this results in a big error (Tomcat refusing to start the application and he gives me a list with the argumetens why he is refusing but I don't understand the errors )

    So one of my main concerns is the next one (the other errors I will try and resolve on my own... emphasis on try )

    here it comes:
    The error:
    ERROR - ContextLoader.initWebApplicationContext(172) | Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name
    'employeeManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]:
    Instantiation of bean failed; nested exception is
    org.springframework.beans.FatalBeanException: Could not instantiate class
    [org.springframework.transaction.interceptor.TransactionProxyFactoryBean]; constructor
    threw exception; nested exception is java.lang.NoClassDefFoundError: null
    org.springframework.beans.FatalBeanException: Could not instantiate class
    [org.springframework.transaction.interceptor.TransactionProxyFactoryBean]; constructor
    threw exception; nested exception is java.lang.NoClassDefFoundError: null
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Unknown Source)
    	at org.springframework.aop.framework.DefaultAopProxyFactory.<clinit>(
    	at org.springframework.aop.framework.ProxyConfig.<init>(
    	at org.springframework.transaction.interceptor.TransactionProxyFactoryBean.<init>(
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    	at java.lang.reflect.Constructor.newInstance(Unknown Source)
    	at org.springframework.beans.BeanUtils.instantiateClass(
    	at org.springframework.beans.BeanUtils.instantiateClass(
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(
    	at org.apache.catalina.core.StandardContext.listenerStart(
    	at org.apache.catalina.core.StandardContext.start(
    	at org.apache.catalina.core.ContainerBase.addChildInternal(
    	at org.apache.catalina.core.ContainerBase.addChild(
    	at org.apache.catalina.core.StandardHost.addChild(
    	at org.apache.catalina.startup.HostConfig.deployDirectory(
    	at org.apache.catalina.startup.HostConfig.deployDirectories(
    	at org.apache.catalina.startup.HostConfig.deployApps(
    	at org.apache.catalina.startup.HostConfig.start(
    	at org.apache.catalina.startup.HostConfig.lifecycleEvent(
    	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(
    	at org.apache.catalina.core.ContainerBase.start(
    	at org.apache.catalina.core.StandardHost.start(
    	at org.apache.catalina.core.ContainerBase.start(
    	at org.apache.catalina.core.StandardEngine.start(
    	at org.apache.catalina.core.StandardService.start(
    	at org.apache.catalina.core.StandardServer.start(
    	at org.apache.catalina.startup.Catalina.start(
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.catalina.startup.Bootstrap.start(
    	at org.apache.catalina.startup.Bootstrap.main(
    Part of my applicationContext
    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">    
            <property name="dataSource">
            	<ref local="dataSource"/>
            <property name="mappingResources">
            <property name="hibernateProperties">
    	            <prop key="hibernate.dialect">
    	            <prop key="">create</prop>
        <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
    I hope someone can help me
    Thanks in advance

  • #2
    The error message is somewhat inconclusive.
    Maybe you need cglib-nodep-2.1_3.jar on your classpath.



    • #3
      Nope, no change. Thanks anyway...

      I didn't expect this error, what I did was some complaints about my hibernate mappings (which is also the case...)
      Could it be related somehow, that my mappings are complety wrong and results in this error?
      Where would you start to look?



      • #4
        Well, I started to check the location where the exception arises which pointed to CGLIB but now I think that is the wrong way.

        Just found this thread. Guess it is the same problem that you have. Maybe it helps.

        Perhaps indeed a class referred to in a mapping is missing.



        • #5
          Another thread that might be helpful.



          • #6
            Hmm, ok that didn't help either.
            I saw that my tables are created with the right associations. So I guess there is nothing wrong with my mappings since it's creating them... Hibernate sould be working fine I think.

            Some other suggestions (we're getting close I feel it )


            • #7
              It's running after importing the required jars... those jars again (when will I learn...)

              Well thanks again for your help


              • #8
                Originally posted by Emerxill View Post
                It's running after importing the required jars... those jars again (when will I learn...)

                Well thanks again for your help
                Can you tell me exactly what jars? I'm having the same problem!


                • #9
                  Man, that's ages ago
                  So, no, I can't you exactly tell you which jars I added.
                  However, I suggest that you have a look at the "ReadMe.txt" in the lib-folder of the distribution file that contains the Spring framework (so not the lib in your application). That ReadMe.txt will tell you which jar(s) you'll need. If you've dowloaded the distribution with dependencies, that contains all the jars you need so you don't have to look for them one by one on the internet.

                  Btw, if you were using maven2 you wouldn't have had this problem