Results 1 to 9 of 9

Thread: @Configurable and Weblogic 10

  1. #1
    Join Date
    Dec 2007
    Posts
    21

    Default @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. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    Code:
    <context:load-time-weaver/>
    Is that somewhere in your configuration?
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Dec 2007
    Posts
    21

    Default

    Quote 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"/>

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    Hmm specifying the loadtime weaver and the spring-configured should make it work. Have you tried placing the loadtime wever before the spring-configured...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5
    Join Date
    Dec 2007
    Posts
    21

    Default

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

  6. #6

    Default 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

  7. #7

    Default

    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.

  8. #8
    Join Date
    Oct 2010
    Posts
    1

    Default 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

  9. #9
    Join Date
    Sep 2010
    Posts
    25

    Default

    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 at 04:27 AM.

Posting Permissions

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