Announcement Announcement Module
Collapse
No announcement yet.
ReflectionWorldException with transactionManager & AspectJ Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ReflectionWorldException with transactionManager & AspectJ

    I'm trying to add AspectJ capabalities into my spring(2.0.2)-JBoss(4.05) application and have some problems.
    when the application is started i get the following exception:
    Code:
    10:19:59,421 ERROR [ContextLoader] Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in URL [jar:file:/D:/dev/projects/stargate/stargate-ui/exploded/stargate.war/WEB-INF/lib/stargate-domain-1.0-SNAPSHOT.jar!/applicationContext-dao.xml]: Initialization of bean failed; nested exception is org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException: warning can't determine implemented interfaces of missing type $Proxy53
     [Xlint:cantFindType]
    Caused by: 
    org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException: warning can't determine implemented interfaces of missing type $Proxy53
     [Xlint:cantFindType]
    	at org.aspectj.weaver.reflect.ReflectionWorld$ExceptionBasedMessageHandler.handleMessage(ReflectionWorld.java:163)
    the bean transactionManager is defined in applicationContext-dao.xml:
    Code:
        <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
            <property name="dataSource" ref="dataSource"/>
            <property name="mappingResources">
                <list>
                    <value>hibernate/User.hbm.xml</value>
                </list>
            </property>
        </bean>
        <!-- Transaction manager for a single Hibernate SessionFactory  -->
        <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
            <property name="sessionFactory" ref="sessionFactory"/>
        </bean>
    on file applicationContext-service.xml i have the following aop configurations:
    Code:
        <aop:aspectj-autoproxy/>
    
        <!-- the transactional advice (i.e. what 'happens'; see the <aop:advisor/> bean below) -->
        <tx:advice id="txAdvice" transaction-manager="transactionManager">
            <!-- the transactional semantics... -->
            <tx:attributes>
                <!-- all methods starting with 'get' are read-only -->
                <tx:method name="get*" read-only="true"/>
                <!-- other methods use the default transaction settings (see below) -->
                <tx:method name="*"/>
            </tx:attributes>
        </tx:advice>
        <aop:config>
            <aop:pointcut id="businessServiceOperation"
                          expression="execution(* com.supportspace.stargate.service.*Manager.*(..))"
                    />
            <aop:advisor advice-ref="txAdvice" pointcut-ref="businessServiceOperation" order="10"/>
    
        </aop:config>
    Now, when i run integration test that loads the context everything seems to work fine. the problem seems to happen only when i deploy my application to JBoss. does anyone have an idea?
    Last edited by matid; May 19th, 2007, 02:25 AM.

  • #2
    Adding aspectjtools.jar to the classpath solves the problem for me.
    I still don't understand why it doesn't create a proxy and try to weave using aspectj.

    Comment


    • #3
      Thanks.
      Actually i'm not so sure about the exact cause of the problem, but it seems that upgrading to spring 2.0.5 (from spring 2.0.2) solved the problem.
      of course both aspectjrt.jar and aspectjweaver.jar should be in the classpath.
      Last edited by matid; Jun 4th, 2007, 05:15 AM.

      Comment


      • #4
        does this still work? i am facing the same problem right now

        Comment


        • #5
          Originally posted by onechannel View Post
          does this still work? i am facing the same problem right now
          Adding the aspectools still works for me.

          Comment

          Working...
          X