6 Replies Latest reply on Oct 10, 2008 3:58 AM by Alfonso Fernandez

    Parameter userName does not exist as a named parameter

    eleman eleman Newbie

      hi all

      I have a problem while getting actor emil from db

      
      IdentitySession identitySession=new IdentitySession(JbpmContext.getCurrentJbpmContext().getSession());
       User jbpmUser=identitySession.getUserByName(actor);
      
      
      


      i gor error at runtime with this code
      jbpmUser=identitySession.getUserByName(actor);

      Error



      java.lang.IllegalArgumentException: Parameter userName does not exist as a named parameter in [select u from org.jbpm.identity.User as u where u.name = :userName]
       at org.hibernate.impl.AbstractQueryImpl.setParameter(AbstractQueryImpl.java:356)
       at org.hibernate.impl.AbstractQueryImpl.setString(AbstractQueryImpl.java:636)
       at org.jbpm.identity.hibernate.IdentitySession.getUserByName(IdentitySession.java:164)
       at com.sampas.akos.workFlow.tools.MailActionHandler.execute(MailActionHandler.java:82)
       at org.jbpm.graph.def.Action.execute(Action.java:122)
       at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:255)
       at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:220)
       at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:190)
       at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:174)
       at org.jbpm.graph.exe.Token.signal(Token.java:200)
       at org.jbpm.graph.exe.Token.signal(Token.java:139)
       at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:476)
       at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:390)
       at com.sampas.akos.workFlow.servis.AkosWorkFlow.closeProcessInstance(AkosWorkFlow.java:197)
       at com.sampas.akos.iacr.web.controller.GSBasvuruController.saveBasvuru(GSBasvuruController.java:256)
       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.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
       at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1186)
       at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:147)
       at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
       at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
       at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
       at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
       at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
       at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
       at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
       at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
       at java.lang.Thread.run(Thread.java:595)
      
      
      


      Thanks All

        • 1. Re: Parameter userName does not exist as a named parameter
          eleman eleman Newbie

          yeah i found problem

          because of classpath. i added jbpm-identity.jar and jbpm-jpdl.jar

          • 2. Re: Parameter userName does not exist as a named parameter
            Alfonso Fernandez Newbie

            Hello

            I have exactly the same problem.

            500 Internal Server Error

            java.lang.IllegalArgumentException: Parameter username does not exist as a named parameter in [from aut.bus.Usuario u where u.username = :username]
            at org.hibernate.impl.AbstractQueryImpl.setParameter(AbstractQueryImpl.java:356)
            at org.hibernate.impl.AbstractQueryImpl.setString(AbstractQueryImpl.java:643)
            at aut.dao.impl.hibernate.UsuarioDaoImpl.getByUserName(UsuarioDaoImpl.java:39)
            at aut.service.impl.UserDetailsServiceImpl.loadUserByUsername(UserDetailsServiceImpl.java:56)
            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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:172)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139)
            at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
            at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:203)
            at $Proxy99.loadUserByUsername(Unknown Source)
            at org.acegisecurity.providers.dao.DaoAuthenticationProvider.retrieveUser(DaoAuthenticationProvider.java:87)
            at org.acegisecurity.providers.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:115)
            at org.acegisecurity.providers.ProviderManager.doAuthentication(ProviderManager.java:188)
            at org.acegisecurity.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:45)
            at org.acegisecurity.ui.webapp.AuthenticationProcessingFilter.attemptAuthentication(AuthenticationProcessingFilter.java:71)
            at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:199)
            at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
            at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:106)
            at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
            at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
            at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
            at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
            at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
            at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:619)
            at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
            at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
            at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
            at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
            at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
            at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
            at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
            at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
            at java.lang.Thread.run(Thread.java:595)


            I tried to include the libraries jbpm-identity.jar and jbpm-jpdl.jar

            but it doesnt work

            Thank you for your interest

            • 3. Re: Parameter userName does not exist as a named parameter
              Ronald van Kuijk Master

              Then you did not include them in the correct place. The latter should btw already be there otherwise there is no jbpm at all....

              • 4. Re: Parameter userName does not exist as a named parameter
                Alfonso Fernandez Newbie

                Hello

                I have a war file

                Inside I have a directory WEB-INF/lib

                I have my jar files inside this directory.

                My english is not quite well

                What does it mean

                The latter should btw already be there otherwise there is no jbpm at all....

                Thank you

                • 5. Re: Parameter userName does not exist as a named parameter
                  Ronald van Kuijk Master

                  if there is no jbpm-jpdl.jar somewhere, you have no jbpm at all. So if you were able to run something before and after that you added jbpm-identity and jbpm-jpdl.jar to WEB-INF/lib, there must already have been a jbpm-jpdl.jar (or older version) somewhere which e.g. does not have access to the identity jar. Might just be a classloader scoping issue.

                  • 6. Re: Parameter userName does not exist as a named parameter
                    Alfonso Fernandez Newbie

                    Thank you Ronald

                    Yes, I think that is a classloader problem.

                    No need libraries jbpm-jpdl.jar
                    and jbpm-identity.jar

                    When I deploy the war in jboss 4.0.2 works fine

                    but when I deploy in Oracle OAS 10.1.3.X I get the error.