Required class "Swift_Mailer" could not be loaded properly for reflection

Hi,

I’m trying to copy my application to the production server. Everything is copied and I’m trying to flush the cache. However, the following error comes:

Exception: Required class “Swift_Mailer” could not be loaded properly for reflection.

Possible reasons are:

  • Requiring non-existent classes
  • Using non-supported annotations
  • Class-/filename missmatch.

The “Neos.Flow.object.excludeClasses” setting can be used to skip classes from being reflected.

30 Neos\Flow\Reflection\ClassReflection::Neos\Flow\Reflection{closure}(“Swift_Mailer”)
29 spl_autoload_call(“Swift_Mailer”)
28 include_once("/var/www/space1/web32/xxx/Packages/Application/Neos.SwiftMailer/Classes/Mailer.php")
27 Neos\Flow\Core\ClassLoader::loadClassFromPossiblePaths(array|1|, array|3|, 2)
26 Neos\Flow\Core\ClassLoader::loadClass(“Neos\SwiftMailer\Mailer”)
25 spl_autoload_call(“Neos\SwiftMailer\Mailer”)
24 ReflectionClass::__construct(“Neos\SwiftMailer\Mailer”)
23 Neos\Flow\Reflection\ClassReflection::__construct(“Neos\SwiftMailer\Mailer”)
22 Neos\Flow\Reflection\ReflectionService::reflectClass(“Neos\SwiftMailer\Mailer”)
21 Neos\Flow\Reflection\ReflectionService::Neos\Flow\Reflection{closure}(“Neos\SwiftMailer\Mailer”)
20 array_filter(array|1230|, Closure)
19 Neos\Flow\Reflection\ReflectionService::reflectEmergedClasses()
18 Neos\Flow\Reflection\ReflectionService::buildReflectionData(array|11|)
17 Neos\Flow\ObjectManagement\CompileTimeObjectManager::initialize(array|123|)
16 Neos\Flow\Core\Booting\Scripts::initializeObjectManagerCompileTimeFinalize(Neos\Flow\Core\Bootstrap)
15 call_user_func(array|2|, Neos\Flow\Core\Bootstrap)
14 Neos\Flow\Core\Booting\Step::__invoke(Neos\Flow\Core\Bootstrap)
13 Neos\Flow\Core\Booting\Sequence::invokeStep(Neos\Flow\Core\Booting\Step, Neos\Flow\Core\Bootstrap)
12 Neos\Flow\Core\Booting\Sequence::invokeStep(Neos\Flow\Core\Booting\Step, Neos\Flow\Core\Bootstrap)
11 Neos\Flow\Core\Booting\Sequence::invokeStep(Neos\Flow\Core\Booting\Step, Neos\Flow\Core\Bootstrap)
10 Neos\Flow\Core\Booting\Sequence::invokeStep(Neos\Flow\Core\Booting\Step, Neos\Flow\Core\Bootstrap)
9 Neos\Flow\Core\Booting\Sequence::invokeStep(Neos\Flow\Core\Booting\Step, Neos\Flow\Core\Bootstrap)
8 Neos\Flow\Core\Booting\Sequence::invokeStep(Neos\Flow\Core\Booting\Step, Neos\Flow\Core\Bootstrap)
7 Neos\Flow\Core\Booting\Sequence::invokeStep(Neos\Flow\Core\Booting\Step, Neos\Flow\Core\Bootstrap)
6 Neos\Flow\Core\Booting\Sequence::invokeStep(Neos\Flow\Core\Booting\Step, Neos\Flow\Core\Bootstrap)
5 Neos\Flow\Core\Booting\Sequence::invoke(Neos\Flow\Core\Bootstrap)
4 Neos\Flow\Cli\CommandRequestHandler::boot(“Compiletime”)
3 Neos\Flow\Cli\CommandRequestHandler::handleRequest()
2 Neos\Flow\Core\Bootstrap::run()
1 require("/var/www/space1/web32/xxx/Packages/Framework/Neos.Flow/Scripts/flow.php")

I already found a similar issue: Required class could not be loaded properly for reflection. - when migrating to production server
But it did not get me any further at this point.

I understand, that the Mailer.php requires the Swift_Mailer Class. I double checked, on the production environment, the Swift_Mailer class is in the right folder.

To be sure, I also compared my settings between development and production.

Does anyone else have any idea what the difference between my (error-free) test and production environment might be that leads to this error?

Many thanks for your support!