Results 1 to 3 of 3

Thread: No freakin' way to get hold of classloader via propertypath or spel?

  1. #1
    Join Date
    Oct 2005
    Location
    Bergen, Norway
    Posts
    128

    Default No freakin' way to get hold of classloader via propertypath or spel?

    Hi - I'm trying to get the classloader for a class via properypaths or spring expressions - but no way:

    (bacServiceModuleInspector is a bean I have defined).

    This:
    <property name="classLoader" value="#{@bacServiceModuleInspector.Class.getClass Loader()}" />
    fails with:
    org.springframework.expression.spel.SpelEvaluation Exception: EL1008Epos 33): Field or property 'ClassLoader' cannot be found on object of type 'com.mycompany.BacServiceModuleInspector'


    This fails as well:
    #{T(com.edb.payment.pays.core.util.bac.BacServiceM oduleInspector).getClass().getClassLoader()}

    as well as:
    <utilroperty-path path="bacServiceModuleInspector.class.classLoader" />


    is there something magic about getting classLoader of a class?

  2. #2
    Join Date
    Nov 2011
    Posts
    1

    Default

    I was wondering, can I find some kind of magic wand that will fix all these problems?
    __________________
    vob player

  3. #3
    Join Date
    Feb 2013
    Posts
    1

    Default

    One year later, and yet another frustrated programmer hits this particular wall. Any call to someClass.getClassLoader() returns null. I just want to getResourceAsStream() to see if a particular resource exists. Crap.

Posting Permissions

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