1

I found this:

Component scan issue

Component scan time too long

Component scan is too low

I am trying to load an application (approximatively 200M). Our application just contains 265 beans. However we have runtime dependencies which bring thousands of other beans

We are using a component scan. However the the execution of jboss is taking more than 5 minutes because of the load of the beans.

After reading some pages I saw that the component scan is loading all the classes of the mentionned package in the component scan and then is filtering on the beans.

We don't want to specify package with name beans and reference just those packages because according to us the packages are there to group by functionality and have a package org.blabla.beans is not in our methods. In addition it means that we have to contact several teams to refactor their code, publish new version just to target those packages.

We don't want as well to use lazy init because the potential issues of NoSuchBeans will be find during execution. We prefer ta have an issue at runtime or at compilation.

I had an idea. It would be at compilation time. When all the libraries are brought and the war is about to be built, the component scan is performed on all the jars and search all the beans marked with annotation. Then it build an xml configuration which will be used at runtime. The advantage is to have the specification of all the beans in this file. So it will be (in theory) faster at execution.

Do you maybe have suggestions?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Geoffrey
  • 1,151
  • 3
  • 13
  • 26

0 Answers0