0

Environment : IBM WAS 8.0, CDI 1.0 Implementation : OpenWebBeans

How can i exclude few packages from getting scanned at server startup?

is there any CDI extension available or customized extension needs to be written for that ?

user3437502
  • 31
  • 1
  • 4

1 Answers1

0

Excluding packages from scanning is supported in OpenWebBeans-1.2.x and OpenWebBeans-1.5.x. This will not help you much for WAS.

If your problem is performance then afaik there is no solution for WAS. If the problem is that one of those classes crashes your bootstrap then you could write an own CDI Extension which uses ProcessAnnotatedType and call veto() for those classes. This will stop the class from further being processed by CDI.

struberg
  • 730
  • 5
  • 12
  • I tried CDI extension to veto() the classes; moreover, @Exclude from deltaspike does the same, But this approach doesn't worked for me. The reason is that code is getting failed even before ProcessAnnotatedType event. I think during ProcessAnnotatedType event, container try to create the annotated type for the classes but due to optional dependencies are missing, container is not able to do that. – user3437502 Jun 09 '15 at 06:21
  • I use the same in WAS-8.5.5.3 and 8.5.5.11 and it works fine. Types which throw a NowClassDefFound will simply get ignored by the scanner. – struberg Jul 25 '17 at 12:51