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

Giacomo Carnevale edited comment on CAMEL-20262 at 12/21/23 9:19 AM:
---------------------------------------------------------------------

[https://github.com/imolainformatica/camel-spring-boot-examples/tree/main/mapstruct]

_mvn clean install_

The test is successfully executed with both Spring Boot 3.2.0 and Spring Boot 
3.1.6.

 

*If I run the JAR instead*

*3.2.0*
_java -jar target/camel-example-spring-boot-mapstruct-4.4.0-SNAPSHOT.jar_
{color:#de350b}org.apache.camel.InvalidPayloadException: No body available of 
type: org.apache.camel.example.model.Beverage but has type: 
org.apache.camel.example.model.Beer on: Message. Caused by: No type converter 
available to convert from type: org.apache.camel.example.model.Beer to the 
required type: org.apache.camel.example.model.Beverage. 
Exchange[F31868F13D33CB4-0000000000000000]. Caused by: 
[org.apache.camel.NoTypeConversionAvailableException - No type converter 
available to convert from type: org.apache.camel.example.model.Beer to the 
required type: org.apache.camel.example.model.Beverage]{color}

If I enable debug logging level
{color:#de350b}2023-12-21T10:16:27.883+01:00 DEBUG 14006 — [           main] 
.a.c.i.e.DefaultPackageScanClassResolver : Cannot read entries in url: 
jar:nested:/home/giacomo/Progetti/camel-spring-boot-examples/mapstruct/target/camel-example-spring-boot-mapstruct-4.4.0-SNAPSHOT.jar/!BOOT-INF/classes/!/sample/camel/mapper/{color}
 
{color:#de350b}java.io.FileNotFoundException: 
nested:/home/giacomo/Progetti/camel-spring-boot-examples/mapstruct/target/camel-example-spring-boot-mapstruct-4.4.0-SNAPSHOT.jar
 (File o directory non esistente){color}
{color:#de350b}at java.base/java.io.FileInputStream.open0(Native Method) 
~[na:na]{color}
{color:#de350b}at 
java.base/java.io.FileInputStream.open(FileInputStream.java:216) ~[na:na]{color}
{color:#de350b}at 
java.base/java.io.FileInputStream.<init>(FileInputStream.java:157) 
~[na:na]{color}
{color:#de350b}at 
org.apache.camel.impl.engine.DefaultPackageScanClassResolver.find(DefaultPackageScanClassResolver.java:215)
 ~[camel-base-engine-4.4.0-SNAPSHOT.jar!/:4.4.0-SNAPSHOT]{color}
 

*3.1.6*
_<spring-boot-version>3.1.6</spring-boot-version>_ in pom.xml
_java -jar target/camel-example-spring-boot-mapstruct-4.4.0-SNAPSHOT.jar_
{color:#00875a}*OK*{color}

 

 


was (Author: carnevalegiacomo):
[https://github.com/imolainformatica/camel-spring-boot-examples/tree/main/mapstruct]

_mvn clean install_

The test is successfully executed with both Spring Boot 3.2.0 and Spring Boot 
3.1.6.

 

*If I run the JAR instead*

*3.2.0*
_java -jar target/camel-example-spring-boot-mapstruct-4.4.0-SNAPSHOT.jar_
{color:#de350b}org.apache.camel.InvalidPayloadException: No body available of 
type: org.apache.camel.example.model.Beverage but has type: 
org.apache.camel.example.model.Beer on: Message. Caused by: No type converter 
available to convert from type: org.apache.camel.example.model.Beer to the 
required type: org.apache.camel.example.model.Beverage. 
Exchange[F31868F13D33CB4-0000000000000000]. Caused by: 
[org.apache.camel.NoTypeConversionAvailableException - No type converter 
available to convert from type: org.apache.camel.example.model.Beer to the 
required type: org.apache.camel.example.model.Beverage]{color}

If I enable debug logging level
{color:#de350b}2023-12-21T10:16:27.883+01:00 DEBUG 14006 --- [           main] 
.a.c.i.e.DefaultPackageScanClassResolver : Cannot read entries in url: 
jar:nested:/home/giacomo/Progetti/camel-spring-boot-examples/mapstruct/target/camel-example-spring-boot-mapstruct-4.4.0-SNAPSHOT.jar/!BOOT-INF/classes/!/sample/camel/mapper/{color}
 
{color:#de350b}java.io.FileNotFoundException: 
nested:/home/giacomo/Progetti/camel-spring-boot-examples/mapstruct/target/camel-example-spring-boot-mapstruct-4.4.0-SNAPSHOT.jar
 (File o directory non esistente){color}
{color:#de350b}at java.base/java.io.FileInputStream.open0(Native Method) 
~[na:na]{color}
{color:#de350b}at 
java.base/java.io.FileInputStream.open(FileInputStream.java:216) ~[na:na]{color}
{color:#de350b}at 
java.base/java.io.FileInputStream.<init>(FileInputStream.java:157) 
~[na:na]{color}
{color:#de350b}at 
org.apache.camel.impl.engine.DefaultPackageScanClassResolver.find(DefaultPackageScanClassResolver.java:215)
 ~[camel-base-engine-4.4.0-SNAPSHOT.jar!/:4.4.0-SNAPSHOT]{color}
 

*3.1.6*
<spring-boot-version>3.1.6</spring-boot-version> nel pom
java -jar target/camel-example-spring-boot-mapstruct-4.4.0-SNAPSHOT.jar
{color:#00875a}*OK*{color}

 

 

> camel-spring-boot - TomcatEmbeddedWebappClassLoader return nested instead 
> file in jar file path
> -----------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-20262
>                 URL: https://issues.apache.org/jira/browse/CAMEL-20262
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-spring-boot
>    Affects Versions: 4.3.0
>            Reporter: Giacomo Carnevale
>            Priority: Major
>             Fix For: 4.4.0
>
>
> With TomcatEmbeddedWebappClassLoader (Spring Boot 3.2.0), the getResources 
> method returns 'jar:nested:...' instead of 'jar:file:...' and throws a 
> FileNotFoundException.



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

Reply via email to