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

Claus Ibsen commented on CAMEL-20664:
-------------------------------------

What is your example supposed to output in the logs to make it work. I see this

12:47:23.937 [Camel (camel-1) thread #1 - timer://kickstartmyroute] INFO  
c.redhat.examples.CamelConfiguration - Processed order: 
[{"id":null,"customer":"1","item":"1","description":null,"quantity":4}]



> camel-mapstruct - MapStruct mappers not found in Spring Boot
> ------------------------------------------------------------
>
>                 Key: CAMEL-20664
>                 URL: https://issues.apache.org/jira/browse/CAMEL-20664
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-mapstruct
>    Affects Versions: 4.0.0
>         Environment: $ java -version
> openjdk version "17.0.7" 2023-04-18
> OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7)
> OpenJDK 64-Bit Server VM Temurin-17.0.7+7 (build 17.0.7+7, mixed mode, 
> sharing)
>            Reporter: Josh Reagan
>            Priority: Minor
>             Fix For: 4.6.0
>
>         Attachments: camel-mapstruct-demo.zip
>
>
> The `DefaultMapStructFinder` is unable to locate the `Mapper` classes when 
> running in Spring Boot. Seems to throw an exception calling 
> `PluginHelper.getPackageScanClassResolver(ecc).findByFilter(f -> 
> f.getName().endsWith("Mapper"), names);` inside the `doInit()` method.
> You can work around this by creating your own `MapStructFinder`, extending 
> `DefaultMapStructFinder`, overriding the `doInit()` function, and calling 
> `discoverMappings(...)` with each of your `Mapper` classes. That way it 
> doesn't try to scan the classpath to find the `Mapper` classes automatically. 
> I've attached a working example to illustrate.
> *Note: It has no issue locating them when running `mvn spring-boot:run`. Only 
> when running from the packaged uber jar with `java -jar ...`.



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

Reply via email to