Hi all,

I am facing an issue that I dont know how to solve.
For Security Reasons I needed to secure a service method that is also
called from a camel route.

<route id="mail.standard.async">
    <from uri="direct:sendMailStandardAsync"/>
    <bean ref="mailService" method="prepareMailHeader"/>
    <to uri="velocity://dummy"/>
    <wireTap uri="direct:sendMailStandardSync"/>
    <transform>
        <constant>OK</constant>
    </transform>
</route>



@PreAuthorize("hasRole('" + BerechtigungName.ROLE_USER + "')")
public void sendMailStandardAsync(*MailInfo* mailInfo) {
    LOG.info("Sending email to [{}]", mailInfo.getTo());
    template.sendBody("direct:sendMailStandardAsync", mailInfo);
}

But now If the route is called I get an Exception:

*No type converter available to convert from type:
ch.prospective.njc.integration.mail.service.MailInfo to the required
type: java.util.Map with value MailInfo*


If I remove the Annotation again, everything works fine. So I assume that
somehow the annotation becomes part of the camel treatment.

Does anybody know how to solve this issue ?


Thanks,
Detlef

Reply via email to