Announcement Announcement Module
No announcement yet.
Configuring Aspects throws IllegalStateException during deploy. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Configuring Aspects throws IllegalStateException during deploy.

    I am getting IllegalStateException when I try to deploy the ear in weblogic 8.1 sp4. I am using jdk1.4.2 and Spring 2.0.3 distribution.

    Module: Error:
    Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAd visor':
    Cannot create inner bean '(inner bean)' of type [org.springframework.aop.aspectj.AspectJAfterReturn ingAdvice] while setting constructor argument;
    nested exception is org.springframework.beans.factory.BeanCreationExce ption:
    Error creating bean with name '(inner bean)':
    Invocation of init method failed;
    nested exception is java.lang.IllegalStateException:
    Returning argument name 'connection' was not bound in advice arguments - with nested exception:
    [java.lang.IllegalStateException: Returning argument name 'connection' was not bound
    in advice arguments]

    ---Snippet from the config.xml file -------
    <bean id="adviseBean" class="com.dsni.AdviseBean"/>

    <aop:aspect id="aspectid" ref="adviseBean">
    <aopointcut id="getConnection"
    expression="execution(java.sql.Connection javax.sql.DataSource.getConnection(..))"/>

    Use Case I am trying to implement is to set the user context when I get the connection.

    Strange behavior, I noticed is when I remove all code from setUserContext() method, the deployment is successful but when I try to do something in the method, I get the IllegalStateException.

    Thanks in advance for any insight.

  • #2
    It looks like you need to compile your aspects using -g or -g:vars flag.



    • #3

      Thank you for your response.

      I was assuming that I do not have to compile my aspects because it was doing this during deploytime. Am I wrong in assuming this?

      Followup question:
      If I have to compile the aspects, is there a example app/code, I can emulate to setup my build environment?

      Thanks again.



      • #4
        The Java part of aspects will have to compiled, of course. If you are using Ant or Maven, you might simply try adding the -g flag for compiling everything (no real harm in terms of performance when using debug information, anyway).