Author Topic: Exception when adding a batch of skills to CME  (Read 2247 times)

Offline gustavo.bonis

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Exception when adding a batch of skills to CME
« on: June 28, 2018, 06:36:23 PM »
Has anyone ever seen this exception?

[b]com.genesyslab.platform.applicationblocks.com.ConfigServerException: Validation error : [CFGUniquenessViolation] , Object [CfgAgent] , DBID [34529] , Property [Unknown attribute]  (ErrorType=CFGUniquenessViolation, ObjectType=CFGPerson, ObjectProperty=CFGNoProperty)[/b]

It happens when a skill batch is running (more than 50 skills per person and more than 30 people).

Full stack goes below.

2018-06-28 15:03:31,650 SEVERE [br.com.produban.beans.UploadSkillList] (default task-55) null: com.genesyslab.platform.applicationblocks.com.ConfigServerException: Validation error : [CFGUniquenessViolation] , Object [CfgAgent] , DBID [34529] , Property [Unknown attribute]  (ErrorType=CFGUniquenessViolation, ObjectType=CFGPerson, ObjectProperty=CFGNoProperty)
at com.genesyslab.platform.applicationblocks.com.runtime.GlobalConfService.createConfigServerException(GlobalConfService.java:716)
at com.genesyslab.platform.applicationblocks.com.runtime.GlobalConfService.updateObject(GlobalConfService.java:256)
at com.genesyslab.platform.applicationblocks.com.CfgObject.updateSavedObject(CfgObject.java:346)
at com.genesyslab.platform.applicationblocks.com.CfgObject.save(CfgObject.java:248)
at com.genesyslab.platform.applicationblocks.com.CfgObject.save(CfgObject.java:223)
at com.genesyslab.platform.applicationblocks.com.objects.CfgPerson.save(CfgPerson.java:240)
at br.com.produban.beans.UploadSkillList.flushToCME2(UploadSkillList.java:521)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at javax.el.ELUtil.invokeMethod(ELUtil.java:300)
at javax.el.BeanELResolver.invoke(BeanELResolver.java:415)
at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:256)
at com.sun.el.parser.AstValue.invoke(AstValue.java:285)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304)
at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)
at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)
at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:147)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:814)
at javax.faces.component.UICommand.broadcast(UICommand.java:300)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:658)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
at br.com.produban.filter.LoginFilter.doFilter(LoginFilter.java:51)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Best Regards,

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: Exception when adding a batch of skills to CME
« Reply #1 on: June 28, 2018, 09:21:51 PM »
And your batch? Seems there is an empty property being added

Enviado de meu E6633 usando o Tapatalk


Offline gustavo.bonis

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: Exception when adding a batch of skills to CME
« Reply #2 on: June 29, 2018, 11:37:09 AM »
Hi cavagnaro, thanks for the reply.

Please refer to the excerpt below to check If I'm doing something wrong. This is the body of implemented method responsible for adding skills to the person. It is called by another method in a loop. I see you pointed out the empty property although I cannot find where in the code I set this property.

        Endpoint confServerEndpoint = new Endpoint("default", server, port);

        ConfServerProtocol confServerProtocol = new ConfServerProtocol(confServerEndpoint);//SAC_SDG_R_Pj

        confServerProtocol.setUserName(username);
        confServerProtocol.setUserPassword(password);

        IConfService service = ConfServiceFactory.retrieveConfService(confServerEndpoint);
        if (service == null) {
            service = ConfServiceFactory.createConfService(confServerProtocol);
        }

        CfgPersonQuery personQuery = null;
        CfgPerson person = null;
        CfgSkillQuery skillQuery = null;

        try {
            System.out.println("Connecting...");
            confServerProtocol.open();
            if (confServerProtocol.getState() == ChannelState.Opened || confServerProtocol.getState() == ChannelState.Opening) {
                System.out.println("... connected");

                personQuery = new CfgPersonQuery(service);
                person = null;
                skillQuery = new CfgSkillQuery(service);

                personQuery.setUserName("gustavo");
                person = (CfgPerson) service.retrieveObject(CfgPerson.class, personQuery);

                System.out.print(person.getUserName());

                for (CfgSkillLevel sl : person.getAgentInfo().getSkillLevels()) {
                    System.out.println(" has skill: " + sl.getSkill().getName() + " - Level: " + sl.getLevel());
                }
                System.out.println();

                if (clearSkills) {
                    person.getAgentInfo().getSkillLevels().clear();
                    person.save();
                }

                skillQuery.setName("Republica");
                addSkillToPerson(service, skillQuery, person, 11);

                person.save();
                ConfServiceFactory.releaseConfService(service);

                System.out.println("Closing...");
                confServerProtocol.close();
                if (confServerProtocol.getState() == ChannelState.Closed || confServerProtocol.getState() == ChannelState.Closing) {
                    System.out.println("... closed");
                }
            }
        } catch (ConfigException ex) {
            Logger.getLogger(ConfServerConnectionTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (ProtocolException | IllegalStateException | InterruptedException ex) {
            Logger.getLogger(ConfServerConnectionTest.class.getName()).log(Level.SEVERE, null, ex);
        }

Offline gustavo.bonis

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: Exception when adding a batch of skills to CME
« Reply #3 on: June 29, 2018, 11:38:43 AM »
Method that actually add skills

public static void addSkillToPerson(IConfService service, CfgSkillQuery skillQuery, CfgPerson person, int nota) throws ConfigException {
        CfgSkill skill = (CfgSkill) service.retrieveObject(skillQuery);
        if (skill != null) {
            CfgSkillLevel skillLevel = new CfgSkillLevel(service, skill);
            skillLevel.setLevel(nota);
            skillLevel.setSkillDBID(skill.getDBID());

            person.getAgentInfo().getSkillLevels().add(skillLevel);
            person.save();
        } else {
            throw new ConfigException("Skill " + skillQuery.getName() + " not found! Person: " + person.getUserName());
        }
    }