仅在一台服务器上使用连接列的异常

时间:2014-03-02 02:28:00

标签: php apache doctrine mysql

我在不同的服务器上有多个开发实例,出于某种原因,其中一个我收到了错误:

Doctrine\ORM\Mapping\MappingException: Cannot find a field on 'models\CampaignEntry' that is mapped to column 'campaigns'. Either the field does not exist or an association exists but it has multiple join columns. in /var/www/html/system/library/Doctrine/ORM/Mapping/MappingException.php on line 371 

MappingException.php的代码在这里:https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Mapping/MappingException.php

我无法确切地看到错误的位置,因为不同服务器上的数据库结构和数据是相同的。代码也是一样的,因为它在Git控件下,并且我在所有这些代码中都有相同的分支。配置选项是相同的,httpd.conf完全相同。

我还能在哪里找到答案呢?在这种情况下,MySQL配置是否可能成为问题?也许与服务器有关的东西?

1 个答案:

答案 0 :(得分:0)

包含该字段注释的注释必须是docblock注释,带有2个星号而不是1个星号。这是错误的,将显示提到的错误:

 /* 
  * @var string $field
  *
  * @Column(name="field", type="string")
  */
private $field;

这是正确的:

/** 
  * @var string $field
  *
  * @Column(name="field", type="string")
  */
private $field;