Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-16662

camel-spring-boot - Classloader cannot find xml route files inside spring boots proprietary layout

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.10.0
    • 3.11.0
    • camel-spring-boot
    • None
    • Unknown

    Description

      Hi

      I have cloned camel spring boot example [https://github.com/apache/camel-spring-boot-examples/tree/main/xml camel-spring-boot-examples /xml .|https://github.com/apache/camel-spring-boot-examples/tree/main/xml]

      If I run the example with maven command mvn spring-boot:run It works (route camel/my-route.xml  loaded).

      Routes startup summary (total:1 started:1)

      If I build the example and run with java -jar target/camel-example-spring-boot-xml-3.11.0-SNAPSHOT.jar It doesn't work (route camel/my-route.xml not loaded).

      Routes startup summary (total:0 started:0)

      I suppose that spring boot maven plugin works with classes file and not with jar file, so I modified (unzip and zip) the jar file moving BOOT-INF/classes/camel to jar root folder and It works.

       

      git clone https://github.com/apache/camel-spring-boot-examples.git
      cd camel-spring-boot-examples/xml
      mvn spring-boot:run
      --------> Routes startup summary (total:1 started:1)

       

      mvn clean package
      java -jar target/camel-example-spring-boot-xml-3.11.0-SNAPSHOT.jar
      --------> Routes startup summary (total:0 started:0)

       

      cp target/camel-example-spring-boot-xml-3.11.0-SNAPSHOT.jar .
      cp -r src/main/resources/camel/ .
      zip camel-example-spring-boot-xml-3.11.0-SNAPSHOT.jar camel/my-route.xml
      java -jar camel-example-spring-boot-xml-3.11.0-SNAPSHOT.jar
      --------> Routes startup summary (total:1 started:1)

      Giacomo

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            davsclaus Claus Ibsen
            carnevalegiacomo Giacomo Carnevale
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Issue deployment