This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

data-load "Couldn't find class ..." SOLVED

This is for discussion, mainly on 1.x but there's some 2.x topics here too.

data-load "Couldn't find class ..." SOLVED

by crashbtz » Thu Feb 17, 2011 12:23 pm

Hello everyone,
So firstable, I'm french so I'm gonna try to be clear and do not make a lot of mistakes :D
I have a problem with my symfony project. I followed the symfony tutorial about the Jobeet project and everything was fine.
Now I start my own project and I have a probleme at the step "symfony doctrine:data-load"
All the previously command worked fine (php symfony doctrine:build --model, php symfony doctrine:build --sql, php symfony doctrine:insert-sql) but when I want load my fixtures.yml, an error occured and say:
Couldn't find class ´╗┐Client
PHP Fatal error: Call to a member function evictAll() on a non-object in C:\developpementSymfony\projects\ami_test\lib\vendor\symfony\lib\plugins\sfDoctrinePlugin\lib\vendor\doctrine\Doctrine\Connection.php on line 1239
....

I tried to restart all the project but still. x(~:dead:
Here is my schema.yml
Code: Select all
Utilisateur:
  columns:
    client_id:   { type: integer, notnull: true }
    nom:         { type: string(255), notnull: true }
    prenom:      { type: string(255), notnull: true }
    email:       { type: string(255), notnull: true }
    login:       { type: string(255), notnull: true, unique: true }
    mdp:         { type: string(255), notnull: true }
    metier:      { type: string(255) }
    service:     { type: string(255) }
    site:        { type: string(255) }
    dob:         { type: timestamp }
    genre:       { type: string(20) }
    taille:      { type: integer }
    poids:       { type: integer }
    lateralite:  { type: string(8) }
    vue:         { type: string(255) }
  relations:
    Client:
      onDelete: CASCADE
      local: client_id
      foreign: id
      foreignAlias: Utilisateurs

Client:
  columns:
    nom:            { type: string(255), notnull: true }
    adresse:        { type: string(500), notnull: true }
    adresse_compl:  { type: string(255) }
    code_postal:    { type: integer, notnull:true }
    ville:          { type: string(255), notnull: true }
    responsable:    { type: string(255) }
    fonction:       { type: string(255) }
    tel:            { type: integer }
    fax:            { type: integer }
    email:          { type: string(255), notnull: true }

And my fixtures.yml
Code: Select all
#data/fixtures/utilisateurs.yml
Utilisateur:
  cedric:
    Client: xxxxx
    nom: xxxxx
    prenom: xxxx
    email: xxxx.xxxx@xxxx.com
    login: xxxx
    mdp: xxxx
    metier: xxxx
    site: xxxx
    dob: 'xxxx'
    genre: xxxx
    taille: xxxx
    poids: xxxx
    lateralite: xxxx

  laetitia:
    Client: xxxx
    nom: xxxx
    prenom: xxxx
    email: xxxx@xxxx.eu
    login: xxxx
    mdp: xxxx
    metier: xxxx
    site: xxxx
    dob: 'xxxx'
    genre: xxxx
    taille: xxxx
    poids: xxxx
    lateralite: xxxx

#data/fixtures/clients.yml
Client:
  alterinfo:
    nom: xxxx
    adresse: xxxx
    code_postal: xxxx
    ville: xxxx
    responsable: xxxx
    fonction: xxxx
    email: xxxx.xxxx@xxxx.eu

  capgemini:
    nom: Capgemini
    adresse: 19 Allée James Watt
    code_postal: 33700
    ville: Bordeaux
    responsable: xxxx
    fonction: Directeur
    email: xxxx.xxxx@xxxx.com


I'm looking for 2 days now and I found nothing, so If anyone can help me.... Thank you
crashbtz
Junior Member
 
Posts: 6
Joined: Thu Feb 17, 2011 11:59 am

Re: data-load "Couldn't find class ..."

by crashbtz » Fri Feb 18, 2011 3:26 pm

up
crashbtz
Junior Member
 
Posts: 6
Joined: Thu Feb 17, 2011 11:59 am

Re: data-load "Couldn't find class ..."

by claudia_k » Fri Feb 18, 2011 8:59 pm

Does the same happen when you import only the clients.yml? To test this simply remove the other fixtures files from the fixtures folder and try the data load again.

Also have a look at your fixtures files: In your error message there are some weird character in front of the class name - maybe these weird characters are also in your yml file?

Good luck

Claudia
claudia_k
Faithful Member
 
Posts: 265
Joined: Mon Jun 21, 2010 8:12 pm
Location: Luxembourg

Re: data-load "Couldn't find class ..."

by crashbtz » Mon Feb 21, 2011 11:43 am

That problem happen with every file, so I deleted all of them and keep clients.yml and fixtures.yml.
And I know about the weird character, I checked but I don't know where they come from, they aren't in my file.
I think maybe there is a mistake in the file client.yml because I don't know YAML very well.
crashbtz
Junior Member
 
Posts: 6
Joined: Thu Feb 17, 2011 11:59 am

Re: data-load "Couldn't find class ..."

by halfer » Mon Feb 21, 2011 11:53 pm

In your fixtures, remove this:

#data/fixtures/utilisateurs.yml

I think this is added to some of the doc examples to show where to put the file - it is not actually intended to be part of it. (I can't remember what the comment symbol is for yaml - it could be #...)
halfer
Faithful Member
 
Posts: 10148
Joined: Mon Jan 30, 2006 1:16 pm
Location: West Midlands, UK

Re: data-load "Couldn't find class ..."

by crashbtz » Mon Feb 28, 2011 7:08 pm

After looking for hours and hours, I finally found what was wrong.
That was stupid, the reason was about the file encoding format.
It was UTF-8 and when I changed to ANSI, everything was fine.
crashbtz
Junior Member
 
Posts: 6
Joined: Thu Feb 17, 2011 11:59 am

Re: data-load "Couldn't find class ..." SOLVED

by yeuekmn » Sun Sep 04, 2011 12:25 pm

crashbtz wrote:Hello everyone,
So firstable, I'm french so I'm gonna try to be clear and do not make a lot of mistakes :D
I have a problem with my symfony project. I followed the symfony tutorial about the Jobeet project and everything was fine.
Now I start my own project and I have a probleme at the step "symfony doctrine:data-load"
All the previously command worked fine (php symfony doctrine:build --model, php symfony doctrine:build --sql, php symfony doctrine:insert-sql) but when I want load my fixtures.yml, an error occured and say:
Couldn't find class ´╗┐Client
PHP Fatal error: Call to a member function evictAll() on a non-object in C:\developpementSymfony\projects\ami_test\lib\vendor\symfony\lib\plugins\sfDoctrinePlugin\lib\vendor\doctrine\Doctrine\Connection.php on line 1239
....

I tried to restart all the project but still. taylormade r11 irons(~:dead:
Here is my schema.yml
Code: Select all
Utilisateur:
  columns:
    client_id:   { type: integer, notnull: true }
    nom:         { type: string(255), notnull: true }
    prenom:      { type: string(255), notnull: true }
    email:       { type: string(255), notnull: true }
    login:       { type: string(255), notnull: true, unique: true }
    mdp:         { type: string(255), notnull: true }
    metier:      { type: string(255) }
    service:     { type: string(255) }
    site:        { type: string(255) }
    dob:         { type: timestamp }
    genre:       { type: string(20) }
    taille:      { type: integer }
    poids:       { type: integer }
    lateralite:  { type: string(8) }
    vue:         { type: string(255) }
  relations:
    Client:
      onDelete: CASCADE
      local: client_id
      foreign: id
      foreignAlias: Utilisateurs

Client:
  columns:
    nom:            { type: string(255), notnull: true }
    adresse:        { type: string(500), notnull: true }
    adresse_compl:  { type: string(255) }
    code_postal:    { type: integer, notnull:true }
    ville:          { type: string(255), notnull: true }
    responsable:    { type: string(255) }
    fonction:       { type: string(255) }
    tel:            { type: integer }
    fax:            { type: integer }
    email:          { type: string(255), notnull: true }

And my fixtures.yml
Code: Select all
#data/fixtures/utilisateurs.yml
Utilisateur:
  cedric:
    Client: xxxxx
    nom: xxxxx
    prenom: xxxx
    email: xxxx.xxxx@xxxx.com
    login: xxxx
    mdp: xxxx
    metier: xxxx
    site: xxxx
    dob: 'xxxx'
    genre: xxxx
    taille: xxxx
    poids: xxxx
    lateralite: xxxx

  laetitia:
    Client: xxxx
    nom: xxxx
    prenom: xxxx
    email: xxxx@xxxx.eu
    login: xxxx
    mdp: xxxx
    metier: xxxx
    site: xxxx
    dob: 'xxxx'
    genre: xxxx
    taille: xxxx
    poids: xxxx
    lateralite: xxxx

#data/fixtures/clients.yml
Client:
  alterinfo:
    nom: xxxx
    adresse: xxxx
    code_postal: xxxx
    ville: xxxx
    responsable: xxxx
    fonction: xxxx
    email: xxxx.xxxx@xxxx.eu

  capgemini:
    nom: Capgemini
    adresse: 19 Allée James Watt
    code_postal: 33700
    ville: Bordeaux
    responsable: xxxx
    fonction: Directeur
    email: xxxx.xxxx@xxxx.com


I'm looking for 2 days now and I found nothing, so If anyone can help me.... Thank you






remove #data/fixtures/utilisateurs.yml
yeuekmn
Junior Member
 
Posts: 2
Joined: Sun Sep 04, 2011 12:08 pm