You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Charles Moulliard <cm...@gmail.com> on 2009/12/18 16:45:08 UTC

camel bean - Method with name: getReports not found on bean

I get this error but my config seems correct :

Caused by: org.apache.camel.component.bean.MethodNotFoundException: Method
with name: getReports not found on bean:
org.apache.camel.example.reportincident.service.impl.ReportIncidentDaoImpl@1f70bc1on
the exchange: Exchange[JmsMessage: ActiveMQTextMessage {commandId = 5,
responseRequired = true, messageId =
ID:dell-charles-4393-1261150092093-2:16:1:1:1, originalDestination = null,
originalTransactionId = null, producerId =
ID:dell-charles-4393-1261150092093-2:16:1:1, destination = queue://inout,
transactionId = null, expiration = 1261150801796, timestamp = 1261150781796,
arrival = 0, brokerInTime = 1261150781796, brokerOutTime = 1261150781796,
correlationId = dd198de1-fda0-4672-a8c1-ef82a34679cc, replyTo =
temp-queue://ID:dell-charles-4393-1261150092093-2:15:1, persistent = true,
type = null, priority = 4, groupID = null, groupSequence = 0,
targetConsumerId = null, compressed = false, userID = null, content = null,
marshalledProperties = org.apache.activemq.util.ByteSequence@10733fd,
dataStructure = null, redeliveryCounter = 0, size = 0, properties =
{operation=GET_INCIDENTS}, readOnlyProperties = true, readOnlyBody = true,
droppable = false, text = NOT REQUIRED}]
    at
org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:154)
    at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:109)
    at
org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcessor.java:53)


        <camel:route>
            <camel:from uri="queuingservice:queue:inout" />
            <camel:choice>
                <camel:when>
                    <camel:simple>${header.operation} ==
'SAVE'</camel:simple>
                    <camel:bean ref="reportIncidentDao" method="save" />
                </camel:when>
                <camel:when>
                    <camel:simple>${header.operation} ==
'GET_INCIDENTS'</camel:simple>
                    <camel:bean ref="reportIncidentDao" method="getReports"
