Eclipse, AppEngine, Java.

277 views
Skip to first unread message

Timofey Danshin

unread,
Jun 3, 2010, 7:38:13 AM6/3/10
to google-appengine
Hi. 
I've tried to split my AppEngine project in two in Eclipse and reference one project from the main one. The project compiles well, but when i try to "Debug it as a web application" it fails with the "java.lang.NoClassDefFoundError". It cant't find the definition of one of my abstract classes i put into the secondary project. Is it possible to split app engine projects in Eclipse? If it is, how can i do that? I didn't find anything about it in the internet.

--
Best Regards,
Timofey.

Siva P Thumma

unread,
Jun 4, 2010, 1:42:55 AM6/4/10
to Google App Engine
The First thing you should check is to make sure you have set the
complete project-specific classpath for both of the projects.
After that, Refresh the contents, clean and build and run.

Peter Liu

unread,
Jun 4, 2010, 2:49:24 PM6/4/10
to Google App Engine
I actually split the project like you. One project as a framework that
other GAE project uses, and one project for app specific stuff.
However, at the end, instead of reference, I created a new source
folder that link to the source folder of the framework. This way the
app project still think everything is within one project.

You might need to make sure those files are included with JDO enhanced
paths. I don't use JDO anymore so everything is just straight
forward .java and .class.

Timofey Danshin

unread,
Jun 13, 2010, 7:06:07 AM6/13/10
to google-a...@googlegroups.com
Thank you very much for your replies. 
I have been trying to create a source folder from my shared part of the project and link it to the project proper, so to speak, as Peter Liu suggested, but i failed again. 
The thing is, apparently, that the .java files in my shared folder get compiled into .class files within the project folder of the shared stuff. What i mean is:
if we have a project called "shared" and a folder in the filesystem called "shared", than we have the "src" and "bin" folders in it. The same apples to the "project" folder (with the AppEngine project and the project specific code). I think it is necessary for the stuff in the shared/src/ to compile into project/bin folder, but it compiles into shared/bin. I tried changing it, but it is impossible. 
And again, Eclipse doesnt show any errors in any of the classes, i.e. it "sees" all the linked files, but GAE still says it cannot find one of my abstract classes.
Am i doing something wrong?


2010/6/4 Peter Liu <tiny...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.




--
Best Regards,
Timofey Danshin.

Timofey Danshin

unread,
Jun 13, 2010, 8:20:14 AM6/13/10
to google-a...@googlegroups.com
Well, I got it!
For those who may follow my footsteps:
You create a java project only with the shared files (NOT a GAE project). You DON'T copy any libraries into the lib folder. You should add the required third-party components into your main project. 
Then you rightclick on the shared project's *source* folder, go to "Build Path -> Remove from build path" item in the context menu. You may, by the way, rename the source folder, so that it has a name different from the default source folder name. Next you rightclick on the main project's folder, go to "Build Path -> Link source".

That did the trick for me.

Thanks, again, for your help.

2010/6/13 Timofey Danshin <rus.mcd...@gmail.com>
Reply all
Reply to author
Forward
0 new messages