Hello,
I hope this is the right group to ask this question.
On line 33:
$documentManager->persist($doc);
I get the following stacktrace:
Fatal error: Uncaught exception 'Doctrine\ODM\PHPCR\Mapping\MappingException' with message 'No identifier/path specified for Document "Demo\MyDocument". Every Document must have an identifier/path.' in C:\Development\XYZCorp\temp\phpcr\vendor\doctrine\phpcr-odm\lib\Doctrine\ODM\PHPCR\Mapping\MappingException.php on line 135
Doctrine\ODM\PHPCR\Mapping\MappingException: No identifier/path specified for Document "Demo\MyDocument". Every Document must have an identifier/path. in C:\Development\XYZCorp\temp\phpcr\vendor\doctrine\phpcr-odm\lib\Doctrine\ODM\PHPCR\Mapping\MappingException.php on line 135
Call Stack:
0.1266 336160 1. {main}() C:\Development\XYZCorp\temp\phpcr\src\create_content.php:0
5.1318 6573432 2. Doctrine\ODM\PHPCR\DocumentManager->persist(???) C:\Development\XYZCorp\temp\phpcr\src\create_content.php:33
5.1318 6573432 3. Doctrine\ODM\PHPCR\UnitOfWork->scheduleInsert(???) C:\Development\XYZCorp\temp\phpcr\vendor\doctrine\phpcr-odm\lib\Doctrine\ODM\PHPCR\DocumentManager.php:592
5.1318 6573552 4. Doctrine\ODM\PHPCR\UnitOfWork->doScheduleInsert(???, ???, ???) C:\Development\XYZCorp\temp\phpcr\vendor\doctrine\phpcr-odm\lib\Doctrine\ODM\PHPCR\UnitOfWork.php:577
5.1319 6573832 5. Doctrine\ODM\PHPCR\DocumentManager->getClassMetadata(???) C:\Development\XYZCorp\temp\phpcr\vendor\doctrine\phpcr-odm\lib\Doctrine\ODM\PHPCR\UnitOfWork.php:589
5.1319 6573832 6. Doctrine\ODM\PHPCR\Mapping\ClassMetadataFactory->getMetadataFor(???) C:\Development\XYZCorp\temp\phpcr\vendor\doctrine\phpcr-odm\lib\Doctrine\ODM\PHPCR\DocumentManager.php:272
5.1319 6573832 7. Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->getMetadataFor(???) C:\Development\XYZCorp\temp\phpcr\vendor\doctrine\phpcr-odm\lib\Doctrine\ODM\PHPCR\Mapping\ClassMetadataFactory.php:87
5.1635 6595848 8. Doctrine\ODM\PHPCR\Mapping\ClassMetadataFactory->loadMetadata(???) C:\Development\XYZCorp\temp\phpcr\vendor\doctrine\common\lib\Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory.php:212
5.1635 6595848 9. Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->loadMetadata(???) C:\Development\XYZCorp\temp\phpcr\vendor\doctrine\phpcr-odm\lib\Doctrine\ODM\PHPCR\Mapping\ClassMetadataFactory.php:102
5.2452 6952768 10. Doctrine\ODM\PHPCR\Mapping\ClassMetadataFactory->doLoadMetadata(???, ???, ???, ???) C:\Development\XYZCorp\temp\phpcr\vendor\doctrine\common\lib\Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory.php:302
5.2560 6955920 11. Doctrine\ODM\PHPCR\Mapping\ClassMetadataFactory->validateRuntimeMetadata(???, ???) C:\Development\XYZCorp\temp\phpcr\vendor\doctrine\phpcr-odm\lib\Doctrine\ODM\PHPCR\Mapping\ClassMetadataFactory.php:141
5.2560 6955920 12. Doctrine\ODM\PHPCR\Mapping\ClassMetadata->validateIdentifier() C:\Development\XYZCorp\temp\phpcr\vendor\doctrine\phpcr-odm\lib\Doctrine\ODM\PHPCR\Mapping\ClassMetadataFactory.php:225
My environment is Window 7, 64bit using WAMP server.
"require": {
"doctrine/dbal": ">=2.2.0,<2.4",
"jackalope/jackalope": ">=1.0-alpha2,<1.1",
"php": ">=5.3.2"
FYI also, I used to the same exception on line 12:
$rootDocument = $documentManager->find(null, '/');
Until I replaced that line with:
$rootDocument = $session->getNode("/");
Thanks for the assistance,
Eli