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

camel-blueprint - Using simple language on setProperty() failed with IllegalAccessException in case of blueprint

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Not A Problem
    • Affects Version/s: 2.20.1, 2.24.2, 3.0.1, 2.25.0
    • Fix Version/s: None
    • Component/s: came-core, camel-blueprint
    • Labels:
      None
    • Environment:

      Java 8, Java 11

    • Estimated Complexity:
      Unknown

      Description

      .setProperty("MyProperty").simple("${bean:java.lang.System?method=currentTimeMillis}")
      

      This Java DSL setting Property using simple expression works well in case of the camelContext is created from Spring-DM/Spring configuration.

      But the IllegalAccessException error will be thrown in case of the camelContext is created from blueprint.

      Caused by: java.lang.IllegalAccessException: Class org.apache.camel.util.ObjectHelper can not access a member of class java.lang.System with modifiers "private"
      	at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102) ~[?:1.8.0_201]
      	at java.lang.Class.newInstance(Class.java:436) ~[?:1.8.0_201]
      	at org.apache.camel.util.ObjectHelper.newInstance(ObjectHelper.java:1734) ~[bundleFile:2.24.2]
      	... 22 more
      

      The minimal project is attached to easy reproduce this issue.

        Attachments

        1. test-simple-property.zip
          5 kB
          Xilai Dai

          Issue Links

            Activity

              People

              • Assignee:
                davsclaus Claus Ibsen
                Reporter:
                xldai Xilai Dai
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m