Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entities ClassLoader namespace problem #14

Open
rico opened this issue Apr 15, 2011 · 13 comments
Open

Entities ClassLoader namespace problem #14

rico opened this issue Apr 15, 2011 · 13 comments

Comments

@rico
Copy link

rico commented Apr 15, 2011

I'm having a very weird problem with flextrine when flushing or adding specific entities the second time - sounds strange I know.

The workflow as a screencast:

http://dl.dropbox.com/u/38483/flextrine_namespace_issue_workflow.swf

This is the console log of the workflow that produces the error:

NestCheckEntity
[INFO] org.davekeen.flextrine.orm.EntityRepository Adding [NestCheckEntity id=null] {repository=NestCheckEntity, tempUid=881A918E-97FB-886A-20AA-539835BF5B12}
[INFO] org.davekeen.flextrine.orm.EntityManager Persisting [NestCheckEntity id=null]
[INFO] org.davekeen.flextrine.orm.EntityRepository Detected change on managed entity [NestCheckEntity id=null] - property 'checkdate' from 'null' to 'Sun Apr 3 00:00:00 GMT+0200 2011' {repository = NestCheckEntity}

BoxCheckEntity
[INFO] org.davekeen.flextrine.orm.EntityRepository Adding [BoxCheckEntity id=null] {repository=BoxCheckEntity, tempUid=2D8B2489-5B29-B931-4EDC-539889BE46E7}
[INFO] org.davekeen.flextrine.orm.EntityManager Persisting [BoxCheckEntity id=null]
[INFO] org.davekeen.flextrine.orm.EntityRepository Detected change on managed entity [BoxCheckEntity id=null] - property 'box' from 'null' to '[BoxEntity id=12]' {repository = BoxCheckEntity}
[INFO] org.davekeen.flextrine.orm.EntityRepository Detected change on managed entity [BoxCheckEntity id=null] - property 'nestcheck' from 'null' to '[NestCheckEntity id=null]' {repository = BoxCheckEntity}
[INFO] org.davekeen.flextrine.orm.EntityRepository Detected change on managed entity [BoxCheckEntity id=null] - property 'rank' from '0' to '1' {repository = BoxCheckEntity}

LitterEntity
[INFO] org.davekeen.flextrine.orm.EntityRepository Adding [LitterEntity id=null] {repository=LitterEntity, tempUid=A827DD74-0E8B-9191-EE6B-53990A841CED}
[INFO] org.davekeen.flextrine.orm.EntityManager Persisting [LitterEntity id=null]
[INFO] org.davekeen.flextrine.orm.EntityRepository Detected change on managed entity [LitterEntity id=null] - property 'identifier' from 'null' to '2011041412' {repository = LitterEntity}
[INFO] org.davekeen.flextrine.orm.EntityRepository Detected change on managed entity [LitterEntity id=null] - property 'first_found_age' from '0' to '12' {repository = LitterEntity}
[INFO] org.davekeen.flextrine.orm.EntityRepository Detected change on managed entity [LitterEntity id=null] - property 'first_found_date' from 'null' to 'Thu Apr 14 12:40:29 GMT+0200 2011' {repository = LitterEntity}

LitterCheckEntity
[INFO] org.davekeen.flextrine.orm.EntityRepository Adding [LitterCheckEntity id=null] {repository=LitterCheckEntity, tempUid=926A4AE4-8B9E-DB29-100D-53990A8877DA}
[INFO] org.davekeen.flextrine.orm.EntityManager Persisting [LitterCheckEntity id=null]
[INFO] org.davekeen.flextrine.orm.EntityRepository Detected change on managed entity [LitterCheckEntity id=null] - property 'locationCheck' from 'null' to '[BoxCheckEntity id=null]' {repository = LitterCheckEntity}
[INFO] org.davekeen.flextrine.orm.EntityRepository Detected change on managed entity [LitterCheckEntity id=null] - property 'litter' from 'null' to '[LitterEntity id=null]' {repository = LitterCheckEntity}

