jomin7 opened a new pull request, #158: URL: https://github.com/apache/camel-examples/pull/158
This PR refactors the java-lambda example by moving the MyRouteBuilder inner class from MyApplication.java into its own standalone file, MyRouteBuilder.java. The Problem: Previously, MyRouteBuilder was defined as a package-private inner class. While mvn clean install passed (compilation was successful), running the example via mvn camel:run triggered a java.lang.IllegalAccessException. This occurred because Apache Camel’s ObjectHelper uses reflection to instantiate routes. In modern Java runtimes (Java 17+), reflection-based access to non-public inner classes from a different package is restricted. The Fix: Created MyRouteBuilder.java as a public standalone class. Removed the nested MyRouteBuilder class from MyApplication.java. Verified that mvn camel:run now starts the Camel context successfully without reflection errors. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
