4 Replies Latest reply on Feb 26, 2009 11:35 PM by noahmiller

    Seam 2.1.1GA and Jboss 5.0.0GA compatibility?!

    wespe

      I have a project utilizing Seam 2.1.1GA that is working perfect on Jboss 4.2.3GA


      But when I deploy it on Jboss 5.0.0GA, I get the following exception while trying to login:




      18:25:20,921 WARN  [QuerySplitter] no persistent classes found for query class: select u from org.domain.sense.entity.UserDetail u where username = :username
      18:25:20,921 ERROR [SeamLoginModule] Error invoking login method
      java.lang.IllegalArgumentException: org.hibernate.QueryParameterException: could not locate named parameter [username]
           at org.hibernate.ejb.QueryImpl.setParameter(QueryImpl.java:206)
           at org.jboss.seam.security.management.JpaIdentityStore.lookupUser(JpaIdentityStore.java:762)
           at org.jboss.seam.security.management.JpaIdentityStore.authenticate(JpaIdentityStore.java:726)
           at org.jboss.seam.security.management.IdentityManager.authenticate(IdentityManager.java:262)
           at org.jboss.seam.security.jaas.SeamLoginModule.login(SeamLoginModule.java:126)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at javax.security.auth.login.LoginContext.invoke(Unknown Source)
           at javax.security.auth.login.LoginContext.access$000(Unknown Source)
           at javax.security.auth.login.LoginContext$5.run(Unknown Source)
           at java.security.AccessController.doPrivileged(Native Method)
           at javax.security.auth.login.LoginContext.invokeCreatorPriv(Unknown Source)
           at javax.security.auth.login.LoginContext.login(Unknown Source)
           at org.jboss.seam.security.Identity.authenticate(Identity.java:335)
           at org.jboss.seam.security.Identity.authenticate(Identity.java:324)
           at org.jboss.seam.security.Identity.login(Identity.java:253)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
           at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
           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:88)
           at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
           at javax.faces.component.UICommand.broadcast(UICommand.java:387)
           at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
           at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
           at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
           at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
           at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
           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.IdentityFilter.doFilter(IdentityFilter.java:38)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
           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:177)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
           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.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:51)
           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:235)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
           at java.lang.Thread.run(Unknown Source)
      Caused by: org.hibernate.QueryParameterException: could not locate named parameter [username]
           at org.hibernate.engine.query.ParameterMetadata.getNamedParameterDescriptor(ParameterMetadata.java:99)
           at org.hibernate.engine.query.ParameterMetadata.getNamedParameterExpectedType(ParameterMetadata.java:105)
           at org.hibernate.impl.AbstractQueryImpl.determineType(AbstractQueryImpl.java:437)
           at org.hibernate.impl.AbstractQueryImpl.setParameter(AbstractQueryImpl.java:407)
           at org.hibernate.ejb.QueryImpl.setParameter(QueryImpl.java:201)
           ... 81 more
      18:25:22,796 INFO  [AuthenticationEvents] Login Failed:  siftg null



      What could be the reason for this?

        • 1. Re: Seam 2.1.1GA and Jboss 5.0.0GA compatibility?!
          tll

          I think that I might have stumbled upon a variant of this problem, there is no problem running on JBoss AS 4.2.3 GA.


          When attempting to persist a JPA entity in Seam 2.1.1 GA on JBoss AS 5.0.0 GA it throws an IllegalArgumentException: Unknown entity. Despite the fact that previously during the start-up process, it says that the same entity has been bound - think its the EntityManagerFactory speaking.


          The project is a WAR package, generated with JBoss Tools 3.0.0-CR1.


          Perhaps there is a common thread in our problems?


          Best regards,
          Tommy

          • 2. Re: Seam 2.1.1GA and Jboss 5.0.0GA compatibility?!
            wespe

            Mine is also a WAR package produced by JBoss Tools 3.0.0-CR1!


            By the way I've also experienced that if I Clean.. the project on the JBoss 5.0.0GA than it will begin to undeploy/redeploy the project until the server is shut down..


            Regards, Gabor

            • 3. Re: Seam 2.1.1GA and Jboss 5.0.0GA compatibility?!
              wespe

              This one did the trick: https://jira.jboss.org/jira/browse/JBSEAM-3821


              But the error message is confusing..

              • 4. Re: Seam 2.1.1GA and Jboss 5.0.0GA compatibility?!
                noahmiller
                I was getting the same error ("could not locate named parameter [username]") when a web service method called Identity.login().  I'm using Seam 2.1.1 and JBoss 5.  I had been deploying my app as a war and had just switched to ear deployment because of problems with the web services, and in doing so had not updated the persistence*.xml and components.xml files properly. 

                I solved the problem with a few changes to these files (I'm not sure exactly which made the key difference).

                Changes to persistence-*.xml:
                * Removed "transaction-type="JTA"" from the persistence-unit
                * Added jboss.entity.manager.factory.jndi.name property

                Changes to components.xml:
                * Removed the entity-manager-factory property from persistence:managed-persistence-context
                * Removed persistence:entity-manager-factory

                Hope that helps someone,
                Noah