“Controller does not exist. Reflection failed.” TY

2020-08-04 09:58发布

I am working on my own extension in TYPO3 (v 9.5.12) and when I click on my extension via Admin Tools, an error message pops up:

Error Message

The log reads following error message:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1278450972: 
Class Secsign\Secsign\Controller\SecsignController does not exist. 
Reflection failed.
| TYPO3\CMS\Extbase\Reflection\Exception\UnknownClassException thrown in file 
C:\xampp\htdocs\Typo9\public\typo3\sysext\extbase\Classes\Reflection\ReflectionService.php 
in line 363. Requested URL: 
http://localhost/Typo9/public/typo3/index.php?route=%%2Ftools%%2FSecsignSecsignbe%%2F&token=--AnonymizedToken--

My composer.json file looks like this.

{
    "name": "secsign/secsign",
    "type": "typo3-cms-extension",
    "description": "This extension allows users to authenticate using their smart phone running the SecSign App.",
    "authors": [
        {
            "name": "SecSign Technologies Inc.",
            "role": "Developer"
        }
    ],
    "require": {
        "typo3/cms-core": "^9.5"
    },
    "autoload": {
        "psr-4": {
            "Secsign\\Secsign\\": "Classes/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Secsign\\Secsign\\Tests\\": "Tests/"
        }
    }
}

I do not understand the problem here. How can I get this to work?

1条回答
啃猪蹄的小仙女
2楼-- · 2020-08-04 10:29

If you're working on the extension you probably didn't install it through composer. That means the extension's composer.json isn't loaded. You'll have to add the autoload information to your root composer.json (the one in C:\xampp\htdocs\Typo9) until your extension is done and installed through composer.

    "autoload": {
        "psr-4": {
            "Secsign\\Secsign\\": "public/typo3conf/ext/secsign/Classes/"
        }
    },

Check if the path I used in this example is correct in your case. Then you'll need to run composer dumpautoload.

查看更多
登录 后发表回答