camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From takidean <>
Subject what's wrong with mina endpoint
Date Thu, 02 May 2013 09:44:01 GMT
i have to send from a web service an id to a socket server .
when i get the id in my exchange then i use to send it 

        <to uri="mina:tcp://localhost:13266?textline=true&amp;sync=false"/>
i get this error

[                qtp21158020-25] WebApplicationExceptionMapper  WARN
org.apache.camel.CamelExchangeException: Cannot write body.
Exchange[Message: insertinsert111]

my code is here
        <from uri="cxfrs://bean://solde"/>
        <convertBodyTo type="java.lang.String"/>
        <process ref="conv"/>
        <to uri="mina:tcp://localhost:13266?textline=true&amp;sync=false"/>
            <description>&lt;bean ref="Provider"/&gt;</description>
        <bean ref="test"/>

/**********socket server***********/
public class ServerFile {
     public static void main (String [] args ) throws Exception {
    // create socket
    ServerSocket servsock = new ServerSocket(13266);
    while (true) {

      Socket sock = servsock.accept();
      System.out.println("Accepted connection : " + sock);
      OutputStream os = sock.getOutputStream();
    new ServerFile().send(os);

  public void send(OutputStream os) throws Exception{
      // sendfile
      File myFile = new File ("C:\\taki\\taki.txt");
      byte [] mybytearray  = new byte [(int)myFile.length()+1];
      FileInputStream fis = new FileInputStream(myFile);
      BufferedInputStream bis = new BufferedInputStream(fis);,0,mybytearray.length);


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message