/>
                </camel:when>
            </camel:choice>


    @Transactional
    public List<ReportIncident> getReports() {
        LOG.info(">> Get Reports !");
        return (List<ReportIncident>) em.createQuery("select i from Incident
i");
    }


Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com
twitter : http://twitter.com/cmoulliard
Linkedlin : http://www.linkedin.com/in/charlesmoulliard

Apache Camel Group :
http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm

Re: camel bean - Method with name: getReports not found on bean

Posted by Willem Jiang <wi...@gmail.com>.
Hi Charles,

Maybe the bean's method is changed when you add the @Transaction 
annotation.
Maybe some aop things get involved with this change.

Willem

Charles Moulliard wrote:
> I get this error but my config seems correct :
> 
> Caused by: org.apache.camel.component.bean.MethodNotFoundException: Method
> with name: getReports not found on bean:
> org.apache.camel.example.reportincident.service.impl.ReportIncidentDaoImpl@1f70bc1on
> the exchange: Exchange[JmsMessage: ActiveMQTextMessage {commandId = 5,
> responseRequired = true, messageId =
> ID:dell-charles-4393-1261150092093-2:16:1:1:1, originalDestination = null,
> originalTransactionId = null, producerId =
> ID:dell-charles-4393-1261150092093-2:16:1:1, destination = queue://inout,
> transactionId = null, expiration = 1261150801796, timestamp = 1261150781796,
> arrival = 0, brokerInTime = 1261150781796, brokerOutTime = 1261150781796,
> correlationId = dd198de1-fda0-4672-a8c1-ef82a34679cc, replyTo =
> temp-queue://ID:dell-charles-4393-1261150092093-2:15:1, persistent = true,
> type = null, priority = 4, groupID = null, groupSequence = 0,
> targetConsumerId = null, compressed = false, userID = null, content = null,
> marshalledProperties = org.apache.activemq.util.ByteSequence@10733fd,
> dataStructure = null, redeliveryCounter = 0, size = 0, properties =
> {operation=GET_INCIDENTS}, readOnlyProperties = true, readOnlyBody = true,
> droppable = false, text = NOT REQUIRED}]
>     at
> org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:154)
>     at
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:109)
>     at
> org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcessor.java:53)
> 
> 
>         <camel:route>
>             <camel:from uri="queuingservice:queue:inout" />
>             <camel:choice>
>                 <camel:when>
>                     <camel:simple>${header.operation} ==
> 'SAVE'</camel:simple>
>                     <camel:bean ref="reportIncidentDao" method="save" />
>                 </camel:when>
>                 <camel:when>
>                     <camel:simple>${header.operation} ==
> 'GET_INCIDENTS'</camel:simple>
>                     <camel:bean ref="reportIncidentDao" method="getReports"
> />
>                 </camel:when>
>             </camel:choice>
> 
> 
>     @Transactional
>     public List<ReportIncident> getReports() {
>         LOG.info(">> Get Reports !");
>         return (List<ReportIncident>) em.createQuery("select i from Incident
> i");
>     }
> 
> 
> Charles Moulliard
> Senior Enterprise Architect
> Apache Camel Committer
> 
> *****************************
> blog : http://cmoulliard.blogspot.com
> twitter : http://twitter.com/cmoulliard
> Linkedlin : http://www.linkedin.com/in/charlesmoulliard
> 
> Apache Camel Group :
> http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm
> 


Re: camel bean - Method with name: getReports not found on bean

Posted by Charles Moulliard <cm...@gmail.com>.
Forget my question.

The method getReports was defined in the class implementing the interface
but not in the interface referenced in my camel-context

Regards,

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com
twitter : http://twitter.com/cmoulliard
Linkedlin : http://www.linkedin.com/in/charlesmoulliard

Apache Camel Group :
http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm


On Fri, Dec 18, 2009 at 4:45 PM, Charles Moulliard <cm...@gmail.com>wrote:

> I get this error but my config seems correct :
>
> Caused by: org.apache.camel.component.bean.MethodNotFoundException: Method
> with name: getReports not found on bean:
> org.apache.camel.example.reportincident.service.impl.ReportIncidentDaoImpl@1f70bc1on the exchange: Exchange[JmsMessage: ActiveMQTextMessage {commandId = 5,
> responseRequired = true, messageId =
> ID:dell-charles-4393-1261150092093-2:16:1:1:1, originalDestination = null,
> originalTransactionId = null, producerId =
> ID:dell-charles-4393-1261150092093-2:16:1:1, destination = queue://inout,
> transactionId = null, expiration = 1261150801796, timestamp = 1261150781796,
> arrival = 0, brokerInTime = 1261150781796, brokerOutTime = 1261150781796,
> correlationId = dd198de1-fda0-4672-a8c1-ef82a34679cc, replyTo =
> temp-queue://ID:dell-charles-4393-1261150092093-2:15:1, persistent = true,
> type = null, priority = 4, groupID = null, groupSequence = 0,
> targetConsumerId = null, compressed = false, userID = null, content = null,
> marshalledProperties = org.apache.activemq.util.ByteSequence@10733fd,
> dataStructure = null, redeliveryCounter = 0, size = 0, properties =
> {operation=GET_INCIDENTS}, readOnlyProperties = true, readOnlyBody = true,
> droppable = false, text = NOT REQUIRED}]
>     at
> org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:154)
>     at
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:109)
>     at
> org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcessor.java:53)
>
>
>         <camel:route>
>             <camel:from uri="queuingservice:queue:inout" />
>             <camel:choice>
>                 <camel:when>
>                     <camel:simple>${header.operation} ==
> 'SAVE'</camel:simple>
>                     <camel:bean ref="reportIncidentDao" method="save" />
>                 </camel:when>
>                 <camel:when>
>                     <camel:simple>${header.operation} ==
> 'GET_INCIDENTS'</camel:simple>
>                     <camel:bean ref="reportIncidentDao" method="getReports"
> />
>                 </camel:when>
>             </camel:choice>
>
>
>     @Transactional
>     public List<ReportIncident> getReports() {
>         LOG.info(">> Get Reports !");
>         return (List<ReportIncident>) em.createQuery("select i from
> Incident i");
>     }
>
>
> Charles Moulliard
> Senior Enterprise Architect
> Apache Camel Committer
>
> *****************************
> blog : http://cmoulliard.blogspot.com
> twitter : http://twitter.com/cmoulliard
> Linkedlin : http://www.linkedin.com/in/charlesmoulliard
>
> Apache Camel Group :
> http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm
>