It's not a secret anymore!*
The moose likes Spring and the fly likes Scanning XML file...Best performanent approach ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Scanning XML file...Best performanent approach ?" Watch "Scanning XML file...Best performanent approach ?" New topic

Scanning XML file...Best performanent approach ?

samir ware
Ranch Hand

Joined: Jul 27, 2005
Posts: 192
Hello ranchers,
I want to know the most performanent way to scan the XML files in spring. I have few XML files which contains either package name where all the bean resides or the java bean name which needs to be instantiated. In both the cases , at server start up, I want all the beans in the XML files to get instantiated. Can anyone please tell me the most performanent way to scan these files and instantiate all the java beans ?
Any white paper / link will greatly be appriciated.
Thanks in advance
Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30057

I don't follow. You don't have a Spring config file, but a list of beans?

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
samir ware
Ranch Hand

Joined: Jul 27, 2005
Posts: 192
Hello Jeanne
Thanks a lot for the reply. Let me put it this way. I have an application in which I am scanning some spring specific files(These files are having spring style beans) . For this I have used a class Scanner which extends "ComponentScanBeanDefinitionParser" . Though problem here is whenever it scans for the files, it scans the entire class path . Because of which my server start up time has increased considerably as all these files are getting scanned at server start-up.
Is there any way by which I can tell spring that we need to scan in this specific path insted of spring scanning entire class path and then instantiating beans which it found in it .
samir ware
Ranch Hand

Joined: Jul 27, 2005
Posts: 192
or more precisely
I want to let the spring framework know through XML file, the location where it can find all the .class files which are refereed by spring configuration file . In short I want to specify the class path in the XML file. Is it possible to do so ?
I agree. Here's the link:
subject: Scanning XML file...Best performanent approach ?
Similar Threads
context not bount error in dispatcher-servlet.xml file : please help
I need a small project to do with spring and hibernate.
dependency injection by annotations
Spring container initialised hook
Spring - Multiple IoC Containers with Singleton Bean in a JVM