Closed alrawas closed 15 hours ago
/cc @geoand
@lburgazzoli looking at the stacktrace, it looks like Camel is trying to load some Spring classes for some reason.
it is the first time I see this but yes camel-jms and camel-activemq which is based on it have a dependency on spring as they use spring-jms.
We need to investigate what triggers this issue.
In the meantime, a workaround could be to use camel-sjms or camel-sjms2 as they are based on the jms specs without dependency on spring. An example can be found here https://github.com/apache/camel-quarkus/tree/master/integration-tests/messaging
I've been looking into this. The problem stems from this quarkus-spring-di
plugin configuration:
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bootstrap-maven-plugin</artifactId>
<configuration>
<excludedArtifacts>
<excludedArtifact>org.springframework:spring-core</excludedArtifact>
<excludedArtifact>org.springframework:spring-beans</excludedArtifact>
<excludedArtifact>org.springframework:spring-context</excludedArtifact>
</excludedArtifacts>
</configuration>
</plugin>
Which effectively bans dependencies that some of the camel-quarkus extensions depend on.
I can work around this in camel-quarkus, but was wondering if it could make sense to have a BuildItem
, or some other way for extensions to unexclude these artifacts if they really need them. WDYT @geoand?
Unfortunately a BuildItem is executed way too late for that to be possible.
Is this still an issue?
Pretty sure this was fixed long ago. CQ now shades the required bits from spring-core
, spring-beans
& spring-context
into a dedicated 'spring support' extension. So the problem I mentioned above is not present anymore.
Gotcha, thanks a lot!
Describe the bug Before writing any classes. starting with
quarkus-container-image-jib
,quarkus-kubernetes
,camel-quarkus-activemq
builds successfully and starts up successfully.However when adding this extension to the pom
quarkus-spring-web
my quarkus app still builds successfully and pushes to my local kubernetes registry but it fails to start up and I getClassNotFoundException: java.lang.ClassNotFoundException: org.springframework.beans.factory.InitializingBean
Expected behavior Startup to be successful in kubernetes environment
Actual behavior Startup fails and I get the following exception after adding
quarkus-spring-web
To Reproduce Steps to reproduce the behavior:
execute this command to create a new project
mvn io.quarkus:quarkus-maven-plugin:1.7.2.Final:create -DprojectGroupId=org.acme -DprojectArtifactId=camel-amq-kub
add the first 3 non problematic extensions
mvn quarkus:add-extension -Dextensions="camel-quarkus-activemq, quarkus-kubernetes, quarkus-container-image-jib"
add your kubernetes registry properties in application.properties
run
mvn clean package -Dquarkus.kubernetes.deploy -Dquarkus.profile=kub -DskipTests
and check logs usingkubectl logs deployments/camel-amq-kub
. Up to this point you should see no exceptions.add the following extension to the pom
do step 4 again. you should see the exception now.
Configuration
Environment (please complete the following information):
uname -a
orver
:Microsoft Windows [Version 10.0.18362.1016]
java -version
:1.7.2.Final
mvnw --version
orgradlew --version
):