question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Split Classpath Prevents Weld from Resolving Classes

See original GitHub issue

Description 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:

  1. Create Helidon Microprofile application (uses Weld for CDI)
  2. Wrap using jib-maven-plugin
  3. 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:closed
  • Created 5 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
chanseokohcommented, Jul 16, 2019

#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.

1reaction
loosebazookacommented, Feb 20, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found