Doctrine semantical error
I have a signal&slots implementation for failed login attempts. A repository adds a new Event model everytime this happens.
In Development context this works fine, in Production context it doesn't.
When extending the standard Flow repository, the error is:
Uncaught exception #1337934455 in line 79 of Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Persistence/Repository.php: Could not add object of type "My\App\Domain\Model\Log\Event"
When extending the doctrine repository, the following exception is thrown:
Uncaught exception in line 640 of Packages/Libraries/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php: [Semantical Error] The annotation "@\TYPO3\Flow\Annotations\Entity" in class My\App\Domain\Model\Log\Event does not exist, or could not be auto-loaded
When debugging the exception the Flow repository throws, it eventually throws the same exception as the doctrine one.
I've tested this on both the current Git master and the beta 3 tag.
Other events that use the same code do work and my model does ofcourse have the correct annotations and use statements.
Updated by Rens Admiraal about 8 years ago
- Category changed from Annotations to Core
- PHP Version deleted (
I've had a similar issue in a project and did some debugging. Turned out that I could make a new instance of the class right after initializeClassLoader() in the Flow bootstrap. Doctrine DocParser fails in loading the class though, and it seems like Doctrine in some way does not use the classloader from Flow. Needs some more investigation.
I removed the PHP version as I know of people having this issue on 5.3 too, target version is ok as this could even be a blocker for the release.
As a DIRTY workaround you can temporary do an include of the classes in your own Package.php or if you've a customized index.php already you can do it there. Keep in mind to remove those includes when the bug is fixed and only use it to keep your project running for now! It's a dirty fix, but better then running in development context ;-)