# Controller not found Exception

**URL:** <https://forum.shopware.com/t/controller-not-found-exception/37559>\
**Category:** Programmierung\
**Created:** [19. Juni 2016 um 12:18 UTC](https://forum.shopware.com/t/controller-not-found-exception/37559 "2016-06-19T12:18:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![uweheldt](https://avatars.discourse-cdn.com/v4/letter/u/ea5d25/32.png) [@uweheldt](https://forum.shopware.com/u/uweheldt)\
**Post date:** [19. Juni 2016 um 12:18 UTC](https://forum.shopware.com/t/controller-not-found-exception/37559/1 "2016-06-19T12:18:43Z")

</div>

Moin,

ich habe mein Backend Plugin nun soweit, dass ich eine Fehlermeldung bekomme. Angeblich wird der Backend-Controller nicht gefunden, obwohl Name usw. alles stimmig sind. Woran kann das liegen, was kann ich machen?

Danke im Voraus!

&nbsp;

Hier nun die Fehlermeldung

```
'Enlight_Controller_Exception' with message 'Controller "ComviAcMoney" not found' in /Applications/XAMPP/xamppfiles/htdocs/install_5/engine/Library/Enlight/Controller/Dispatcher/Default.php:486 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/install_5/engine/Library/Enlight/Controller/Front.php(226): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp)) #1 /Applications/XAMPP/xamppfiles/htdocs/install_5/engine/Shopware/Kernel.php(153): Enlight_Controller_Front->dispatch() #2 /Applications/XAMPP/xamppfiles/htdocs/install_5/vendor/symfony/http-kernel/HttpCache/HttpCache.php(492): Shopware\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #3 /Applications/XAMPP/xamppfiles/htdocs/install_5/engine/Shopware/Components/HttpCache/AppCache.php(255): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL) #4 /Applications/XAMPP/xamppfiles/htdocs/install_5/vendor/symfony/http-kernel/HttpCache/HttpCache.php(263): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true) #5 /Applications/XAMPP/xamppfiles/htdocs/install_5/engine/Shopware/Components/HttpCache/AppCache.php(103): Symfony\Component\HttpKernel\HttpCache\HttpCache->pass(Object(Symfony\Component\HttpFoundation\Request), true) #6 /Applications/XAMPP/xamppfiles/htdocs/install_5/shopware.php(101): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request)) #7 {main}

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![DanielNogel](https://avatars.discourse-cdn.com/v4/letter/d/96bed5/32.png) [@DanielNogel](https://forum.shopware.com/u/DanielNogel)\
**Post date:** [19. Juni 2016 um 13:28 UTC](https://forum.shopware.com/t/controller-not-found-exception/37559/2 "2016-06-19T13:28:54Z")

</div>

Hi,

wie und wo registrierst du den Controller den? Ggf. musst du das Plugin nach dem Hinzufügen des registerController / subscribeEvent neu installieren.

Daniel

---

<div class="post-metadata">

**Author:** ![uweheldt](https://avatars.discourse-cdn.com/v4/letter/u/ea5d25/32.png) [@uweheldt](https://forum.shopware.com/u/uweheldt)\
**Post date:** [19. Juni 2016 um 13:38 UTC](https://forum.shopware.com/t/controller-not-found-exception/37559/3 "2016-06-19T13:38:31Z")

</div>

Hier mal ein Teil der Bootstrap.php - da muss das doch passieren oder?

Kannst Du da irgendwas erkennnen?

&nbsp;

```
";
			echo $msg;
			print_r($data);
			echo "

```

"; echo "

* * *

“; } } /\*\* \* Standard Shopware Plugin Class \*/ class Shopware\_Plugins\_Frontend\_ComviAcMoney\_Bootstrap extends Shopware\_Components\_Plugin\_Bootstrap { /\*\* \* register plugin namespaces \*/ public function registerNamespace() { static $done = false; if(!$done) { $done = true; Shopware()-\>Loader()-\>registerNamespace(‘Shopware’, dirname(\_\_FILE\_\_) . ‘/’); } } /\*\* \* Returns the meta information about the plugin. \* @return array \*/ public function getCapabilities() { return array( ‘install’ =\> true, ‘enable’ =\> true, ‘update’ =\> true ); } /\*\* \* Plugin install method \*/ public function install() { $this-\>checkLicense(); if(!$this-\>assertVersionGreaterThen(“4.3.0”)) throw new Enlight\_Exception(“This Plugin needs min shopware 4.3.0”); $this-\>createMenu(); $this-\>createSnippets(); $this-\>createForm(); $this-\>subscribeEvents(); $this-\>createTables(); return array(‘success’ =\> true, ‘invalidateCache’ =\> array(‘config’, ‘frontend’, ‘backend’, ‘proxy’)); } /\*\* \* Plugin update method \*/ public function update($oldVersion) { switch($oldVersion) { default: return false; } return true; } /\*\* \* Plugin uninstall method \*/ public function uninstall() { $this-\>registerCustomModels(); $em = $this-\>Application()-\>Models(); $tool = new \Doctrine\ORM\Tools\SchemaTool($em); $classes = array($em-\>getClassMetadata(‘Shopware\CustomModels\ComviAcMoney\ComviAcMoneyConfig’)); $tool-\>dropSchema($classes); Shopware()-\>Db()-\>exec(‘DELETE FROM s\_core\_snippets WHERE namespace=“engine/Shopware/Plugins/Local/Frontend/ComviAcMoney/Views/frontend/plugins/comvi\_ac\_money/default/steps”’); Shopware()-\>Db()-\>exec(‘DELETE FROM s\_core\_snippets WHERE namespace=“engine/Shopware/Plugins/Local/Frontend/ComviAcMoney/Views/frontend/plugins/comvi\_ac\_money/responsive/steps”’); Shopware()-\>Db()-\>exec(‘DELETE FROM s\_core\_snippets WHERE namespace=“engine/Shopware/Plugins/Community/Frontend/ComviAcMoney/Views/frontend/plugins/comvi\_ac\_money/default/steps”’); Shopware()-\>Db()-\>exec(‘DELETE FROM s\_core\_snippets WHERE namespace=“engine/Shopware/Plugins/Community/Frontend/ComviAcMoney/Views/frontend/plugins/comvi\_ac\_money/responsive/steps”’); //TODO Artikel anlegen/löschen klappt im Installationsprozess nicht - PART B //$this-\>removeAmiciCardArticle(); return array(‘success’ =\> true, ‘invalidateCache’ =\> array(‘config’, ‘frontend’, ‘backend’, ‘proxy’)); } /\*\* \* activates the plugin \*/ public function enable() { $this-\>checkLicense(); Shopware()-\>Db()-\>exec(‘UPDATE s\_core\_menu SET active=1 WHERE name = “ACmoney”’); return true; } /\*\* \* deactivates the plugin \*/ public function disable() { Shopware()-\>Db()-\>exec(‘UPDATE s\_core\_menu SET active=0 WHERE name = “ACmoney”’); return true; } public function getLabel() { return ‘ACmoney’; } public function getVersion() { return ‘4.01.01’; } public function getInfo() { return array ( ‘version’ =\> $this-\>getVersion(), ‘autor’ =\> ‘Uwe Heldt’, ‘copyright’ =\> ‘Uwe Heldt’, ‘label’ =\> $this-\>getLabel(), ‘support’ =\> ‘[http://www.uweheldt.de](http://www.uweheldt.de)’, ‘link’ =\> ‘[http://www.uweheldt.de](http://www.uweheldt.de)’ ); } /\*\* \* create menu entries for this plugin \*/ protected function createMenu() { $parent = $this-\>createMenuItem(array ( ‘label’ =\> ‘ACmoney’, ‘controller’ =\> ‘ComviAcMoney’, ‘class’ =\> ‘sprite-credit-cards’, ‘action’ =\> ‘index’, ‘active’ =\> 1, ‘parent’ =\> $this-\>Menu()-\>findOneBy(‘label’, ‘Marketing’) )); } /\*\* \* create snippets for the frontend \*/ protected function createSnippets() { $result = Shopware()-\>Db()-\>fetchAll(” SELECT DISTINCT s.shopID as id, l.locale FROM s\_core\_snippets s, s\_core\_locales l WHERE l.id = s.localeID “); foreach($result as $ShopLocale) { $localeID = Shopware()-\>Db()-\>fetchOne('SELECT id FROM s\_core\_locales WHERE locale=”’.$ShopLocale[‘locale’].’"’); $sqlA = ‘INSERT INTO s\_core\_snippets (namespace, name, localeID, shopID, value, created, updated) VALUES (“engine/Shopware/Plugins/Local/Frontend/ComviAcMoney/Views/frontend/plugins/comvi\_ac\_money/default/steps”, ?, "’.$localeID.’", “’.$ShopLocale[‘id’].’”, ?, NOW(), NOW())’; $sqlAA = ‘INSERT INTO s\_core\_snippets (namespace, name, localeID, shopID, value, created, updated) VALUES (“engine/Shopware/Plugins/Community/Frontend/ComviAcMoney/Views/frontend/plugins/comvi\_ac\_money/default/steps”, ?, "’.$localeID.’", “’.$ShopLocale[‘id’].’”, ?, NOW(), NOW())’; $sqlB = ‘INSERT INTO s\_core\_snippets (namespace, name, localeID, shopID, value, created, updated) VALUES (“engine/Shopware/Plugins/Local/Frontend/ComviAcMoney/Views/frontend/plugins/comvi\_ac\_money/responsive/steps”, ?, "’.$localeID.’", “’.$ShopLocale[‘id’].’”, ?, NOW(), NOW())’; $sqlBB = ‘INSERT INTO s\_core\_snippets (namespace, name, localeID, shopID, value, created, updated) VALUES (“engine/Shopware/Plugins/Community/Frontend/ComviAcMoney/Views/frontend/plugins/comvi\_ac\_money/responsive/steps”, ?, "’.$localeID.’", “’.$ShopLocale[‘id’].’”, ?, NOW(), NOW())’; Shopware()-\>Db()-\>query($sqlA, array(‘CheckoutStepAmiciCardText’, ‘ac-money’)); Shopware()-\>Db()-\>query($sqlA, array(‘CheckoutStepAmiciCardNumber’, ‘3’)); Shopware()-\>Db()-\>query($sqlA, array(‘CheckoutStepConfirmNumber’, ‘4’)); Shopware()-\>Db()-\>query($sqlAA, array(‘CheckoutStepAmiciCardText’, ‘ac-money’)); Shopware()-\>Db()-\>query($sqlAA, array(‘CheckoutStepAmiciCardNumber’, ‘3’)); Shopware()-\>Db()-\>query($sqlAA, array(‘CheckoutStepConfirmNumber’, ‘4’)); Shopware()-\>Db()-\>query($sqlB, array(‘CheckoutStepAmiciCardText’, ‘ac-money’)); Shopware()-\>Db()-\>query($sqlB, array(‘CheckoutStepAmiciCardNumber’, ‘3’)); Shopware()-\>Db()-\>query($sqlB, array(‘CheckoutStepConfirmNumber’, ‘4’)); Shopware()-\>Db()-\>query($sqlBB, array(‘CheckoutStepAmiciCardText’, ‘ac-money’)); Shopware()-\>Db()-\>query($sqlBB, array(‘CheckoutStepAmiciCardNumber’, ‘3’)); Shopware()-\>Db()-\>query($sqlBB, array(‘CheckoutStepConfirmNumber’, ‘4’)); } } protected function createForm() { $form = $this-\>Form(); $form-\>setElement(‘boolean’, ‘pluginstatus’, array(‘label’ =\> ‘Plugin für diesen Shop aktivieren?’, ‘required’ =\> true, ‘value’ =\> false, ‘scope’=\> Shopware\_Components\_Form::SCOPE\_SHOP)); $form-\>setElement(‘text’, ‘amicicard\_ordernumber’, array(‘label’ =\> ‘Artikelnummer für die ACmoney’, ‘required’ =\> true, ‘value’ =\> ‘acmoney’, ‘scope’=\> Shopware\_Components\_Form::SCOPE\_SHOP)); $form-\>save(); } protected function subscribeEvents() { // Events für Backend- und Frontend-Controller $this-\>subscribeEvent(‘Enlight\_Controller\_Dispatcher\_ControllerPath\_Backend\_ComviAcMoney’, ‘onGetControllerPathBackend’); //$this-\>subscribeEvent(‘Enlight\_Controller\_Dispatcher\_ControllerPath\_Frontend\_ComviAcMoney’, ‘onGetControllerPathFrontend’); // Events für die zusätzliche Checkout-Seite $this-\>subscribeEvent(‘Enlight\_Controller\_Action\_PreDispatch\_Frontend\_Checkout’, ‘onPreDispatchFrontendCheckout’); $this-\>subscribeEvent(‘Enlight\_Controller\_Action\_PreDispatch\_Frontend’, ‘onPreDispatchFrontend’); $this-\>subscribeEvent(‘Shopware\_Controllers\_Frontend\_Checkout::finishAction::after’, ‘after\_finishAction’); $this-\>subscribeEvent(‘Shopware\_Modules\_Basket\_sGetBasket\_AllowEmptyBasket’, ‘allow\_emptyBasket’); $this-\>subscribeEvent(‘Shopware\_Controllers\_Frontend\_Checkout::getBasket::after’, ‘after\_getBasket’); } public function onGetControllerPathBackend(Enlight\_Event\_EventArgs $args) { if(!Shopware()-\>Plugins()-\>Frontend()-\>ComviAcMoney()-\>Config()-\>pluginstatus) return; $this-\>checkLicense(); //$this-\>registerNamespace(); $this-\>registerCustomModels(); $this-\>Application()-\>Template()-\>addTemplateDir($this-\>Path() . ‘Views/’); Shopware()-\>Log()-\>log(‘Hallo Uwe’ ,Zend\_Log::INFO); return $this-\>Path() . ‘/Controllers/Backend/ComviAcMoney.php’; } public function onGetControllerPathFrontend(Enlight\_Event\_EventArgs $args) { if(!Shopware()-\>Plugins()-\>Frontend()-\>ComviAcMoney()-\>Config()-\>pluginstatus) return; $this-\>checkLicense(); //$this-\>registerNamespace(); $this-\>registerCustomModels(); $this-\>Application()-\>Template()-\>addTemplateDir($this-\>Path() . ‘Views/’); return $this-\>Path() . ‘/Controllers/Frontend/ComviAcMoney.php’; }

&nbsp;

---

<div class="post-metadata">

**Author:** ![uweheldt](https://avatars.discourse-cdn.com/v4/letter/u/ea5d25/32.png) [@uweheldt](https://forum.shopware.com/u/uweheldt)\
**Post date:** [19. Juni 2016 um 13:49 UTC](https://forum.shopware.com/t/controller-not-found-exception/37559/4 "2016-06-19T13:49:09Z")

</div>

Ich hab’s. Da fehlte noch eine Kleinigkeit. Danke!!

---

<div class="post-metadata">

**Author:** ![Dwza](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@Dwza](https://forum.shopware.com/u/Dwza)\
**Post date:** [4. Oktober 2017 um 08:19 UTC](https://forum.shopware.com/t/controller-not-found-exception/37559/5 "2017-10-04T08:19:15Z")

</div>

> [@uweheldt schrieb:](https://forum.shopware.com/profile/23649/uweheldt "uweheldt")
> 
> Ich hab’s. Da fehlte noch eine Kleinigkeit. Danke!!

Und was soll jemand mit der gleichen Problematik mit dieser Aussage anfangen?&nbsp;
