Announcement Announcement Module
Collapse
No announcement yet.
@Configurable and Weblogic 10 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @Configurable and Weblogic 10

    Hello

    We have a JAX-WS web service deployed on Weblogic 10. Because an instance of the web service class is not managed by Spring I've to find a way to inject some properties.

    One of the approaches I've tried is load time weaving using @Configurable. We are going to use Spring 2.5 so I followed the steps as described in the documentation (http://static.springframework.org/sp...atconfigurable)

    I can get this working if I specify the -javaagent flag, but that's something I do not want. The documentation says that for Weblogic 10 there is no need use that flag. However without the flag my properties are not injected...

    Do I need to configure something special on the Spring side (documentation says no...)? Or on the Weblogic side?

    --
    Regards
    Dries

  • #2
    Code:
    <context:load-time-weaver/>
    Is that somewhere in your configuration?

    Comment


    • #3
      Originally posted by mdeinum View Post
      Code:
      <context:load-time-weaver/>
      Is that somewhere in your configuration?
      Yes, I've tried couple of combinations with

      Code:
      <context:spring-configured />
      and
      Code:
      <context:load-time-weaver/>

      I've also tried to explicitly set the Weblogic load time weaver:
      Code:
        <context:load-time-weaver aspectj-weaving="on" weaver-class="org.springframework.instrument.classloading.weblogic.WebLogicLoadTimeWeaver"/>

      Comment


      • #4
        Hmm specifying the loadtime weaver and the spring-configured should make it work. Have you tried placing the loadtime wever before the spring-configured...

        Comment


        • #5
          Originally posted by mdeinum View Post
          Hmm specifying the loadtime weaver and the spring-configured should make it work. Have you tried placing the loadtime wever before the spring-configured...
          Changing the order results in the same problem when omitting the javaagent tag...

          I don't think that this makes a difference. Having only "load-time-weaver" enables the "spring-configured" by default according to the doc:
          This also activates the current application context for applying dependency injection to non-managed classes that are instantiated outside of the Spring bean factory (typically classes annotated with the @Configurable annotation). This will only happen if the AnnotationBeanConfigurerAspect is on the classpath (i.e. spring-aspects.jar), effectively activating "spring-configured" by default.

          Comment


          • #6
            The problem is in the class loaders

            Hi,

            Recently I faced with similar problem, with only differerence that there were ejb component instead (in your case) web service component.
            Trying to specify LTW through -javaagentath/to/spring-agent.jar results in that all classes loaded by "class loader" will be instrumented with what spring-agent.jar has. Question remaining : by what "class loader"? Answer with that
            when you start java {$args} {$another_args} -javaagentath/to/spring-agent.jar, here comes to play (in my case) "java.sun.misc...$AppLauncher" class loader. But component (in you case WS, in my case EJB) will have another
            class loader, in case of weblogic - "weblogic.utils.classloaders.GenericClassLoade r". So, your component is "uninstrumented".
            You need to load spring application ctx with all that magic strings when app. server class loader load components which you want instrument. And in this case, really, you don't need LTW through -javaagentath/to/spring-agent.jar
            , because spring already contains "weaver-class="org.springframework.instrument.classloading .weblogic.WebLogicLoadTimeWeaver"

            BR

            Comment


            • #7
              If you are using autowired annotation to inject some spring beans into your ws, try to make it extends SpringBeanAutowiringSupport.

              That works for me perfectly.

              Comment


              • #8
                Oracle WebLogic Server

                Oracle WebLogic Server Process Edition also includes Business Process Management and Data Mapping functionality. WebLogic supports security policies managed by security administrators. The Oracle WebLogic Server Security Model includes:

                * application business logic separated from security code
                * complete scope of security coverage for all JavaEE and non-JavaEE components.


                St Lucia family holiday

                Comment


                • #9
                  Hi,

                  I have the same issues making work @configurable in weblogic 11

                  I managed to make @configurable work with tomcat on another application, with -javagent options
                  I am using the same configuration, so there is a problem somewhere ...

                  edit : my bad, it was wiring fine, but some method tried to acces the wired field was called in the constructor, but the wiring happens after constructor is called.
                  I moved the constructor code inside a method anotated @Postconstruct
                  Last edited by etrier; Mar 15th, 2012, 05:27 AM.

                  Comment

                  Working...
                  X