Question

I'm trying to create a node in Neo4j and I have the following error:

Everyman\Neo4j\Exception

File:

C:\wamp\www\gtg-zf2\vendor\everyman\neo4jphp\lib\Everyman\Neo4j\Command.php:116

Message:

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
(
)

Stack trace:

#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()

I'm on ZF2 framework and here is how I commit my node:

$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();

My entity (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;
}
}

Any idea what is causing this error?

Was it helpful?

Solution

My ec2 instance was not well configure. I have install a new one and everythings is working fine now.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top