Flushing
[INFO] org.davekeen.flextrine.orm.EntityManager Flushing
[INFO] org.davekeen.flextrine.orm.EntityManager Updating persisted entity [LitterCheckEntity id=null] with uid 926A4AE4-8B9E-DB29-100D-53990A8877DA
[INFO] org.davekeen.flextrine.orm.EntityRepository Updating [LitterCheckEntity id=1] to [LitterCheckEntity id=1] {repository=LitterCheckEntity, idHash=1}
[INFO] org.davekeen.flextrine.orm.EntityRepository Updating [BoxCheckEntity id=null] to [BoxCheckEntity id=null] {repository=BoxCheckEntity, idHash=}
[INFO] org.davekeen.flextrine.orm.EntityRepository Updating [NestCheckEntity id=null] to [NestCheckEntity id=null] {repository=NestCheckEntity, idHash=}
[INFO] org.davekeen.flextrine.orm.EntityRepository Updating [BoxEntity id=12] to [BoxEntity id=12] {repository=BoxEntity, idHash=12}
[INFO] org.davekeen.flextrine.orm.EntityRepository Updating [LitterEntity id=null] to [LitterEntity id=null] {repository=LitterEntity, idHash=}
[INFO] org.davekeen.flextrine.orm.EntityManager Updating persisted entity [LitterEntity id=null] with uid A827DD74-0E8B-9191-EE6B-53990A841CED
[INFO] org.davekeen.flextrine.orm.EntityRepository Updating [LitterEntity id=1] to [LitterEntity id=1] {repository=LitterEntity, idHash=1}
[INFO] org.davekeen.flextrine.orm.EntityRepository Updating [LitterCheckEntity id=1] to [LitterCheckEntity id=1] {repository=LitterCheckEntity, idHash=1}
[INFO] org.davekeen.flextrine.orm.EntityRepository Updating [BoxCheckEntity id=null] to [BoxCheckEntity id=null] {repository=BoxCheckEntity, idHash=}
[INFO] org.davekeen.flextrine.orm.EntityRepository Updating [NestCheckEntity id=null] to [NestCheckEntity id=null] {repository=NestCheckEntity, idHash=}
[INFO] org.davekeen.flextrine.orm.EntityRepository Updating [BoxEntity id=12] to [BoxEntity id=12] {repository=BoxEntity, idHash=12}
[INFO] org.davekeen.flextrine.orm.EntityManager Updating persisted entity [BoxCheckEntity id=null] with uid 2D8B2489-5B29-B931-4EDC-539889BE46E7
[INFO] org.davekeen.flextrine.orm.EntityRepository Updating [BoxCheckEntity id=1] to [BoxCheckEntity id=1] {repository=BoxCheckEntity, idHash=1}
[INFO] org.davekeen.flextrine.orm.EntityRepository Updating [LitterCheckEntity id=1] to [LitterCheckEntity id=1] {repository=LitterCheckEntity, idHash=1}
[INFO] org.davekeen.flextrine.orm.EntityRepository Updating [LitterEntity id=1] to [LitterEntity id=1] {repository=LitterEntity, idHash=1}
[INFO] org.davekeen.flextrine.orm.EntityRepository Updating [NestCheckEntity id=null] to [NestCheckEntity id=null] {repository=NestCheckEntity, idHash=}
[INFO] org.davekeen.flextrine.orm.EntityRepository Updating [BoxEntity id=12] to [BoxEntity id=12] {repository=BoxEntity, idHash=12}
[INFO] org.davekeen.flextrine.orm.EntityManager Updating persisted entity [NestCheckEntity id=null] with uid 881A918E-97FB-886A-20AA-539835BF5B12
[INFO] org.davekeen.flextrine.orm.EntityRepository Updating [NestCheckEntity id=1] to [NestCheckEntity id=1] {repository=NestCheckEntity, idHash=1}
[INFO] org.davekeen.flextrine.orm.EntityRepository Updating [BoxCheckEntity id=1] to [BoxCheckEntity id=1] {repository=BoxCheckEntity, idHash=1}
[INFO] org.davekeen.flextrine.orm.EntityRepository Updating [LitterCheckEntity id=1] to [LitterCheckEntity id=1] {repository=LitterCheckEntity, idHash=1}
[INFO] org.davekeen.flextrine.orm.EntityRepository Updating [LitterEntity id=1] to [LitterEntity id=1] {repository=LitterEntity, idHash=1}
[INFO] org.davekeen.flextrine.orm.EntityRepository Updating [BoxEntity id=12] to [BoxEntity id=12] {repository=BoxEntity, idHash=12}

