Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-14736

get Class package and location returns null when use <context:load-time-weaver/>

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: General Backlog
    • Component/s: None
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      Recently, I use "<context:load-time-weaver/>" config to support @Configurable annotation in my project.I found serious problems below when I trace the errors in my project.
      1.XXX.class.getPackage() returns null
      2.XXX.class.getProtectionDomain().getCodeSource().getLocation() returns null
      These problems disappear when I don't use "<context:load-time-weaver/>".
      The code "XXX.class.getPackage()" is used in many dependencies such as the static method in com.mysql.jdbc.Util:

      packageName = MultiHostConnectionProxy.class.getPackage().getName();

      The null result of Class.getPackage() causes NullPointerException.

        Attachments

          Activity

            People

            Assignee:
            juergen.hoeller Juergen Hoeller
            Reporter:
            jasperMin jasperMin
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Days since last comment:
              3 years, 29 weeks, 6 days ago