What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

@U025NCYDECF ```Zed.CRITICAL: Spryker\Zed\DataImport\Business\Exception\DataSetBrokerTransactionFa

U02KNGVH7BP
U02KNGVH7BP Posts: 15 πŸ§‘πŸ»β€πŸš€ - Cadet

@florian.scholz

Zed.CRITICAL: Spryker\Zed\DataImport\Business\Exception\DataSetBrokerTransactionFailedException - Class 'Pyz\Zed\Antelope\Dependency\AntelopeEvents' not found in "/data/vendor/spryker/data-import/src/Spryker/Zed/DataImport/Business/Model/DataSet/DataSetStepBrokerTransactionAware.php::59" {"exception":"[object] (Spryker\\Zed\\DataImport\\Business\\Exception\\DataSetBrokerTransactionFailedException(code: 0): Class 'Pyz\\Zed\\Antelope\\Dependency\\AntelopeEvents' not found at /data/vendor/spryker/data-import/src/Spryker/Zed/DataImport/Business/Model/DataSet/DataSetStepBrokerTransactionAware.php:59)

Comments

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,051 βš–οΈ - Guardians (admin)

    can you double check the file Pyz\Zed\Antelope\Dependency\AntelopeEvents.php ?

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,051 βš–οΈ - Guardians (admin)

    can you maybe paste the path + filename here?

  • U02KNGVH7BP
    U02KNGVH7BP Posts: 15 πŸ§‘πŸ»β€πŸš€ - Cadet

    src/Pyz/Zed/Antelope/Dependency/AntelopeEvents.php

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,051 βš–οΈ - Guardians (admin)

    and in there you have

    namespace Pyz\Zed\Antelope\Dependency;
    
    interface AntelopeEvents
    

    right?

    if yes, can you please double check the content of src/Pyz/Zed/DataImport/Business/Model/Antelope/AntelopeWriterStep.php ?

  • U02KNGVH7BP
    U02KNGVH7BP Posts: 15 πŸ§‘πŸ»β€πŸš€ - Cadet

    for AntelopeEvents.php - yes

    double checked AntelopeWriterStep.php

  • U02KNGVH7BP
    U02KNGVH7BP Posts: 15 πŸ§‘πŸ»β€πŸš€ - Cadet
    <?php
    
    namespace Pyz\Zed\DataImport\Business\Model\Antelope;
    
    use Orm\Zed\Antelope\Persistence\PyzAntelopeQuery;
    use Spryker\Zed\DataImport\Business\Model\DataImportStep\DataImportStepInterface;
    use Spryker\Zed\DataImport\Business\Model\DataSet\DataSetInterface;
    use Pyz\Zed\Antelope\Dependency\AntelopeEvents;
    use Spryker\Zed\DataImport\Business\Model\DataImportStep\PublishAwareStep;
    
    class AntelopeWriterStep extends PublishAwareStep implements DataImportStepInterface
    {
        public const KEY_NAME = 'name';
        public const KEY_COLOR = 'color';
    
        /**
         * @param \Spryker\Zed\DataImport\Business\Model\DataSet\DataSetInterface $dataSet
         *
         * @throws \Spryker\Zed\DataImport\Business\Exception\EntityNotFoundException
         *
         * @return void
         */
        public function execute(DataSetInterface $dataSet)
        {
            $antelopeEntity = PyzAntelopeQuery::create()
                ->filterByName($dataSet[static::KEY_NAME])
                ->findOneOrCreate();
    
            $antelopeEntity->setColor($dataSet[static::KEY_COLOR]);
    
            if ($antelopeEntity->isNew() || $antelopeEntity->isModified()) {
                $antelopeEntity->save();
            }
    
            $this->addPublishEvents(AntelopeEvents::ENTITY_PYZ_ANTELOPE_CREATE, $antelopeEntity->getIdAntelope());
        }
    }
    
  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,051 βš–οΈ - Guardians (admin)

    the exception happens on executing the data:import:antelope?

  • U02KNGVH7BP
    U02KNGVH7BP Posts: 15 πŸ§‘πŸ»β€πŸš€ - Cadet

    y

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,051 βš–οΈ - Guardians (admin)

    if you remove the line

    $this->addPublishEvents(AntelopeEvents::ENTITY_PYZ_ANTELOPE_CREATE, $antelopeEntity->getIdAntelope());
    

    β€’ is it still throwing the exception?

  • U02KNGVH7BP
    U02KNGVH7BP Posts: 15 πŸ§‘πŸ»β€πŸš€ - Cadet

    no

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,051 βš–οΈ - Guardians (admin)

    Can you paste the content of your AntelopeEvents.php pls?

  • U02KNGVH7BP
    U02KNGVH7BP Posts: 15 πŸ§‘πŸ»β€πŸš€ - Cadet

    hold on

  • U02KNGVH7BP
    U02KNGVH7BP Posts: 15 πŸ§‘πŸ»β€πŸš€ - Cadet

    guess I found the issue

  • U02KNGVH7BP
    U02KNGVH7BP Posts: 15 πŸ§‘πŸ»β€πŸš€ - Cadet

    damn.. it’s working

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,051 βš–οΈ - Guardians (admin)

    what was the problem?

  • U02KNGVH7BP
    U02KNGVH7BP Posts: 15 πŸ§‘πŸ»β€πŸš€ - Cadet

    AntelopeEvents.php had a space after the .php …

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,051 βš–οΈ - Guardians (admin)

    πŸ˜• Would be cool if the IDE would show this better πŸ™ˆ but glad we could solve this

  • U02KNGVH7BP
    U02KNGVH7BP Posts: 15 πŸ§‘πŸ»β€πŸš€ - Cadet

    i found out by trying to look up the file on the console

  • michael.schmetter
    michael.schmetter Posts: 119 πŸ§‘πŸ»β€πŸš€ - Cadet

    @U02KNGVH7BP
    That also took me 2 hours of my lifetime.
    pyz_antelope_search.schema.xml had a trailing space in my PhpStorm, so no table was generated.
    @florian.scholz Maybe somehow you can notfiy your students next time to be extra careful, when copying class/filenames πŸ˜„

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,051 βš–οΈ - Guardians (admin)

    Yes, I agree with you. Maybe we can also upvote this here: https://youtrack.jetbrains.com/issue/IDEA-256426