8 Replies Latest reply on Aug 4, 2011 4:44 AM by Sebastian Sachtleben

    Excepetion in Tomcat 7+Seam3 project.

    hantsy bai Master

      javax.el.PropertyNotFoundException: /resetPassword.xhtml @26,94 value="#{resetPasswordAction.resetPwdEmail}": Target Unreachable, identifier 'resetPasswordAction' resolved to null
           at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:100)
           at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:95)
           at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1030)
           at javax.faces.component.UIInput.validate(UIInput.java:960)
           at javax.faces.component.UIInput.executeValidate(UIInput.java:1233)
           at javax.faces.component.UIInput.processValidators(UIInput.java:698)
           at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1214)
           at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1214)
           at javax.faces.component.UIForm.processValidators(UIForm.java:253)
           at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1214)
           at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1214)
           at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1172)
           at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
           at org.jboss.seam.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
           at org.jboss.seam.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:72)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
           at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:301)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:162)
           at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
           at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
           at java.lang.Thread.run(Thread.java:662)

      The resetPassword.xhtml code:

      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
          <ui:define name="content">
              <div class="section">
                  <h1>Reset Your Password</h1>
              <div class="section">
                  <div class="errors"><h:messages id="messages" globalOnly="true" />
                  <h:form id="pwdForm" prependId="false">
                          <p:input id="current" label="Eamil">
                              <h:inputText id="input" value="#{resetPasswordAction.resetPwdEmail}">
                                  <f:validator validatorId="emailExistenceValidator" />
                          <div class="buttonBox"><h:commandButton id="change"
                                                                  value="Change" action="#{resetPasswordAction.resetPassword}" />
                              #{' '} <h:button id="cancel" value="Cancel" outcome="/index.xhtml" /></div>
          <ui:define name="sidebar">
              <div class="content">
                  <h1>Simple things should be easy</h1>
                  <p>(And so should some complex things.) You shouldn't have to
                write four different classes just to change a password. Traditional
                J2EE architectures require that developers spend more time writing
                code to make the frameworks happy, than they ever get to spend writing
                code to make the user happy. Seam lets you reduce the size of your
                code dramatically. And that reduces bugs. And it makes refactoring
                easier. And it makes delivering new functionality quicker.
                Productivity matters. But with Seam, JSF, EJB 3.0 and jBPM, you don't
                need to sacrifice the ability to handle complex problems just to
                achieve great productivity.</p>


      @Named(value = "resetPasswordAction")
      public class ResetPasswordAction implements Serializable {
          private Instance<MailMessage> mailMessage;
          private ResourceProvider resourceProvider;
          private Instance<TemplateCompiler> templateCompiler;
          private Instance<Session> session;
          private String resetPwdEmail;
          UserService userService;
          Messages messages;
          public String getResetPwdEmail() {
              return resetPwdEmail;
          public void setResetPwdEmail(String resetPwdEmail) {
              this.resetPwdEmail = resetPwdEmail;
          public void resetPassword() {
              User user = userService.findUserByEmail(resetPwdEmail);
              String newPassword = "2222cc";
              try {
                  sendNewPassword(user.getUsername(), newPassword);
              } catch (MalformedURLException ex) {
                  Logger.getLogger(ResetPasswordAction.class.getName()).log(Level.SEVERE, null, ex);
              messages.info(new DefaultBundleKey("account_passwordReset")).defaults("New password was sent to your email, please check it later.");
          public void sendNewPassword(String user, String password) throws MalformedURLException {
              mailMessage.get().from("seam@test.test", "Bifincan.com").to(resetPwdEmail).subject("Reset Password").bodyHtml(new RenderTemplate(templateCompiler.get(), "reset-password.html.render")).put("username", user).put("password", password).importance(MessagePriority.HIGH).send(session.get());

      In tomcat console, more expcetion info like this:

      [WARNING] [talledLocalContainer] 严重: Exception sending request initialized lif
      ecycle event to listener instance of class org.jboss.weld.environment.servlet.Li
      [WARNING] [talledLocalContainer] org.jboss.weld.context.ContextNotActiveExceptio
      n: WELD-001303 No active contexts for scope type javax.enterprise.context.Reques
      [WARNING] [talledLocalContainer]        at org.jboss.weld.manager.BeanManagerImp
      [WARNING] [talledLocalContainer]        at org.jboss.weld.bean.proxy.ContextBean
      [WARNING] [talledLocalContainer]        at org.jboss.weld.bean.proxy.ProxyMethod
      [WARNING] [talledLocalContainer]        at org.jboss.seam.transaction.EntityTran
      [WARNING] [talledLocalContainer]        at org.jboss.seam.persistence.ManagedPer
      [WARNING] [talledLocalContainer]        at org.jboss.seam.persistence.ManagedPer
      [WARNING] [talledLocalContainer]        at $Proxy30.closeAfterTransaction(Unknow
      n Source)
      [WARNING] [talledLocalContainer]        at org.jboss.seam.persistence.ManagedPer
      [WARNING] [talledLocalContainer]        at org.jboss.seam.persistence.ManagedPer
      [WARNING] [talledLocalContainer]        at org.jboss.seam.solder.bean.ImmutableB
      [WARNING] [talledLocalContainer]        at org.jboss.weld.context.ForwardingCont
      [WARNING] [talledLocalContainer]        at org.jboss.weld.context.AbstractContex
      [WARNING] [talledLocalContainer]        at org.jboss.weld.context.AbstractContex
      [WARNING] [talledLocalContainer]        at org.jboss.weld.context.AbstractConver
      [WARNING] [talledLocalContainer]        at org.jboss.weld.servlet.WeldListener.r
      [WARNING] [talledLocalContainer]        at org.jboss.weld.servlet.api.helpers.Fo
      [WARNING] [talledLocalContainer]        at org.apache.catalina.core.StandardCont
      [WARNING] [talledLocalContainer]        at org.apache.catalina.core.StandardCont
      [WARNING] [talledLocalContainer]        at org.apache.catalina.authenticator.Aut
      [WARNING] [talledLocalContainer]        at org.apache.catalina.core.StandardHost
      [WARNING] [talledLocalContainer]        at org.apache.catalina.valves.ErrorRepor
      [WARNING] [talledLocalContainer]        at org.apache.catalina.valves.AccessLogV
      [WARNING] [talledLocalContainer]        at org.apache.catalina.core.StandardEngi
      [WARNING] [talledLocalContainer]        at org.apache.catalina.connector.CoyoteA
      [WARNING] [talledLocalContainer]        at org.apache.coyote.http11.Http11Proces
      [WARNING] [talledLocalContainer]        at org.apache.coyote.http11.Http11Protoc
      [WARNING] [talledLocalContainer]        at org.apache.tomcat.util.net.JIoEndpoin
      [WARNING] [talledLocalContainer]        at java.util.concurrent.ThreadPoolExecut
      [WARNING] [talledLocalContainer]        at java.util.concurrent.ThreadPoolExecut
      [WARNING] [talledLocalContainer]        at java.lang.Thread.run(Thread.java:662)

      I haved tried Conversation scope and request code on ResetPasswordAction, it does not work.

        • 1. Re: Excepetion in Tomcat 7+Seam3 project.
          Jason Porter Master

          You don't need @Transactional if you're coming through a JSF request with Seam Faces. I don't see anything else that would be a cause for problems. You also only need to specify a value for @Named if you want it something different than the default (simple class name with the first letter lower cased).

          • 2. Re: Excepetion in Tomcat 7+Seam3 project.
            hantsy bai Master

            @Transactional removed.

            The same result.

            I want to know if every module of Seam3 have been test on Servlet Container(NONE JEE enviroment)?

            In these days, I have posted several problem I encountered in Tomcat 6/7 container. I think some of the modules have not been tested in Servlet container.

            • 3. Re: Excepetion in Tomcat 7+Seam3 project.
              Jason Porter Master

              No, many modules are not tested it servlet environment, we're targeting AS7 for the main container in Seam 3.1. You're running in an environment where you have to do all of the integration yourself (one of the main reasons for using a full application server). We'd very much like to support as many configurations as possible, however, we simply do not have enough resources to do it all.

              We very much welcome your contributions, especially in testing. If you would like to help with the effort come to #seam-dev in irc.freenode.net and study up on arquillian to help us out!

              • 4. Re: Excepetion in Tomcat 7+Seam3 project.
                hantsy bai Master

                Thanks for ur reply.

                I would like introduce Seam 3 in our current project, but the customer seems to be stuck with Tomcat as runtime container and he did not want to use Jboss at all.

                If Weld/Seam3 design is flexible as it was declared. I think Seam 3 team must prepare test environment for Servlet and JEE container at the same time.

                Ideally , the core module(Solder module) should be in charge for detection the feature availability of the container, such as transaction, ejb, schedule, etc(I had seen some detection info when tomcat starts up), other modules are based on the core api and care little about container itself.

                I hope in the future Seam 3 development progress, more application servers will be considered as test environment.

                I have filed all the problems I encountered in these days on Seam 3 JIRA.

                • 5. Re: Excepetion in Tomcat 7+Seam3 project.
                  Jason Porter Master

                  If Tomcat is a must (I must say I don't fully understand shops like this (yes, I've worked in some as well), JBoss is actually built on top of Tomcat, and AS7 has a smaller footprint and is all-around faster than tomcat as well. Oh well.) I would recommend looking at TomEE

                  • 6. Re: Excepetion in Tomcat 7+Seam3 project.
                    Thierry Ler Newbie

                    Same situation here. I have to use Tomcat because my client does not want to install Jboss. In fact my client does not want to ask our hosting provider to get jboss. My client thinks that it is too complicate (if the provider have to learn and bla bla bla). And we do not even know if the provider allready have jboss or not... Arf. My client said I can ask for jboss if i can't do only with the cat. So I have to come back with very good reasons. Of course I can't say that all Seam 3 does not work on tomcat because my client will tell to switch into spring...

                    • 7. Re: Excepetion in Tomcat 7+Seam3 project.
                      hantsy bai Master

                      I have moved to Spring 3(Spring 3,Spring Security 3, Primefaces, JPA2) now, I do not want to waste time on Seam 3 and tomcat, I hope use Seam 3 in future, maybe it become more mature at that time.

                      Seam 3 is so stuck with JBoss application server.

                      My before code is based on the Booking example, even it is simple, but it dose not work.
                      Such as ResetPasswordAction(either session scope or request scope) here, Seam does not prepare an object at runtime, I added @PostContruct to debug it, I can see the debug info when entered the page, so the exception here is threw.

                      Another class, PasswordManager, which is also from Booking example, can not work correctly in Tomcat, I must implement Serializer interface and change the scope to SessionScoped, it will work. Why? Only because it injected a SessionScoped user property? I can not understand.

                      I am not sure if all of modules are tested on Tomcat container before, till I got fatal error when configured Security and Rest module, I am sure these two are NOT tested on Tomcat.

                      • 8. Re: Excepetion in Tomcat 7+Seam3 project.
                        Sebastian Sachtleben Novice

                        Well that is sad. Anyway Sun prefer their Glassfish and Red Hat prefer their Jboss AS. I think its quite normal. And I really have to say I would like to have an optimized framework for one application server instead of working unstable on several application servers.

                        I can suggest 1and1 cloud servers. Runs like a beast since weeks without any downtime. :)