Split Classpath Prevents Weld from Resolving Classes
See original GitHub issueDescription of the issue:
As Jib handles /classes
and /resources
separately Weld is unable to reconcile the beans.xml
and classes resulting in it not finding any. This is contrary to how a Jar archive and Maven would do this as they would be both placed into the same root file system rather than split.
Expected behavior:
Use single /classes
directory by default as per Jar.
Steps to reproduce:
- Create Helidon Microprofile application (uses Weld for CDI)
- Wrap using
jib-maven-plugin
- Launch
Environment: Helidon 1.0.0, Maven 3.6, Jib 1.0.0
jib-maven-plugin
Configuration:
TODO
Workaround:
Place beans.xml
file in src/main/jib/app/classes/META-INF
.
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (8 by maintainers)
Top Results From Across the Web
Weld Reference Guide - JBoss.org
Setting the Classpath. Weld SE comes packaged as a 'shaded' jar which includes the CDI API, Weld Core and all dependent classes bundled...
Read more >Chapter 3. Class Loading and Modules Red Hat JBoss ...
This prevents multiple copies of the same classes and packages within the deployments class path from conflicting with each other. The class loader...
Read more >Classloader is not propagated to XmlConfigBuilder - Google Groups
1. Try to load a configuration file (application-hazelcast.xml) from the server classpath. If this leads to a valid configuration, work with that config,...
Read more >WELD-001318 Cannot resolve an ambiguous dependency
Can you make sure you don't have the same class twice on the classpath, in difference jars (bean-archives) for example? – Bozho. Aug...
Read more >9 Using Contexts and Dependency Injection for the Java EE ...
Intercepting Method Invocations and Life Cycle Events of Bean Classes ... involves overriding the process that CDI normally uses to resolve beans.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
#905 is fixed, and the next Jib release will enable embedding a JAR. When using a JAR, the class files and resource files will be loaded from the same location, so I think this can work as a viable solution for this Weld and CDI issue. There is a small price to pay, but I think this issue can be handled best with a JAR. Closing.
I see, appreciate the explanation. It still feels strange that it would use the physical layout to make decisions. I guess you have your workaround for now. We’ll take another look at CDI too.