[ 
https://issues.apache.org/jira/browse/CAMEL-23551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18083426#comment-18083426
 ] 

Claus Ibsen commented on CAMEL-23551:
-------------------------------------

I have noticed you changed the title to "camel export to Spring Boot". This is 
not the case I export to default which is camel-main. The docs says it is 
possible to declare Spring Boot *style* JDBC config, which does not mean I use 
Spring Boot.

 

Spring Boot style JDBC is for end users that want to use Spring Boot as their 
production runtime. It is not intended for Camel Main production runtime.

The intention is that while doing rapid prototyping in camel jbang you can use 
spring boot config style if you need to configure a datasource. 

So what you attempt to do is then end up being wrong as camel-main dont 
understand the spring boot JDBC config

> camel-jbang - camel export to Main creates pom.xml with circular log4j 
> dependecies
> ----------------------------------------------------------------------------------
>
>                 Key: CAMEL-23551
>                 URL: https://issues.apache.org/jira/browse/CAMEL-23551
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-jbang
>    Affects Versions: 4.18.0, 4.20.0
>            Reporter: Michael Weiss
>            Priority: Minor
>         Attachments: pom.xml
>
>
> According to 
> [docs|https://camel.apache.org/manual/camel-jbang.html#_configuring_jdbc_datasources]
>  it is possible to declare Spring Boot style JDBC config with 
> spring.datasource. configuration in application.properties.
> While this works with JBangs camel run it does not work when exporting a 
> maven project with camel export. The reason is that the export pulls in 
> spring-boot-starter-jdbc which seems to create conflicts between 
> log4j-slf4j2-impl and log4j-to-slf4j.
> Boot error:
> {noformat}
> Exception in thread "main" java.lang.ExceptionInInitializerError
>         at 
> org.example.project.route.CamelApplication.main(CamelApplication.java:8)
> Caused by: org.apache.logging.log4j.LoggingException: log4j-slf4j2-impl 
> cannot be present with log4j-to-slf4j
>         at 
> org.apache.logging.slf4j.Log4jLoggerFactory.validateContext(Log4jLoggerFactory.java:67)
>         at 
> org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:49)
>         at 
> org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:32)
>         at 
> org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:52)
>         at 
> org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:32)
>         at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:432)
>         at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:457)
>         at 
> org.apache.camel.main.BaseMainSupport.<clinit>(BaseMainSupport.java:135)
>         ... 1 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to