I'm having a problem where if I ever introduce a file into the project
without using the builtin "New -> Cal Module", then I get errors ever
after that force me to scrap the project and start over, adding each
file via "New -> Cal Module" and then restoring the old one over the
new empty one.
The errors usually start something like:
java.lang.NoClassDefFoundError: org/openquark/cal/eclipse/core/
CALModelManager
at
org.openquark.cal.eclipse.ui.views.CALWorkspace.<init>(CALWorkspace.java:
94)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
I'm working on a framework that auto-generates files by reverse
engineering a database - so of course I'd like to add new files into
the project automatically and not through the menu. Also sometimes I
may get the new files through version control or some other way.
So: is there some way of clearing the state of the plugin so that I
can get it to recognize the new files, and not have to keep recreating
my projects? Even a pristine copy from a tar archive, made before
adding the new files, still causes errors, if the error has ever
occurred!
Any help appreciated.
Steve
I'm using the latest version of the plugin, and Eclipse Europa
(3.3). I believe the error also occurred with the previous version
of Eclipse (or a very similar error).
I'm using a separate project for my modules (ie. not in the Quark
binaries), created as described in the plugin docs.
Please let me know if any other details are needed. I'll be happy to
help hunt down the problem if it's not already a known issue.
Thanks
Steve
Sorry to hear about your troubles with the plugin.
Your descriptions have been helpful in producing some failing test
cases for us -- however I haven't been able to reproduce errors of the
sort that you describe. I installed the latest release version of the
plugin on a fresh copy of Europa, and created a new Java project which
depends on a project created from the Quark binaries.
Are you getting AssertionFailedExceptions? This is the category of
problem I'm seeing.
Also, I noticed a couple of problems with the current documentation
with respect to setting up new CAL projects:
- if it's not there already, can you try adding the CAL Nature to the
project?
--- Right-click on the project, CAL Tools -> Add CAL Nature
- Can you add to the new project a project reference to the Quark
binaries project?
--- Right-click on the project, Properties -> Java Build Path ->
Projects tab. Add... , then check the Quark binaries project.
One other thing to check for is the presence of old plugins.
Do you have plugins with a plugin Id starting with
com.businessobjects. ???
(You can check via Help -> About Eclipse SDK -> Plug-in Details).
If the above don't apply, here is some info which might be helpful to
us --
What does your workspace setup look like? Is is a Quark binaries
project and a Java project which depends on it?
What is the name of the file you are creating, and where in the
project is it being added? Is it being added to a CAL subfolder of a
folder on the project's classpath?
Thanks,
- Edward
By the way, I think the docs may be OK. The Cal nature appears to be
added automatically when you do new->Cal module, as I never had to add
it manually in the last couple of days when I've been repeatedly
recreating projects. It also seems to link up to the existing Cal
binaries project automatically too. I'm able to compile and do
development (for weeks or more) if I carefully use "new->cal module"
to create each module. The problem seems to happen when generating
the new modules programmatically, or reorganizing package names on
existing modules (e.g. pushing existing modules into new subpackages).
The strange thing is, after it fails, I can never get it to work
again, no matter what - the plugin won't load at all if that project
is open after that point (but will if only the Quark binaries project
is open when Eclipse is restarted). So I can't even restore from
backup.... That's why I gave in and asked for help, though I hate to
for this sort of thing - I know these things are really hard for you
all to debug remotely given all the variables involved.
If it would help, tomorrow I'll get together before/after archives of
the whole project with exact steps to reproduce the problem. I don't
think you could create valid plugin-compatible Eclipse projects
yourself from them directly though, unless I'm missing something,
because it always failed for me. The Cal plugin seems to have some
state somewhere that prevents it, though I don't know where...
I'll post more information tommorrow...
Thanks for the assistance,
Steve
The error_readme.txt file has the instructions. It involves creating
a new project, and copying a couple of source code directories from
the other file, NCTR_Cal_Frameworks{.zip or .tar.gz} (same contents).
Also, that archive is the complete project that was created with the
instructions, after the error has occurred, in case it helps to find
the problem.
I was able to reach this error both on my Linux machine and via a
fresh Europa and Eclipse install on a Windows machine, so I think you
should be able to reproduce it.
Thanks again for looking into it!
Steve
Thanks -- I was able to figure out what was happening with the files
that you provided.
The problem is that the CAL Eclipse plug-in has some code which looks
at file extensions, and this is missing a null check. This missing
null check trips up the plug-in when it looks in the .svn folder and
finds files without a file extension. The code is called from the
plugin's start() method -- any exceptions here cause the plugin to
fail to load, which explains the NoClassDefFoundErrors.
Rest assured that I will be adding the necessary null check. :)
I'm not sure why the problem is avoided when using the New CAL Module
wizard though - maybe it has to do with the plug-in's interaction with
a Subversion plugin?
Unfortunately until the next release (coming soon!), the only solution
I can suggest is to avoid having files under Java source folders which
don't have a file extension.
I hope this helps.
Thanks,
- Edward
I'm pretty sure this was just a red herring of my own creation, having
to do with the timing of things in my ritual of recreating projects.
After doing all the New->Cal Module's and checking that things were
OK, the next step was always to copy in the old source code (and
inadvertently the extensionless files), which is when the problems
began.
It's working fine now - easy to avoid the problem now that the true
cause is known!
Thanks again
Steve