问题
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:
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:
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
.
来源:https://stackoverflow.com/questions/59376814/controller-does-not-exist-reflection-failed-typo3