我正在尝试在 Neo4j 中创建一个节点,但出现以下错误:
普通人\Neo4j\异常
文件:
C:\wamp\www\gtg-zf2\vendor\everyman\neo4jphp\lib\Everyman\Neo4j\Command.php:116
信息:
Unable to commit batch [404]:
Headers: Array
(
[Access-Control-Allow-Origin] => *
[Content-Type] => text/html; charset=iso-8859-1
[Cache-Control] => must-revalidate,no-cache,no-store
[Content-Length] => 1378
[Server] => Jetty(6.1.25)
)
Body: Array
(
)
堆栈跟踪:
#0 C:\wamp\www\gtg-zf2\vendor\everyman\neo4jphp\lib\Everyman\Neo4j\Command\Batch\Command.php(61): Everyman\Neo4j\Command->throwException('Unable to commi...', 404, Array, Array)
#1 C:\wamp\www\gtg-zf2\vendor\everyman\neo4jphp\lib\Everyman\Neo4j\Command.php(69): Everyman\Neo4j\Command\Batch\Command->handleResult(404, Array, Array)
#2 C:\wamp\www\gtg-zf2\vendor\everyman\neo4jphp\lib\Everyman\Neo4j\Client.php(828): Everyman\Neo4j\Command->execute()
#3 C:\wamp\www\gtg-zf2\vendor\everyman\neo4jphp\lib\Everyman\Neo4j\Client.php(151): Everyman\Neo4j\Client->runCommand(Object(Everyman\Neo4j\Command\Batch\Commit))
#4 C:\wamp\www\gtg-zf2\vendor\hirevoice\neo4jphp-ogm\lib\HireVoice\Neo4j\EntityManager.php(497): Everyman\Neo4j\Client->commitBatch()
#5 C:\wamp\www\gtg-zf2\vendor\hirevoice\neo4jphp-ogm\lib\HireVoice\Neo4j\EntityManager.php(424): HireVoice\Neo4j\EntityManager->commit()
#6 C:\wamp\www\gtg-zf2\vendor\hirevoice\neo4jphp-ogm\lib\HireVoice\Neo4j\EntityManager.php(153): HireVoice\Neo4j\EntityManager->writeEntities()
#7 C:\wamp\www\gtg-zf2\module\Social\src\Social\Service\FriendService.php(96): HireVoice\Neo4j\EntityManager->flush()
我在 ZF2 框架上,这是我提交节点的方式:
$em = new Neo4j\EntityManager(array(
'transport' => 'curl',
'host' => 'my-host', // my host is fine
'port' => 7474,
));
$jane = new UserNeo4j;
$jane->setEmail('test@test.fr');
$em->persist($jane);
$em->flush();
我的实体(UserNeo4j.php):
namespace Neo4j\Entity;
use HireVoice\Neo4j\Annotation as OGM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @OGM\Entity(repositoryClass="Neo4j\Repository\UserNeo4jRepository")
*/
class UserNeo4j
{
/**
* The internal node ID from Neo4j must be stored. Thus an Auto field is required
* @OGM\Auto
*/
protected $id;
/**
* @OGM\Property
* @OGM\Index
*/
protected $email;
/**
* @param mixed $id
* @return $this
*/
public function setId($id)
{
$this->id = $id;
return $this;
}
/**
* @param mixed $email
* @return $this
*/
public function setEmail($email)
{
$this->email = $email;
return $this;
}
}
知道是什么导致了这个错误吗?