==> Everything is saved to the database

Editing BoxCheckEntity -> adding Litter and LitterCheckEntity
INFO] org.davekeen.flextrine.orm.EntityRepository Adding [LitterEntity id=null] {repository=LitterEntity, tempUid=DA0C042C-BBF7-2569-1990-539D2A4786C8}
[INFO] org.davekeen.flextrine.orm.EntityManager Persisting [LitterEntity id=null]
[INFO] org.davekeen.flextrine.orm.EntityRepository Detected change on managed entity [LitterEntity id=null] - property 'identifier' from 'null' to '2011041412_1' {repository = LitterEntity}
[INFO] org.davekeen.flextrine.orm.EntityRepository Detected change on managed entity [LitterEntity id=null] - property 'first_found_age' from '0' to '12' {repository = LitterEntity}
[INFO] org.davekeen.flextrine.orm.EntityRepository Detected change on managed entity [LitterEntity id=null] - property 'first_found_date' from 'null' to 'Thu Apr 14 12:44:59 GMT+0200 2011' {repository = LitterEntity}

[INFO] org.davekeen.flextrine.orm.EntityRepository Adding [LitterCheckEntity id=null] {repository=LitterCheckEntity, tempUid=2550C0E4-5375-F58A-99FA-539D2A4D006E}
[INFO] org.davekeen.flextrine.orm.EntityManager Persisting [LitterCheckEntity id=null]
[INFO] org.davekeen.flextrine.orm.EntityRepository Detected change on managed entity [LitterCheckEntity id=null] - property 'locationCheck' from 'null' to '[BoxCheckEntity id=1]' {repository = LitterCheckEntity}
[INFO] org.davekeen.flextrine.orm.EntityRepository Detected change on managed entity [LitterCheckEntity id=null] - property 'litter' from 'null' to '[LitterEntity id=null]' {repository = LitterCheckEntity}

Flushing
[INFO] org.davekeen.flextrine.orm.EntityManager Flushing

PHP error ==> PHP Fatal error: require() [function.require]: Failed opening required '/Library/WebServer/micemeta/flextrine/php/app/micemeta/entities/ch_tofuse_micemeta_entities::LitterEntity.php' (include_path='.:/usr/local/php5/lib/php:/Library/WebServer/micemeta/flextrine/php/lib') in /Library/WebServer/micemeta/flextrine/php/lib/Doctrine/Common/ClassLoader.php on line 148

The saved Charles session: http://dl.dropbox.com/u/38483/php_namespace_issue_charles_session.chls
The php stack trace: http://dl.dropbox.com/u/38483/php_namespace_issue_stack_trace

In the Charles session, I noticed that the "Object Reference" of the new LitterEntity sent to the server during the second flush is already wrong (ch.tofuse.micemeta.entities::LitterEntity).

I put all my code on github. The flex application https://github.com/rico/micemeta-flex , the flextrine part https://github.com/rico/micemeta-flextrine .

The magic happens here https://github.com/rico/micemeta-flex/blob/master/src/ch/tofuse/micemeta/views/components/nestcheck/NestcheckOverview.mxml , where the BoxCheck entities , and here https://github.com/rico/micemeta-flex/blob/master/src/ch/tofuse/micemeta/views/components/nestcheck/NestcheckLitterView.mxml , where Litter entities and LitterCheck entities are handled.

OS: OS X 10.6.7
PHP: 5.3.4
Webserver: Apache/2.2.17 (Unix)

Tested with the latest checkout from 12.April.

I'm really sorry if this is just a simple coding error from my side, but I can't see how my code can influence the namespace - or whatever - of an entity class between two flushes.

Thank you for looking into it - rico

@ccapndave
Copy link
Owner

