weimeilin79 opened a new issue #529:
URL: https://github.com/apache/camel-k-runtime/issues/529


   Error with when trying to do bean mapping in Groovy. 
   
   process('processInvoice')
   
   ``` 
   Caused by: groovy.lang.MissingPropertyException: No such property: 
DELEGATE_FIRST for class: 
org.apache.camel.k.loader.groovy.dsl.BeansConfiguration
        at 
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:65)
        at 
org.codehaus.groovy.vmplugin.v8.IndyGuardsFiltersAndSignatures.unwrap(IndyGuardsFiltersAndSignatures.java:172)
        at 
org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:318)
        at 
org.apache.camel.k.loader.groovy.dsl.Support$Trait$Helper$_processor_closure1.doCall(Support.groovy:26)
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   ```
   
   Code: 
   ```
   beans {
               processInvoice = processor {
                   it.out.body = [
                       orderId: it.in.body.orderId,
                       itemId: it.in.body.itemId,
                       department: 'invoicing',
                       datetime: System.currentTimeMillis(),
                       amount: (it.in.body.quantity * it.in.body.price),
                       currency: 'USD',
                       invoiceId: 'B-0' + (Math.floor(1000 + Math.random() * 
9999))
                   ]
                   it.out.headers['reply-to'] = it.in.body.username
               }
           }
   
           from('amqp:topic:incomingorders?exchangePattern=InOnly')
               .log('Invoicing Notified ${body}')
               .unmarshal().json()
               .delay(30000).asyncDelayed()
               .process('processInvoice')
               .marshal().json()
               .convertBodyTo(String.class)
               .log('H:${headers}')
               .toD('amqp:topic:notifications?exchangePattern=InOnly')
               .to('log:info')
   ```


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to