2014-01-24 6 views
0

Я пытаюсь создать узел в Neo4j и у меня есть следующее сообщение об ошибке:Ошибка при попытке создать узел в Neo4j с помощью модуля обывателя и hirevoice

обывателя \ Neo4j \ Exception

файла:

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('[email protected]'); 
$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; 
} 
} 

Любая идея, что является причиной этой ошибки ?

+0

В классе транспорта завитка вы можете выгрузить тело запроса, URL-адрес и метод? Исключение указывает, что никакой конечной точки, которую вы нажимаете, не существует. –

+0

У меня есть тест командной строки: php neo4jphp.phar http: // my-host и он возвращает: Неустранимая ошибка: Не удалось исключить «Everyman \ Neo4j \ Exception» с сообщением «в phar: // C:/wamp/www/тест/neo4jphp.phar/Библиотека/обыватель/Neo4j/Command.php на линии 116 обывателя \ Neo4j \ Исключение: Невозможно получить информацию сервера [500]: Headers: Array ( ) Body: Array ( [error] => Не удалось решить хост: http; Хост не найден [6] ) в phar: // C: /wamp/www/zf2-gtg/neo4jphp.phar/lib/Everyman/Neo4j/Command. php в строке 116. – user3232946

+0

Когда я повторяю метод getEndpoint(), он возвращает: http://my-host.com:7474/db/data, и у меня нет проблем с доступом s к этому url над http – user3232946

ответ

0

Мой экземпляр ec2 плохо настроен. У меня есть новый, и все работает сейчас отлично.