I'm trying to use the Camel EJB component to make a call to an EJB but I'm
having problems calling the bean with anything other then a String.

My Camel version is 2.12.1

When I expose an EJB like:
@Stateless
public class ProcessorService {
        public String process(String argument) {
                return "My String Plus Yours " + argument;
        } 

I can call it with the route:
 <route>
     <from uri="direct:start"/>
        <to
uri="ejb:java:app/service/ProcessorService!com.morphotrust.poc.camel.ProcessorService
?method=process(${body})"/>
    </route>

And everything works.  Side question, the only way I could make it work is
by using the full JNDI address in my URI.  Is there a better/best practice
way to register the beans look up information?


But when I try and call the EJB with a object I get a
NoTypeConversionException.  I'm pretty sure the body of the in message is a
"Domain" object.  For example if I add a method to the above EJB:

public String processAcme(Domain domain) {
                return domain.toString(); 
}

And the error I get when calling the method in the route is:

CamelExecutionException: Exception occurred during execution on the
exchange: Exchange[Message: Domain [persons=[Person [name=your name, dob=Tue
Nov 26 09:28:05 CST 2013, age=11]]]]

 org.apache.camel.NoTypeConversionAvailableException: No type converter
available to convert from type: com.acme.domain.Domain to the required type:
com.acme.domain.Domain with value Domain [persons=[Person [name=your name,
dob=Tue Nov 26 09:28:05 CST 2013, age=11]]]

I'm new to Camel so hopefully I'm just missing something obvious.  Any help
would be great!




 




--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-ejb-in-JBoss-AS7-tp5743866.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to