0
我已經使用Symfony 2和我已成功配置FOSUserBundle。無效實體或超級基類
我的應用程序工作正常的Windows機器上的兩個生產和發展模式
但是,當我部署它的Linux機器上它發展模式工作正常,但它在生產出一個空白頁模式。當我檢查錯誤日誌文件,它下面的錯誤
request.CRITICAL: Doctrine\ORM\Mapping\MappingException: Class \Entity\User is not a
valid entity or mapped super class. (uncaught exception)
request.CRITICAL: Exception thrown when handling an exception
(Doctrine\ORM\Mapping\MappingException: Class \Entity\User is not a valid entity or
mapped super class.) [] []
看一看到我的用戶實體類:
/**
* @ORM\Entity(repositoryClass="\Repository\UserRepository")
* @ORM\Table(name="user")
*/
class User extends BaseUser
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="string", length="255")
*
* @Assert\NotBlank(message="Please enter your name.", groups={"Registration", "Profile"})
* @Assert\MinLength(limit="3", message="The name is too short.", groups={"Registration", "Profile"})
* @Assert\MaxLength(limit="255", message="The name is too long.", groups={"Registration", "Profile"})
*/
protected $name;
/**
* @ORM\Column(type="date", length="255", nullable=true)
*
* @Assert\NotBlank(message="Please select your Date Of Birth.", groups={"Registration", "Profile"})
*/
protected $dob;
/**
* @ORM\Column(type="string", length="255")
*
* @Assert\NotBlank(message="Please select your Date Of Birth.", groups={"Registration", "Profile"})
*/
protected $gender;
/**
* Override $email so that we can apply custom validation.
*
* @Assert\Email(groups={"AppRegistration"})
*/
protected $email;
/**
* @var string $firstName
*
* @ORM\Column(name="first_name", type="string", length=20, nullable=true)
*/
protected $firstName;
/**
* @var string $lastName
*
* @ORM\Column(name="last_name", type="string", length=20, nullable=true)
*/
protected $lastName;
/**
* @var datetime $createdAt
*
* @ORM\Column(name="created_at", type="datetime", nullable=true)
*/
protected $createdAt;
/**
* @ORM\Column(type="string", length="255", nullable=true)
* @var string
*/
protected $facebookID;
/**
* @ORM\Column(type="string", length="255", nullable=true)
* @var string
*/
protected $twitterID;
/**
* @ORM\Column(type="string", length="255", nullable=true)
* @var string
*/
protected $twitter_username;
/**
* @ORM\Column(type="string", length="255", nullable=true)
* @var string
*/
protected $image_path;
/**
* @ORM\Column(name="home_town",type="string", length="255", nullable=true)
* @var string
*/
protected $homeTown;
/**
* @ORM\Column(name="location",type="string", length="255", nullable=true)
* @var string
*/
protected $location;
/**
* @ORM\Column(name="interest",type="string", length="255", nullable=true)
* @var string
*/
protected $interest;
/**
* @ORM\Column(name="friend",type="string", length="255", nullable=true)
* @var string
*/
protected $friend;
/**
* @var smallint $age
*
* @ORM\Column(name="age", type="smallint", nullable=true)
*/
protected $age;
/**
* @var string $country
* @ORM\ManyToOne(targetEntity="Country", inversedBy="user")
* @ORM\JoinColumn(name="country_id", referencedColumnName="id")
* @ORM\Column(name="country_id", type="string", length=25, nullable=true)
*/
protected $countryId;
/**
* @ORM\OneToMany(targetEntity="ProfileViewer", mappedBy="viewer")
*/
protected $viewers;
..................
請幫助我,因爲這對我來說是非常迫切....
我嘗試過不同的名稱,但它沒有奏效... –