Announcement Announcement Module

JavaConfig forum decommissioned in favor of Core Container

As described at

key features of the Spring JavaConfig project have been migrated into the core Spring Framework as of version 3.0.

Please see the Spring 3.0 documentation on @Configuration and @Bean support:

For any questions related to @Configuration classes and @Bean methods in Spring 3.0, please post in the dedicated 'Core Container' forum at
See more
See less
javaconfig with custom loadeer? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • javaconfig with custom loadeer?


    I would like to create a springcontainer using javaconfig with a custom class loader. This is what I've tried:
            JavaConfigApplicationContext applicationContext = new JavaConfigApplicationContext();
            // here I set my custom classloader which is url-class loader
    However I get an exception when doing the refresh:

    Code: Class file [de/mpicbg/tds/rm/hcstools/RnaCompoundDBConfig.class] not found). Check the log messages... (
      java.lang.RuntimeException: Class file [de/mpicbg/tds/rm/hcstools/RnaCompoundDBConfig.class] not found

    The AsmUtils seem to ignore my custom classloader. What could be my mistake?

    Any help is appreciated.

    Best, Holger

  • #2
    First, strongly consider using Spring 3.0 and its AnnotationConfigApplicationContext. It replaces the JavaConfig project and its JavaConfigApplicationContext.

    Second, this will probably be a hard limitation of the way that things work right now. ASM is assuming that the class is loadable as a classpath resource. If you're fetching it via a URL, that violates the assumption.

    Add an issue for this in JIRA if you like. It's conceivable that we could accommodate this, because at the end of the day ASM really just needs an input stream.