incubator-ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Speidel (JIRA)" <>
Subject [jira] [Created] (AMBARI-1129) Updating service configuration for a service via the api fails with a sql error
Date Thu, 03 Jan 2013 19:10:13 GMT
John Speidel created AMBARI-1129:

             Summary: Updating service configuration for a service via the api fails with
a sql error
                 Key: AMBARI-1129
             Project: Ambari
          Issue Type: Sub-task
          Components: controller
            Reporter: John Speidel
            Assignee: John Speidel

In ServiceConfigMappingDAO, the where clause of the sql query is built incorrectly. In the
below code snippet, the argument "?5" is used in the where clause and there are only three
arguments that get set. The 5 should be changed to a 3.

TypedQuery<ServiceConfigMappingEntity> query =
"SELECT config FROM ServiceConfigMappingEntity config"
+ " WHERE "
+ " config.clusterId = ?1"
+ " AND config.serviceName = ?2"
+ " AND config.configType IN ?5",
return daoUtils.selectList(query, clusterId, serviceName, configTypes);

As a result, the query fails because there is no arg 5.  This results in the below stack trace:

java.lang.IllegalArgumentException: You have attempted to set a parameter at position 3 which
does not exist in this query string SELECT config FROM ServiceConfigMappingEntity config WHERE
config.clusterId = ?1 AND config.serviceName = ?2 AND config.configType IN ?5.
at org.eclipse.persistence.internal.jpa.QueryImpl.setParameterInternal(
at org.eclipse.persistence.internal.jpa.QueryImpl.setParameterInternal(
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.setParameter(
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.setParameter(
at org.apache.ambari.server.orm.dao.DaoUtils.setParameters(
at org.apache.ambari.server.orm.dao.DaoUtils.selectList(
at org.apache.ambari.server.orm.dao.ServiceConfigMappingDAO.findByServiceAndType(
at org.apache.ambari.server.orm.dao.ClearEntityManagerInterceptor.invoke(
at org.apache.ambari.server.state.ServiceImpl.updateDesiredConfigs(
at org.apache.ambari.server.controller.AmbariManagementControllerImpl.updateServices(

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message