3 Replies Latest reply on Feb 6, 2007 4:04 AM by shane.bryzak

    Remoting: premature end of file

    rdewell

      Anyone come across this exception while working with remoting? This trace is from 1.1.0, but this also occurs in 1.1.5.

      [15:58:08,877,ExecutionHandler] Error during remote request
      org.dom4j.DocumentException: Error on line -1 of document : Premature end of file. Nested exception: Premature end of file. at org.dom4j.io.SAXReader.read(SAXReader.java:482) at org.dom4j.io.SAXReader.read(SAXReader.java:343) at org.jboss.seam.remoting.ExecutionHandler.handle(ExecutionHandler.java:68) at org.jboss.seam.remoting.SeamRemotingServlet.doPost(SeamRemotingServlet.java:77)
      


      Not really sure where to begin digging this one out.

      Pretty simple:

      @Local
      public interface ReportManagement {
       @WebRemote
       public String deleteReport(String reportId);
      }
      


      into a stateless component

      @Stateless(name="ManagerReportManagement")
      @Name("ManagerReportManagement")
      @Interceptors(SeamInterceptor.class)
      public class ReportManagementImpl implements ReportManagement, Serializable{
       private static final long serialVersionUID = 246957185452163877L;
      
       @In(value="bright", create=true)
       private transient EntityManager em;
      
       public String deleteReport(String reportId) {
       try {
       Report r = em.find(Report.class, reportId);
      
       if (r == null){
       return "Report not found.";
       } else {
       em.remove(r);
       return "success:" + reportId;
       }
       } catch (Exception e){
       e.printStackTrace();
       return e.getMessage();
       }
       }
      
      
      }
      


      <script type="text/javascript" src="seam/remoting/interface.js?ManagerReportManagement"/>
      
      etc....
      
      Seam.Component.getInstance("ManagerReportManagement").deleteReport(reportId, deleteReportCallback);
      


      Any ideas?



        • 1. Re: Remoting: premature end of file
          shane.bryzak

          Can you turn on debug mode and post the request and response?

          • 2. Re: Remoting: premature end of file
            rdewell

            Sure, only the request shows:

            Mon Feb 05 2007 14:02:02 GMT-0800: Request packet:
            <envelope><header><context></context></header><body><call component="ManagerReportManagement" method="deleteReport" id="0">
            <params><param><str>caba10bf-7526-405d-bdfd-ce9f9c019149</str></param></params><refs></refs></call></body></envelope>
            


            Please let me know if I can get anything else.

            • 3. Re: Remoting: premature end of file
              shane.bryzak

              The request looks fine to me - well formed, no obvious problems, and your other code seems pretty straight forward too. If you post a working example of the issue to jira I'd be glad to take a look at it for you.