Uploaded image for project: 'FUSE Mediation Router'
  1. FUSE Mediation Router
  2. MR-334

camel-archetype-java archetype generates demo code that does not compile (uncaught exception)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.3.0-fuse-01-00
    • 2.2.0-fuse-01-00
    • None
    • None

      Note that this bug is potentially embarassing, because this archetype features in the FUSE MR Getting Started guide and therefore has fairly high visibility to users trying out the product for the first time.

      Using the 2.2.0-fuse-01-00 version of the camel-archetype-java archetype, I generated a project using the following command:

      mvn archetype:create
        -DremoteRepositories=http://repo.fusesource.com/maven2
        -DarchetypeGroupId=org.apache.camel.archetypes
        -DarchetypeArtifactId=camel-archetype-java
        -DarchetypeVersion=2.2.0-fuse-01-00
        -DgroupId=tutorial
        -DartifactId=simple-router
      

      When I tried to build the resulting project using mvn install, I got the following error:

      [INFO] Compilation failure
      C:\SVN\forge.fusesource.com\fuseeip\docs\trunk\getting_started\simple-router\src\main\java\tutorial\MyRouteBuilder.java:[36,19] unreported exception java.lang.Exception; must be caught or declared to be thrown
      

      You can fix the compilation error by adding a try/catch clause to the MyRouteBuilder.java file, as follows:

          public static void main(String... args) {
              try {
                Main.main(args);
              }
              catch (java.lang.Exception e) { }
          }
      

            janstey@redhat.com Jonathan Anstey
            fbolton@redhat.com Fintan Bolton (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: