title: I cant find my PHP class in a TYPO3 extension with my template. Errorcode 1407060572
body: <p>I wrote an extension for a TYPO3 site (Version 10.4.15) and in there you have to access the database with a ViewHelper class. The path of the ViewHelper class is</p>
  <p><strong>websitename/public/typo3conf/ext/sitepackage/Classes/ViewHelpers/GetRecordViewHelper.php</strong></p>
  <pre><code>    &lt;?php
  
      namespace mwatschong\sitepackage\ViewHelpers;
  
  
      use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
      use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
      use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
  
      use TYPO3\CMS\Core\Utility\GeneralUtility;
      use TYPO3\CMS\Core\Database\ConnectionPool;
  
      class GetRecordViewHelper extends AbstractViewHelper
      {
        use CompileWithRenderStatic;
  
        public function initializeArguments()
        {
          $this-&gt;registerArgument('land', 'string','the land which is rendered', true);
        }
        public static function renderStatic(
           array $arguments,
           \Closure $renderChildrenClosure,
           RenderingContextInterface $renderingContext
        ) }
        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)-&gt;getQueryBuilderForTable('tx_patentsites_content');
        $resultSet = $connection-&gt;query('SELECT text FROM tx_patentsites_content WHERE land = $arguments['land']')-&gt;execute();
      return $resultSet
        }
      }
  </code></pre>
  <p>I integrate my class into my Template by</p>
  <pre><code>{namespace patent=mwatschong\sitepackage\ViewHelpers}
  </code></pre>
  <p>and invoke my ViewHelper as</p>
  <p><code>&lt;patent:getRecord land=&quot;Albanien&quot; /&gt;</code></p>
  <p>But I get the Errorcode 1407060572 which means the fluidparser can't find my class.</p>
  <p>I hope it is enough information for discussing the problem.</p>
  <p>EDIT:</p>
  <p>I add to my composer.json a autoload clause, changed nothing, but is per default in the composer.json of the example plugins from the typo3 docs, StoreInventory and the SJROffer Example.</p>
  <pre><code>        &quot;autoload&quot;: {
      &quot;psr-4&quot;: {
          &quot;mwatschong\\sitepackage\\&quot;: &quot;Classes/&quot;
      }
  </code></pre>
  <p>EDIT:</p>
  <p>I first try first to &quot;load classes with composermode&quot; from
  <a href="https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/Autoloading/Index.html#loading-classes-with-composer-mode" rel="nofollow noreferrer">the typo3doku</a> and no reference to my package classes are filed in the autoload_psr4.php. I try to add them manually to this file (<code>'mwatschong\\sitepackage\\' =&gt; array($baseDir . '/public/typo3conf/ext/sitepackage/Classes')</code>) but sadly no diffrences.</p>
  <p>EDIT:</p>
  <p>I do the whole Thing from Scratch with the <a href="https://www.sitepackagebuilder.com/" rel="nofollow noreferrer">sitepackagebuilder</a> and still have no luck. I have the check the Spelling based on the blog as suggested in the answers. Here is the new composer.json</p>
  <pre><code>{
      &quot;name&quot;: &quot;mvision/patentsites&quot;,
      &quot;type&quot;: &quot;typo3-cms-extension&quot;,
      &quot;description&quot;: &quot;Create Patentsites from Database&quot;,
      &quot;license&quot;: [&quot;GPL-2.0-or-later&quot;],
      &quot;keywords&quot;: [&quot;TYPO3 CMS&quot;],
      &quot;require&quot;: {
          &quot;typo3/cms-core&quot;: &quot;^10.4&quot;,
          &quot;typo3/cms-rte-ckeditor&quot;: &quot;^10.4&quot;,
          &quot;typo3/cms-fluid-styled-content&quot;: &quot;^10.4&quot;
      },
      &quot;autoload&quot;: {
          &quot;psr-4&quot;: {
              &quot;Mvision\\Patentsites\\&quot;: &quot;Classes/&quot;
          }
      }
  }
  </code></pre>
  <p>EDIT</p>
  <p>I do <code>composer dumpautoload </code> and check my autoload_psr4. There is no Reference to my package.</p>
  <p>EDIT</p>
  <p>I run <code>composer req mvision/patentsites -vvv </code> and it outputs that the minimum stability is not matched. But in my ext_emconf.php is the state set to stable and the extensionmanager showed it also.</p>
  <p>EDIT</p>
  <p>I work through this <a href="https://stackoverflow.com/a/53461434/15940722">ANSWER</a> in a other typo3/ composer thread an know i can load my classes without problems. I think the Problem was a false composer/repo configuration.</p>
  <p>Thanks for all the help!</p>