问题
i found some posts dealing with this topic, but our situation is a bit different, so I post it here, hoping someone can help us with it. The situation is: We develop a rich client that is started via webstart (loaded from a server). In the client we use spring (3.0.5) for dependency injection, nothing else so far. Since we had big trouble with slow component scans because of AOP in spring, we do not use all spring jars but the following:
spring-asm-3.0.5.RELEASE.jar
spring-beans-3.0.5.RELEASE.jar
spring-context-3.0.5.RELEASE.jar
spring-context-support-3.0.5.RELEASE.jar
spring-core-3.0.5.RELEASE.jar
spring-expression-3.0.5.RELEASE.jar
The effect we have is strange: If we start the rich client via webstart it is quite fast (component scan in a few seconds). Now (for some reason) i try to start our client as regular application by just having all jars on my computer and starting the app with a huge classpath. In this scenario it takes 3-5 minutes (depending on the computer) to boot the app. In the log i can see its the spring component scan that takes so long. Of course the used jar files are 100% identical in both solutions. So my fundamental question is: Where is the difference here? I would have expected it all the way round. Long time in Webstart and fast as application. Does anyone have a hint what could cause those long startup times in the application scenario?
来源:https://stackoverflow.com/questions/17747364/slow-spring-component-scan