[ 
https://issues.apache.org/jira/browse/CAMEL-21572?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bartosz Popiela updated CAMEL-21572:
------------------------------------
    Description: 
SetHeader with a simple expression causes NullPointerException to be thrown 
because for runtime other than default (kamelet-main) JBang uses Stub instead 
of the actual component. 

Run the following command ro reproduce:
{code:java}
jbang camel@apache/camel run *  --runtime=spring-boot
{code}
{code:yaml}
- route:
    id: route-603e
    nodePrefixId: route-b8d
    from:
      id: from-6ff9
      uri: timer
      parameters:
        delay: "0"
        timerName: oneTimeTimer
        repeatCount: "1"
      steps:
        - setHeader:
            id: setHeader-c0db
            name: SampleUUID
            expression:
              simple:
                id: simple-536b
                expression: >-
                  This is a sample UUID:
                  ${bean:type:java.util.UUID?method=randomUUID}
        - log:
            id: log-3213
            message: ${header.SampleUUID}

{code}

  was:
SetHeader with a simple expression causes NullPointerException to be thrown 
because for runtime other than default (kamelet-main) JBang uses Stub instead 
of the actual component. 
Run the following command ro reproduce:
{code:java}
jbang camel@apache/camel run *  --runtime=spring-boot
{code}
{code:yaml}
- route:
    id: route-603e
    nodePrefixId: route-b8d
    from:
      id: from-6ff9
      uri: timer
      parameters:
        delay: "0"
        timerName: oneTimeTimer
        repeatCount: "1"
      steps:
        - setHeader:
            id: setHeader-c0db
            name: SampleUUID
            expression:
              simple:
                id: simple-536b
                expression: >-
                  This is a sample UUID:
                  ${bean:type:java.util.UUID?method=randomUUID}
        - log:
            id: log-3213
            message: ${header.SampleUUID}

{code}


> Camel JBang with --runtime=spring-boot throw NullPointerException
> -----------------------------------------------------------------
>
>                 Key: CAMEL-21572
>                 URL: https://issues.apache.org/jira/browse/CAMEL-21572
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jbang
>    Affects Versions: 4.8.2, 4.9.0
>            Reporter: Bartosz Popiela
>            Priority: Minor
>
> SetHeader with a simple expression causes NullPointerException to be thrown 
> because for runtime other than default (kamelet-main) JBang uses Stub instead 
> of the actual component. 
> Run the following command ro reproduce:
> {code:java}
> jbang camel@apache/camel run *  --runtime=spring-boot
> {code}
> {code:yaml}
> - route:
>     id: route-603e
>     nodePrefixId: route-b8d
>     from:
>       id: from-6ff9
>       uri: timer
>       parameters:
>         delay: "0"
>         timerName: oneTimeTimer
>         repeatCount: "1"
>       steps:
>         - setHeader:
>             id: setHeader-c0db
>             name: SampleUUID
>             expression:
>               simple:
>                 id: simple-536b
>                 expression: >-
>                   This is a sample UUID:
>                   ${bean:type:java.util.UUID?method=randomUUID}
>         - log:
>             id: log-3213
>             message: ${header.SampleUUID}
> {code}



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

Reply via email to