Results 1 to 5 of 5

Thread: ReflectionWorldException with transactionManager & AspectJ

  1. #1
    Join Date
    Oct 2005
    Posts
    13

    Default ReflectionWorldException with txManager & AspectJ (with JBoss)

    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 at 02:25 AM.

  2. #2

    Default

    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.

  3. #3
    Join Date
    Oct 2005
    Posts
    13

    Thumbs up

    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 at 05:15 AM.

  4. #4
    Join Date
    Jun 2012
    Posts
    1

    Default

    does this still work? i am facing the same problem right now
    tools for 1channel & legal advise

  5. #5
    Join Date
    Jul 2012
    Posts
    1

    Default

    Quote 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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •