7 Replies Latest reply on Mar 11, 2008 9:33 PM by Pete Muir

    Seam mail : IncompatibleClassChangeError

    Gregory Tanneau Newbie

      Hi all !


      I would like to have your opinion on my error.
      I have a Seam 2.0.1 EAR running on jboss-4.2.1.GA, using Seam mail with attachement.


      When I compile/deploy on Windows (using jdk1.5) evertything is ok.


      When I compile/deploy on Unix (same jboss, jdk1.5 too), everything seems ok, except when i have an attached file in my email :


      Here is the view :


      <m:message xmlns="http://www.w3.org/1999/xhtml"
                 xmlns:m="http://jboss.com/products/seam/mail"
                 xmlns:ui="http://java.sun.com/jsf/facelets"
                 xmlns:f="http://java.sun.com/jsf/core"
                 xmlns:h="http://java.sun.com/jsf/html">
      
          <m:from name="do-not@reply.fr" address="do-not@reply.fr" />
          
          <m:to name="#{identity.username} &lt;#{emailSender.email}&gt;">#{emailSender.email}</m:to>
          
          <m:subject>The e-mail you requested (Pdf attached)</m:subject>
          
          <m:body type="html">
            <html>
             <body>
              <p><h:outputText value="Dear #{identity.username}" />,</p>
              <p>This example email demonstrates how <u>easy</u> it is to send an email!</p>
              <br />
              <p>Regards.</p>
             </body>
            </html>
          </m:body>
          
          <m:attachment fileName="pdf_users.pdf">
            <ui:include src="/test/pdf_test.xhtml" />
          </m:attachment>
          
      </m:message>
      



      Here is what I get, after compiling, recompiling, testing and testing again :


      2008-03-10 18:21:06,069 ERROR [org.jboss.seam.web.ExceptionFilter] exception root cause
      javax.faces.FacesException: #{emailSender.sendPdf()}: java.lang.reflect.InvocationTargetException
              at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:107)
              at javax.faces.component.UICommand.broadcast(UICommand.java:383)
              at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:184)
              at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:162)
              at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:350)
              at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
              at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              at java.lang.Thread.run(Thread.java:595)
      Caused by: javax.faces.el.EvaluationException: java.lang.reflect.InvocationTargetException
              at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
              at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
              ... 43 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.seam.util.Reflections.invoke(Reflections.java:21)
              at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
              at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
              at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
              at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
              at com.test.sandbox.EmailSender_$$_javassist_4.sendPdf(EmailSender_$$_javassist_4.java)
              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.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
              at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:274)
              at org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
              at org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)
              at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
              at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
              at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
              at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
              ... 44 more
      Caused by: java.lang.IncompatibleClassChangeError
              at org.jboss.seam.mail.ui.UIAttachment.encodeEnd(UIAttachment.java:150)
              at org.jboss.seam.ui.util.JSF.renderChild(JSF.java:181)
              at org.jboss.seam.ui.util.JSF.renderChildren(JSF.java:163)
              at org.jboss.seam.mail.ui.UIMessage.encodeChildren(UIMessage.java:165)
              at org.jboss.seam.ui.util.JSF.renderChild(JSF.java:175)
              at org.jboss.seam.ui.util.JSF.renderChildren(JSF.java:163)
              at org.jboss.seam.ui.facelet.FaceletsRenderer.renderFacelet(FaceletsRenderer.java:206)
              at org.jboss.seam.ui.facelet.FaceletsRenderer$1.process(FaceletsRenderer.java:160)
              at org.jboss.seam.ui.facelet.FaceletsRenderer$RenderingContext.run(FaceletsRenderer.java:78)
              at org.jboss.seam.ui.facelet.FaceletsRenderer.render(FaceletsRenderer.java:169)
              at org.jboss.seam.framework.Controller.render(Controller.java:108)
              at com.test.sandbox.EmailSender.send(EmailSender.java:13)
              at com.test.sandbox.EmailSender.sendPdf(EmailSender.java:23)
              ... 71 more
      



      Even if I try to put a simple attachment (image, or even plain text), I have the same error.


      If a remove the attachment, everything is ok ...



      Could you help me, or give me an advice ?


      Thanks !