Announcement Announcement Module
Collapse
No announcement yet.
Problem with JDK 1.4 and tx:advice Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with JDK 1.4 and tx:advice

    We're running into some odd problems when trying to build a simple transactional app using Spring 2.0.5 and JDK 1.4.2.

    We're trying to use the schema-based tags to set up our AOP and transactions, but whenever we include the tx:advice tag, we get this error:
    Code:
    java.lang.IllegalStateException: Unable to load class [org.springframework.transaction.annotation.AnnotationTransactionAttributeSource]. Are you running on Java 1.5+? Root cause: java.lang.UnsupportedClassVersionError: org/springframework/transaction/annotation/AnnotationTransactionAttributeSource (Unsupported major.minor version 49.0)
    For reference, our config file is below.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <!-- Service and Transaction definitions for the Profanimator application -->
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:aop="http://www.springframework.org/schema/aop"
           xmlns:tx="http://www.springframework.org/schema/tx" 
           xsi:schemaLocation="http://www.springframework.org/schema/beans 
                               http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                               http://www.springframework.org/schema/tx 
                               http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
                               http://www.springframework.org/schema/aop 
                               http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
      <!-- Service definitions -->                           
      <bean id="videoService" class="com.molecular.service.VideoServiceImpl">
        <property name="videoDao" ref="videoDao"/>
      </bean>
      
      <bean id="userService" class="com.molecular.service.UserServiceImpl">
        <property name="userDao" ref="userDao"/>
      </bean>
      
      <!-- DAOs and session factory are defined in a seperate file -->
      
      <!-- Transactional support -->
      <aop:config>
        <aop:advisor advice-ref="txAdvice"
                     pointcut="execution(* com.molecular.service.*.*(..))"/>
      </aop:config>
    
      <tx:advice id="txAdvice" transaction-manager="transactionManager"/>
       
      <!-- Define the transaction manager -->  
      <bean id="transactionManager" 
            class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory" ref="sessionFactory"/>
      </bean>
    </beans>
    As you can see, we're not using <tx:annotation-driven> or anything similar that requires JDK 1.5. Has anyone run into this before, and if so, how did you get around it?

    Thanks
    - Don

  • #2
    Originally posted by dbrinker View Post
    As you can see, we're not using <tx:annotation-driven> or anything similar that requires JDK 1.5. Has anyone run into this before, and if so, how did you get around it?
    Obivously if you were using @Transactional the exception would make sense. As you're not it looks like a limitation or bug. I'd have a look in JIRA and see if anyone else has raised a similar issue.
    Last edited by karldmoore; Aug 29th, 2007, 01:01 PM.

    Comment


    • #3
      In the stacktrace you should see where AnnotationTransactionAttributeSource is trying to be loaded - that's probably the point of error. This class seems to be 1.5 compiled (for a more or less obvious reason).

      Jörg

      Comment


      • #4
        Was there any follow up to this?
        Last edited by karldmoore; Aug 29th, 2007, 01:01 PM.

        Comment


        • #5
          Originally posted by karldmoore View Post
          Was there any follow up to this?
          I haven't found anything in JIRA. I *am* wondering if this isn't due to the fact that I'm including the <tx:advice> without providing any <tx:attribute> definitions. I should be able to test that out today...

          Comment

          Working...
          X