I have been working on a demo project all day and everything went just fine.
Suddenly (and, as it seems, unrelated to any of my actions) my application fails with a NoClassDefFoundError somewhere in the CDI internals. Strangely it worked before but I just cannot get it to work again.
I am using a rather fresh NB 6.9.1 install without any modules. I launched my Java Web application simply by clean+build and then run menu items.
The non-default setup is this:
I added two JARs from the Jersey project to the Library folder of my project:
jersey-bundle-1.5-SNAPSHOT.jar
jersey-view-client-1.5-SNAPSHOT.jar
I removed the restlib libraries added by Glassfish.
I set class loader delegate to false in sun-web.xml:
as described by the Jersey docs.
That all worked fine up to a sudden point.
Can anyone provide a clue where I could at least start investigating?
The same thing (everything works until NoClassDefFoundError emerges) happened to me once in a while on other projects as well.
The solution is to remove .netbeans/6.9/var/cache and restart NetBeans. I suspect that the culprit is corrupted index for NetBeans’ custom classloader.