Take a look here:
Magento\Framework\ObjectManager\ObjectManager->get() at /opt/bitnami/apps/magento/htdocs/app/code/J2t/Rewardpoints/Observer/ProcessSaveModel.php:21
Looks like this module is trying to grab the Object Manager which might be triggering the error if that area code is not set. In my comment, i linked to a solution i found to this error for an extension i was using. Might help you out here as the call to the Object Manager is happening in an Observer.
Here is that link again: Magento 2 "Area code not set" warning in 3rd party module
That's an interesting issue and I'm not entirely sure why is this happening.
What I can suggest is debugging directly in the _findMissingClasses
method from Magento/Setup/Module/Di/Code/Scanner/PhpScanner
that's where the error is coming from:
protected function _findMissingClasses($file, $classReflection, $methodName, $entityType)
{
$missingClasses = [];
if ($classReflection->hasMethod($methodName)) {
$constructor = $classReflection->getMethod($methodName);
$parameters = $constructor->getParameters();
/** @var $parameter \ReflectionParameter */
foreach ($parameters as $parameter) {
preg_match('/\[\s\<\w+?>\s([\w\\\\]+)/s', $parameter->__toString(), $matches);
if (isset($matches[1]) && substr($matches[1], -strlen($entityType)) == $entityType) {
$missingClassName = $matches[1];
try {
if (class_exists($missingClassName)) {
continue;
}
} catch (\RuntimeException $e) {
}
$sourceClassName = $this->getSourceClassName($missingClassName, $entityType);
if (!class_exists($sourceClassName) && !interface_exists($sourceClassName)) {
$this->_log->add(
Log::CONFIGURATION_ERROR,
$missingClassName,
"Invalid {$entityType} for nonexistent class {$sourceClassName} in file {$file}"
);
continue;
}
$missingClasses[] = $missingClassName;
}
}
}
return $missingClasses;
}
That method is called from the _fetchFactories
method which also logs the same error so you need to find out, where the error is coming from exactly and from there you should be able to start debugging:
protected function _fetchFactories($reflectionClass, $file)
{
$factorySuffix = '\\'.ucfirst(FactoryGenerator::ENTITY_TYPE);
$absentFactories = $this->_findMissingClasses(
$file,
$reflectionClass,
'__construct',
ucfirst(FactoryGenerator::ENTITY_TYPE)
);
foreach ($absentFactories as $key => $absentFactory) {
if (substr($absentFactory, -strlen($factorySuffix)) == $factorySuffix) {
$entityName = rtrim(substr($absentFactory, 0, -strlen($factorySuffix)), '\\');
$this->_log->add(
Log::CONFIGURATION_ERROR,
$absentFactory,
'Invalid Factory declaration for class ' . $entityName . ' in file ' . $file
);
unset($absentFactories[$key]);
}
}
return $absentFactories;
}
Best Answer
I believe that you try to run the test on this installation. And test copy test modules in app/code folder and do not remove it.
Please delete app/code/Magento/Test* modules manually and re run compilation