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

Luigi De Masi edited comment on CAMEL-19181 at 3/23/23 9:36 AM:
----------------------------------------------------------------

As [~Federico Mariani] wrote in the description, the problem is that if the 
mapstruct component is not registered in the context, via spring bean 
declaration or creating a mapstruct endpoint in a route, the starter does not 
find it and so it can't configure it, despite there is a property.

As a workaround, we can create, register and configure the component in case a 
mapstruct component is not present and a mapstruct property is configured. The 
problem is that the starter is generated and overwrite all changes on every 
build, we have to modify the starter generator mojo to exclude some starter.

IMHO mapstruct should not be a regular component, it should be a transformer, 
WDYT [~davsclaus], [~acosentino] ?


was (Author: ldemasi):
As [~Federico Mariani] wrote in the description, the problem is that if the 
mapstruct component is not registered in the context, via spring bean 
declaration or creating a mapstruct endpoint in a route, the starter does not 
find it and so it can't configure it, despite there is a property.

As a workaround, we can create, register and configure the component in case a 
component is not present and a mapstruct property is configured. The problem is 
that the starter is generated and overwrite all changes on every build, we have 
to modify the starter generator mojo to exclude some starter.

IMHO mapstruct should not be a regular component, it should be a transformer, 
WDYT [~davsclaus], [~acosentino] ?

> camel-springboot - mapstruct component is not autoconfigured automatically
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-19181
>                 URL: https://issues.apache.org/jira/browse/CAMEL-19181
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 3.20.2
>            Reporter: Federico Mariani
>            Assignee: Luigi De Masi
>            Priority: Major
>             Fix For: 3.20.4, 3.21.0, 4.0-M3, 4.0
>
>         Attachments: mapstruct-test.zip
>
>
> In a Camel Spring Boot application MapStruct component is not autoconfigured 
> automatically, as you can see from the reproducer, even if 
> application.properties contains 
> _camel.component.mapstruct.mapper-package-name_ the component is not 
> registered into the camel context, therefore the converter is not found and 
> the following exception is raised:
> _NoTypeConversionAvailableException: No type converter available to convert 
> from type: org.jboss.fuse.tnb.universal.component.mapstruct.Car to the 
> required type: org.jboss.fuse.tnb.universal.component.mapstruct.CarDto_
> By uncommenting lines MyRouteBuilder:18 and MyRouteBuilder:19, the reproducer 
> works, but I think that Camel Spring Boot should configure the component 
> automatically.



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

Reply via email to