- 
        1. Re: SOS !! Wierd Exception: java.lang.IllegalStateException: Packet hasn't been encoded/decoded yetclebert.suconic Dec 6, 2011 9:51 AM (in response to ybhate)What version are you using? Look at the LargeMessage Example Post some code showing what you are doing. 
- 
        2. Re: SOS !! Wierd Exception: java.lang.IllegalStateException: Packet hasn't been encoded/decoded yetybhate Dec 6, 2011 11:30 PM (in response to clebert.suconic)I am using Hornetq-2.2.5 Providing you some portion of the code. Note that this portion of the code fails only when i get the fileData as part of a response to a JMS request message. So this is the flow - only during this flow the code fails and throws exception. Note that all other types of messages are recieved without any problem in the request-respone pattern shown below. The problem is only in the file data transfer. Server 1 ----- sends JMS message to ----> server 2 Server 2 -----> reads a file ---> put the contents of the file into bytes message as shown below --> responds to the message by setting correlationId-->send the message -----> Server 1 Server 2 --> tried to read the data and put it into a disk file --> throws exception the following code is used to put the file data into the BytesMessage ================================================== //assume that somewhere in my code above i am getting the file data in the bufferedInputStream. BytesMessage bytesMessage = session.createBytesMessage(); bytesMessage.setObjectProperty("JMS_HQ_InputStream", bufferedInputStream );bytesMessage.setObjectProperty("ODPAYLOAD", payloadXml); messageId = bytesMessage.getJMSMessageID(); m = bytesMessage; if(properties != null && properties.size() >0) msg_payloadUtil.addProperties(m, properties); m.setJMSCorrelationID(correlationId); the following code is used to read the data from the bytesMessage. And this is where it throws exception =========================================================================== 
 private BufferedInputStream getFileData(BytesMessage byteMsg,String fileName){ BufferedInputStream bufferedInputStream = null;Calendar calendar = Calendar.getInstance(); String filePath= PropertiesUtil.getProperty( "file.store.path").toString();StringBuilder appendFileExt = 
 if(fileName!=null)appendFileExt.append(filePath).append(calendar.getTimeInMillis()).append( "-").append(fileName);
 elseappendFileExt.append(filePath).append(calendar.getTimeInMillis()); 
 if(logger.isDebugEnabled())logger.debug("Storing file into temporary area. File name is " + appendFileExt);
 try{File outputFile = new File(appendFileExt.toString());FileOutputStream fileOutputStream = new FileOutputStream(outputFile);BufferedOutputStream bufferedOutput = new BufferedOutputStream(fileOutputStream);
 if(logger.isDebugEnabled())logger.debug("Size of file data = " + byteMsg.getLongProperty("_HQ_LARGE_SIZE"));
 long startTime = System.currentTimeMillis();byteMsg.setObjectProperty( "JMS_HQ_SaveStream", bufferedOutput); // This is where it throws exception given in my discussion
 long endTime = System.currentTimeMillis();
 if(logger.isDebugEnabled())logger.debug("Time to write to buffer:->"+(endTime-startTime));bufferedInputStream = new BufferedInputStream(new FileInputStream(outputFile));} catch(Exception e){e.printStackTrace(); } 
 return bufferedInputStream;} 
 new StringBuilder();================================================== 
- 
        3. Re: SOS !! Wierd Exception: java.lang.IllegalStateException: Packet hasn't been encoded/decoded yetclebert.suconic Dec 7, 2011 12:06 PM (in response to ybhate)Did you move to a different message on the caller of getFileData ? it should always be the current message being received. You can probably create a sample showing your issue. (use attachments through advanced editor here). 
 
    