Wow! If only all bug reports were like this :) Thanks for the details and I'll look into it as soon as I get a chance.

@rico
Copy link
Author

rico commented May 16, 2011

Hi Dave, I really don't want to rush you, but since this is a real show stopper for my project, I would very much appreciate any information concerning this issue. Is there anything I can try or test to get around it? thanks - rico

@ccapndave
Copy link
Owner

Hey Rico,

Very sorry for the delay - I have had deadlines and been travelling over the last month so haven't had a moment to look into this; as soon as work things settle down this is at the top of my open-source list :) As for things to try; it seems like a very strange issue - more of an AMF serialization error than anything that Flextrine itself should be able to cause. Perhaps check that you are definitely using the bundled Zend folder and not an older version of Zend Framework from elsewhere on your machine. You could also potentially try with a different version of PHP (although this is very unlikely to make a difference).

If you have a Windows machine to hand it might be worth trying it on that too in case this is a Mac specific issue (although again, I doubt it as I have Flextrine sites running on various *nix distributions without issue).

Dave

@rico
Copy link
Author

rico commented May 16, 2011

Hi Dave, there's definitely nothing to be sorry about - I appreciate your work and help very much. I will try the things you mentioned and feel honored that the issue made it to the top of your open-source list ;-) - rico

@rico
Copy link
Author

rico commented May 26, 2011

Hi Dave, I tested the application with another php package on my mac and on a Linux Server and get the same error, no matter what host and or php version.

I assured that I'm using the bundled Zend version (using log statements and deleting other instances of the framework) - rico

@ccapndave
Copy link
Owner

Hey Rico,

I finally have a little time to look into this for you. I tried compiling from your git repository, but it seems your code requires some dependencies (ModuleContainerContentSkin, BaseTextInput, Robotlegs etc). Could you possibly give me a Flash Builder archive or a zip of the source folder with all swc dependencies?

@rico
Copy link
Author

rico commented Jun 4, 2011

Hi Dave, that's great, thank you very much! You can download the flex project from http://dl.dropbox.com/u/38483/micemeta-as3.fxp . You will find an ant file named clean.xml (to create the entities, populate the database, etc.) in the ant directory of the project, which you need to configure for your environnement.

The flextrine php part can be downloaded from http://dl.dropbox.com/u/38483/micemeta-flextrine-php.zip .

Let me know if I can help - rico

@ccapndave
Copy link
Owner

Hey Rico,

Getting closer, but running the application gives me the following exception on startup:

ReferenceError: Error #1065: Variable ch.tofuse.micemeta.skins.button::ExtendedButtonBarSkinInnerClass0 is not defined.
at ch.tofuse.micemeta.skins.button::ExtendedButtonBarSkin/_ExtendedButtonBarSkin_ClassFactory1_i()

Any clues?

@rico
Copy link
Author

rico commented Jun 4, 2011

Hi Dave, unfortunately I have no idea - I'm using the latest 4.1 SDK without any error. But you can comment lines 6 and 24 in ch.tofuse.micemeta.views.navigation.ExtendedTabBar and the skin class will not be used - rico

@ccapndave
Copy link
Owner

I have reproduced this locally, and you are quite right; its a crazy error! The only clue I have so far is that it only seems to happen with a persist followed by an update - multiple updates don't cause the problem. I'll keep you posted.

@rico
Copy link
Author

rico commented Jun 22, 2011

... thank you for the update - I'll stay tuned - rico

@rico
Copy link
Author

rico commented Aug 5, 2011

Hi Dave, I'm sorry to bug you again. Are you still working on this or could you give me a vague assumption if and when you could have a look at it again? I'm sorry to ask- I really do appreciate your work on this open source project and the framework itself very much - rico

@ccapndave
Copy link
Owner

Hey Rico,

Every now and again I pop back to this issue, and still can't figure out quite what is going on. I've now written some large RIAs with Flextrine and never encountered this issue anywhere outside of your example!

Today, I saw this on StackOverflow; notice how the error is kind of similar to what you are reporting (although in a different context). I wonder if its a clue? http://stackoverflow.com/questions/7113179/why-casting-failed-when-used-swf-loader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants