1 2 3 Previous Next 35 Replies Latest reply on Jul 10, 2006 6:05 PM by rpa_rio

    IOExceptions with MyFaces/Facelets apps

      Hi,

      I'm getting this error when i use JBossSerialization with MyFaces/Facelets apps:

      javax.faces.FacesException: java.io.IOException
      at org.apache.myfaces.shared_impl.util.StateUtils.getAsObject(
      StateUtils.java:302)
      at org.apache.myfaces.shared_impl.util.StateUtils.reconstruct(
      StateUtils.java:229)
      at
      org.apache.myfaces.renderkit.html.HtmlResponseStateManager.getComponentStateToRestore
      (HtmlResponseStateManager.java:221)
      at
      org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreComponentState
      (JspStateManagerImpl.java:186)
      at
      org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(
      JspStateManagerImpl.java:287)
      at org.apache.myfaces.application.jsp.JspViewHandlerImpl.restoreView
      (JspViewHandlerImpl.java:255)
      at com.apress.projsf.weblets.faces.ViewHandlerWrapper.restoreView(
      ViewHandlerWrapper.java:77)
      at com.sun.facelets.FaceletViewHandler.restoreView(
      FaceletViewHandler.java:317)
      at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(
      LifecycleImpl.java:141)
      at org.apache.myfaces.lifecycle.LifecycleImpl.execute(
      LifecycleImpl.java :66)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
      ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(
      ApplicationFilterChain.java:173)
      at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(
      ExtensionsFilter.java:181)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
      ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(
      ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(
      StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(
      StandardContextValve.java:178)
      at org.apache.catalina.core.StandardHostValve.invoke(
      StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(
      ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(
      StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(
      CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process (
      Http11Processor.java:869)
      at
      org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
      (Http11BaseProtocol.java:664)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket (
      PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
      LeaderFollowerWorkerThread.java:80)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run (
      ThreadPool.java:684)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: java.io.IOException
      at
      org.jboss.serial.persister.RegularObjectPersister.readSlotWithMethod(
      RegularObjectPersister.java:107)
      at org.jboss.serial.persister.RegularObjectPersister.defaultRead(
      RegularObjectPersister.java:269)
      at org.jboss.serial.persister.RegularObjectPersister.readData (
      RegularObjectPersister.java:241)
      at
      org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming
      (ObjectDescriptorFactory.java:411)
      at
      org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription
      (ObjectDescriptorFactory.java:81)
      at
      org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject
      (DataContainer.java:634)
      at org.jboss.serial.persister.ArrayPersister.readObjectArray(
      ArrayPersister.java:196)
      at org.jboss.serial.persister.ArrayPersister.readData(
      ArrayPersister.java :172)
      at
      org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming
      (ObjectDescriptorFactory.java:411)
      at
      org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription
      (ObjectDescriptorFactory.java:81)
      at
      org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject
      (DataContainer.java:634)
      at org.jboss.serial.io.JBossObjectInputStream.readObjectOverride (
      JBossObjectInputStream.java:163)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:333)
      at org.apache.myfaces.shared_impl.util.StateUtils.getAsObject(
      StateUtils.java :293)
      ... 27 more
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke (
      NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(
      DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at
      org.jboss.serial.persister.RegularObjectPersister.readSlotWithMethod(
      RegularObjectPersister.java:103)
      ... 40 more
      Caused by: java.io.IOException
      at
      org.jboss.serial.persister.RegularObjectPersister.readSlotWithMethod(
      RegularObjectPersister.java:107)
      at org.jboss.serial.persister.RegularObjectPersister.defaultRead(
      RegularObjectPersister.java :269)
      at org.jboss.serial.persister.RegularObjectPersister.readData(
      RegularObjectPersister.java:241)
      at
      org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming
      (ObjectDescriptorFactory.java:411)
      at
      org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription
      (ObjectDescriptorFactory.java:81)
      at
      org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject
      (DataContainer.java:634)
      at org.jboss.serial.persister.ArrayPersister.readObjectArray(
      ArrayPersister.java:196)
      at org.jboss.serial.persister.ArrayPersister.readData(
      ArrayPersister.java :172)
      at
      org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming
      (ObjectDescriptorFactory.java:411)
      at
      org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription
      (ObjectDescriptorFactory.java:81)
      at
      org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject
      (DataContainer.java:634)
      at org.jboss.serial.persister.ArrayPersister.readObjectArray (
      ArrayPersister.java:196)
      at org.jboss.serial.persister.ArrayPersister.readData(
      ArrayPersister.java:172)
      at
      org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming
      (ObjectDescriptorFactory.java:411)
      at
      org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription
      (ObjectDescriptorFactory.java:81)
      at
      org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject
      (DataContainer.java:634)
      at org.jboss.serial.persister.ArrayPersister.readObjectArray(
      ArrayPersister.java:196)
      at org.jboss.serial.persister.ArrayPersister.readData(
      ArrayPersister.java :172)
      at
      org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming
      (ObjectDescriptorFactory.java:411)
      at
      org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription
      (ObjectDescriptorFactory.java:81)
      at
      org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject
      (DataContainer.java:634)
      at
      org.jboss.serial.persister.ObjectInputStreamProxy.readObjectOverride (
      ObjectInputStreamProxy.java:68)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:333)
      at java.util.ArrayList.readObject(ArrayList.java:592)
      ... 45 more
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.GeneratedMethodAccessor370.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(
      DelegatingMethodAccessorImpl.java :25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at
      org.jboss.serial.persister.RegularObjectPersister.readSlotWithMethod(
      RegularObjectPersister.java:103)
      ... 68 more
      Caused by: org.jboss.serial.exception.SerializationException: Could not
      create instance of com.sun.facelets.impl.DefaultFacelet$ApplyToken - Class
      org.jboss.serial.classmetamodel.ClassMetaData can not access a member of
      class com.sun.facelets.impl.DefaultFacelet$ApplyToken with modifiers
      "public"
      at org.jboss.serial.classmetamodel.ClassMetaData.newInstance(
      ClassMetaData.java:331)
      at org.jboss.serial.persister.ExternalizePersister.readData(
      ExternalizePersister.java:67)
      at
      org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming
      (ObjectDescriptorFactory.java :411)
      at
      org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription
      (ObjectDescriptorFactory.java:81)
      at
      org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject
      (DataContainer.java:634)
      at
      org.jboss.serial.persister.ObjectInputStreamProxy.readObjectOverride(
      ObjectInputStreamProxy.java:68)
      at java.io.ObjectInputStream.readObject (ObjectInputStream.java:333)
      at java.util.HashMap.readObject(HashMap.java:1013)
      ... 72 more
      Caused by: java.lang.IllegalAccessException: Class
      org.jboss.serial.classmetamodel.ClassMetaData can not access a member of
      class com.sun.facelets.impl.DefaultFacelet$ApplyToken with modifiers
      "public"
      at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:486)
      at org.jboss.serial.classmetamodel.ClassMetaData.newInstance(
      ClassMetaData.java:322)
      ... 79 more

        • 1. Re: IOExceptions with MyFaces/Facelets apps
          clebert.suconic

          There is some classLoading isolation problem. A class that you can serialize is not available when you are unloading it.

          I would need a testcase to work on if this is not the scenario.

          • 2. Re: IOExceptions with MyFaces/Facelets apps

            i'll create a small webapp ASAP. Can i create a jira ticket?

            • 3. Re: IOExceptions with MyFaces/Facelets apps
              clebert.suconic

              Sure you can.
              if you could attach instrutions on how to reproduce the error.

              • 4. Re: IOExceptions with MyFaces/Facelets apps

                Reproduce is not easy, the user must navigate a little and do some actions and the error happens... Very strange...

                • 5. Re: IOExceptions with MyFaces/Facelets apps
                  clebert.suconic

                  If you could create a WAR (with source code), I could try to reproduce it here.

                  • 6. Re: IOExceptions with MyFaces/Facelets apps
                    clebert.suconic

                    BTW: You are using 1.0.1.GA, right?

                    • 7. Re: IOExceptions with MyFaces/Facelets apps

                      yes

                      • 8. Re: IOExceptions with MyFaces/Facelets apps
                        clebert.suconic

                        can you try CVS now?

                        I guess this was JBSER-77 .

                        You will also find a jar on http://jira.jboss.com/jira/browse/JBSER-78

                        • 9. Re: IOExceptions with MyFaces/Facelets apps

                          I downloaded the sources from cvs and build the jar, but no sucess...

                          • 10. Re: IOExceptions with MyFaces/Facelets apps

                            This bug is very difficult to reproduce. I have the war here, but this error only occurs few times.

                            • 11. Re: IOExceptions with MyFaces/Facelets apps
                              clebert.suconic

                              Is com.sun.facelets.impl.DefaultFacelet$DefaultToken serializable?

                              If not... does com.sun.facelets.impl.DefaultFacelet$DefaultToken has a default constructor?


                              In what circunstances you would have DefaultToken created?

                              • 12. Re: IOExceptions with MyFaces/Facelets apps
                                • 13. Re: IOExceptions with MyFaces/Facelets apps
                                  iktuz

                                  Hi folks. I am getting the same error:

                                  java.io.IOException
                                   at org.jboss.serial.persister.RegularObjectPersister.readSlotWithMethod(RegularObjectPersister.java:107)
                                   at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:269)
                                   at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241)
                                   at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:411)
                                   at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:81)
                                   at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:841)
                                   at org.jboss.serial.io.MarshalledObjectForLocalCalls.get(MarshalledObjectForLocalCalls.java:60)
                                   at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:61)
                                   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                                   at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
                                   at $Proxy93.getMMSList(Unknown Source)
                                  


                                  Here you can analyse the method implementation:

                                  
                                  //...
                                  @Stateless(name = OperationService.NAME)
                                  @Remote(OperationRemote.class)
                                  @Local(OperationLocal.class)
                                  public class OperationServiceImpl implements OperationRemote, OperationLocal {
                                  
                                  public List<MMSEvent> getMMSList(final String id, final SearchFilter filter,
                                   final RequestInfo reqInfo) throws InvalidKeyException,
                                   IllegalArgumentException, NoSuchAlgorithmException,
                                   NoSuchPaddingException, IllegalBlockSizeException,
                                   BadPaddingException, SQLException, ClassNotFoundException,
                                   InstantiationException, IllegalAccessException,
                                   InvocationTargetException, IOException {
                                  
                                   setResultClass(MMSEvent.class);
                                   final Object[] params = new Object[] { id };
                                   return performSelect(MMS_LIST, params);
                                   }
                                  //...
                                  }
                                  


                                  Actually I think that the code above is not so much interesting in fact, but what is returned by it:

                                  package br.com.suntech.vigiadados.ext.service.oper;
                                  
                                  import java.io.Serializable;
                                  import java.sql.Blob;
                                  import java.sql.Date;
                                  
                                  import br.com.suntech.util.database.persistence.annot.ColumnAnnotation;
                                  
                                  /**
                                   * It encapsulates:
                                   * <li>String peerPhone;</li>
                                   * <li>String originator;</li>
                                   * <li>Blob payload;</li>
                                   * <li>Date reportTime;</li>
                                   */
                                  @SuppressWarnings("serial")
                                  public class MMSEvent implements Serializable {
                                  
                                   @ColumnAnnotation(columnName = "PEER_PHONE")
                                   private String peerPhone;
                                  
                                   @ColumnAnnotation(columnName = "ORIGINATOR")
                                   private String originator;
                                  
                                   @ColumnAnnotation(columnName = "PAYLOAD")
                                   private Blob payload;
                                  
                                   @ColumnAnnotation(columnName = "REPORT_TIME")
                                   private Date reportTime;
                                  
                                   public String getOriginator() {
                                   return originator;
                                   }
                                  
                                   public void setOriginator(String originator) {
                                   this.originator = originator;
                                   }
                                  
                                   public Blob getPayload() {
                                   return payload;
                                   }
                                  
                                   public void setPayload(Blob payload) {
                                   this.payload = payload;
                                   }
                                  
                                   public String getPeerPhone() {
                                   return peerPhone;
                                   }
                                  
                                   public void setPeerPhone(String peerPhone) {
                                   this.peerPhone = peerPhone;
                                   }
                                  
                                   public Date getReportTime() {
                                   return reportTime;
                                   }
                                  
                                   public void setReportTime(Date reportTime) {
                                   this.reportTime = reportTime;
                                   }
                                  
                                  }
                                  


                                  The method getMMSList(...) performs without problems because I put sysout´s between each line and all are printed :) I suspect that the blob field is the villain. So I am guessing that during the serialization process the problem occurs. Has someone any idea what is going on? Thanks a lot dudes, bye.

                                  • 14. Re: IOExceptions with MyFaces/Facelets apps
                                    clebert.suconic

                                     

                                    "iktuz" wrote:
                                    Hi folks. I am getting the same error:


                                    It looks like this is a different error. Can you provide the whole stack trace? (I'm interested in the causes of the IOException).


                                    1 2 3 Previous Next