GlassFish NoClassDefFoundError - Netbeans project - netbeans

I'm sometimes getting NoClassDefFoundError after deploying web application in Netbeans (6.9.1). It's actually problem with Netbeans not deploying entire project (not copying class files or other relevant files), but only part of it.
Running "Clean & Build" a few times and/or copying rest of the files solves the problem, but it's very inconvenient.
Anyone knows the cause or solution of this problem?

Try clearing your Netbeans cache, or check out the bug fixes for Netbeans 7.
The cache is at ~/.netbeans/6.9/var/cache. I found instructions to just delete the index/ folder in the cache, but that didn't seem to be enough.
EDIT: Deleting the entire cache didn't seem to resolve it, either.

Your answer is not much clear but,
I suggest to add your required jar files in Netbeans library then import the library into your project..
If this does not work then i'll be glad to having the complete situation and errors to be written here...

Related

Dead Roo Project (Unresponsive Shell)

I've been working with a Roo project for a while but now when I type a command into the Roo shell, I don't get anything at all, although the CPU usage seems to go very high.
Seen similar problems on here and tried various suggested fixes such as:
Deleting the bgp (I think) file in my home directory (Win 7)
Deleting the entire .m2 maven repository folder
Upgrading to STS 2.9.1
Deleting various cache folders/files in Roo's root folder (sts-cache-)
Opening/cleaning my project a million times
There's nothing coming out in the log file (.log in my workspace metadata folder).
At a loss as to what to do now. If anyone can help I would be very grateful.
Thanks
When the size of the project gets big, Spring Roo does take a lot of time in building class files.
A few things you can do :
Please make sure that in the STS settings, auto build is disabled. Only build when it's needed.
How does your memody graph go? Try to tweak the memory in the STS.ini.

QueryDsl Intellisense / Netbeans problems

I have all the QueryDSL jars referenced from the all directory in my libraries. My problem NetBeans is not seeing the "Q"objects. They are generated to the same directory as all the other JPA entity objects with "_". Secondly if I use a "Q" object it does compile, but the editor itself does not see it and thinks it is an error.
Anyone have any ideas? I tried editing the Ant file but I failed at that as well. It does not seem that I need to edit it specifically for generation. The main problem appears to be linking to the NetBeans editor.
BTW I did look at this link and I already did this! How to setup classpath in Netbeans?
Also I have this problem on both Mac OSX and Ubuntu Netbeans.
Help is appreciated!!
Best fix that is consistent is to go to project properties and add the build/generated-sources as a Source package Folder in Sources.
I had the same problem. I did a clean & Build, on the project and that did it for me. I could clearly see the java files being generated, and the class files are not getting in the path. Clean did the trick for me.

Eclipse ignoring source when deploying webapp

I'm running eclipse with tomcat 5.5. For some unknown reason from one day to the other eclipse stoped compiling my beans and java files that are in the source folder.
If I go to the work directory, I find all the JSP compiled, the folders of the packadges i have, but no classes compiled inside of them. Neither eclipse, nor tomcat give errors. (Except when i try to access the non existing classes)
Anyone has any idea why this happens and how to fix it?
/fmsf
You might have "Build automatically" disabled. You can find it in the Project menu.
I've faced with such a scenario once. In addition it did not detect the local changes w.r.t the code repository. Honestly I don't know the reason but use of a new eclipse installation (Extraction) on same workspace resolved the issue.
Found the problem:
One of the files came out of SVN without read access. Eclipse blocked reading it and wouldn't compile.
+1 to all tks

eclipse is not building my EAR correctly - sometimes it forgets the war, and always leaves out my library jars - why?

I just upgraded to eclipse galileo from ganymede sr2 and now eclipse is doing a really bad job of building my EAR file during deployment. There are several utility jars that are supposed to be included that it is completely ignoring, and there is a single war file that it only includes in the EAR occasionally. Thus, when I deploy to glassfish I get errors like "File not found: blah.war" or if the war file is present, I get ClassNotFound errors.
Also, I'm trying to remove some EJB jars from the EAR but it still adds some of them back into the application.xml (it doesn't put them into the EAR as well, unfortunately).
I think eclipse is storing some extra metadata about the project somewhere outside of the EAR project and ignoring my changes to it, which is annoying. However, I don't know where this is or how to "flush" it away.
Has anyone run into something like this? Any idea how I could figure out what is really going on?
Thanks!
I have the same issue when redeploying, hopefully someone can shed some light on this, otherwise I'm going back to Ganymede...only way around it for me is to always delete the deployed EAR first then things are fine after that when I do a deploy...kind of stupid IMO.
Also getting bad memory leaks with galileo...system slows to a crawl after a few hours of usage, and lot more crashes vs Ganymede...sigh serves me right for jumping to a new version!
Looks like you can read more about this in BugZilla:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=283184
I think they'll have a fix in the next release of WTP.

Eclipse won't delete files

I've got an ANT project with libs managed by ivy (they are under lib_managed). Eclipse is using the jars to. Probelm is: if I try to update the directory ant refuses to delete it because eclipse holds on to the jars in its classpath. Even if I update (empty) eclipses classpath I can't delete the files. If anyone had the same problem and found a solution I would be thankfull for an answer.
Regards, Jan
Not a solution, but a workaround. I experience Eclipse keeping locks on files quite often in different contexts. I suggest using Unlocker.
I guess this is on Windows. Use the Process Explorer to figure out who is locking the files. Eclipse shouldn't keep a lock; maybe you have the code running in the debugger (hanging in a breakpoint). Use the list of open files and the properties to figure out which Java program is keeping the lock on the files.
If it's really Eclipse, try to upgrade to a newer version of Eclipse or close the project when you need to update the dependencies with ivy.
Cleaning the workspace and restarting eclipse may solve the problem. But in real development environment i don't think its a good idea to restart eclipse whenever you need to build a jar.