Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Netbeans Cache Bugs

runtime cache

  • Please log in to reply
9 replies to this topic

#1 gregwarner

gregwarner

    Obi Wan of Programming

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1586 posts
  • Location:Arkansas
  • Programming Language:C, Java, C++, C#, PHP, Transact-SQL

Posted 26 April 2012 - 11:58 AM

I'm curious to know whether anyone has any insight into the cache bugs in Netbeans. I've read many threads all over the web that talk about deleting the Netbeans cache folder to fix obscure behavioral problems in the IDE.

My current project won't run at all. There are absolutely zero compiler errors, but when I try to run it, I get this message:
Exception in thread "main" java.lang.ExceptionInInitializerError
	at t*****client.processing.C*****Manager.<init>(C*****Manager.java:35)
	at t*****client.T*****Client.<init>(T*****Client.java:115)
	at t*****client.T*****Client.main(T*****Client.java:49)
Caused by: java.lang.RuntimeException: Uncompilable source code - cannot find symbol
  symbol:   class R*****Code
  location: class t*****api.communication.T*****Packet
	at t*****client.processing.C*****Process.<clinit>(C*****Process.java:24)
	... 3 more
Java Result: 1
(Class names have been redacted because my code is the intellectual property of my employer and classifies as a trade secret in my employment contract, and I don't want anyone mad at me. Sorry.) :(

I should mention I'm trying to run it from within the Netbeans IDE.

Here's the back story on my problem:

Everything was working just fine a few hours ago, then I had some trouble with my Subversion commit, which threw up a bunch of old deleted source files and packages from a previous version into my project directory. I spent some time re-deleting everything and getting the project's state back to the state it was in just before my last commit. I updated my Subversion repository with this latest version, which, as far as I can tell, is identical to what it was before the commit, which should be correct, yet now my code magically doesn't execute. Just throws the above exception.

I've tried cleaning and rebuilding all dependencies with no luck. Same error. It seems it can't find the symbol "R*****Code", which is a public static enum in my "T*****Packet" class. I've triple checked. R*****Code is there.

While I was hassling around with old files getting reimported back into my project, I noticed Netbeans put a red squiggly line under any reference to the R*****Code type, even though the type was clearly defined in T*****Packet. I cleaned and rebuilt, and that problem went away, however, its runtime equivalent is still here.

From what I can gather, I'm supposed to clear Netbeans' cache and restart the IDE to fix this. I haven't tried that, as I have never in many years ever had to clear the Netbeans cache. Am I just extraordinarily lucky until today or what? (Seriously. I have no clue.)

In other words, I'm really just looking for people's insight into this Netbeans cache bug, to see if anybody else has experienced frustrating stuff like this. Oh, and whether or not clearing the cache will fix my problem. I'm kinda afraid to try it for fear I'll break something else. :)
  • 0

ti-99-sig.png
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid


#2 wim DC

wim DC

    Roar

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 2681 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Python

Posted 26 April 2012 - 10:39 PM

Netbeans appears to compile when the file is saved. So you can try adding a space in troubling files , save it. And pray for the best.

Apparently disabling compile on save also fixes the issue (I assume it will still compile when you run)

And otherwise if you clear the cache, I don't think much will go wrong if you just rename the cache folder to cache_old so it's easy to put back.
  • 0

#3 gregwarner

gregwarner

    Obi Wan of Programming

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1586 posts
  • Location:Arkansas
  • Programming Language:C, Java, C++, C#, PHP, Transact-SQL

Posted 27 April 2012 - 07:17 AM

Lol, well now it's acting like it can't find any of my xml resource files that it had no trouble finding two days ago. Literally nothing about the resource files have changed. Not the files themselves nor the code reading them. But now getResource("file/path") returns null instead of a URL.

I'm about two seconds away from rage deleting Netbeans and migrating to Eclipse.
  • 1

ti-99-sig.png
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid


#4 lethalwire

lethalwire

    while(false){ ... }

  • Senior Member
  • PipPipPipPipPipPip
  • 766 posts
  • Programming Language:C, Java, PHP, JavaScript
  • Learning:PHP

Posted 27 April 2012 - 07:26 AM

Are you using netbeans for the GUI editing capabilities?
  • 0

#5 gregwarner

gregwarner

    Obi Wan of Programming

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1586 posts
  • Location:Arkansas
  • Programming Language:C, Java, C++, C#, PHP, Transact-SQL

Posted 27 April 2012 - 07:31 AM

Not specifically. I do use Matisse quite a bit for rapid and rough form design. Plus, all my code is written in Swing. It would just be a hassle to migrate all of this to Eclipse and still be able to open my forms in the visual editor.

Basically I just flipped a coin way back when and decided to start with Netbeans over Eclipse. That was back before all these Netbeans bugs started cropping up. Since then, I've been getting increasingly frustrated with Netbeans... The code auto-completion and pop-up javadoc functionality is getting slower and slower and more sluggish with each version update, in addition to the code auto-complete sometimes ignoring what I type and replacing everything I've typed with some totally random not-even-close word.
  • 0

ti-99-sig.png
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid


#6 lethalwire

lethalwire

    while(false){ ... }

  • Senior Member
  • PipPipPipPipPipPip
  • 766 posts
  • Programming Language:C, Java, PHP, JavaScript
  • Learning:PHP

Posted 27 April 2012 - 07:51 AM

There are several plugins for Eclipse that are gui builders.

https://developers.g...ev-tools/wbpro/

Plus all of the other features/plugins you can get with eclipse.
I'm pretty sure anything you use in Netbeans is most likely in Eclipse or in a plugin.

I wouldn't go to Eclipse for speed though, but sometimes it can also be a tad sluggish. As far as javadoc and auto-completion, it works well for me and isn't slow.
  • 0

#7 gregwarner

gregwarner

    Obi Wan of Programming

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1586 posts
  • Location:Arkansas
  • Programming Language:C, Java, C++, C#, PHP, Transact-SQL

Posted 27 April 2012 - 08:37 AM

I wouldn't go to Eclipse for speed though, but sometimes it can also be a tad sluggish. As far as javadoc and auto-completion, it works well for me and isn't slow.

As this contributes to 90% of my hatred for Netbeans and frustration at work, it's seriously worth considering switching just for this.

My question is this though: All those JPanels I developed visually in Matisse in Netbeans... will I be able to directly open them up in a visual editor in Eclipse? Or is Eclipse unable to make sense of the Matisse generated code? I would like to be able to continue using my forms in another visual editor, preferably one that uses GroupLayout under the hood like Matisse does, since GroupLayout is what I use when I'm coding by hand as well, and it'd be nice to stick with something I'm used to.

I'd hate to have to rework all my forms all over again in SWT, especially this close to deadline.
  • 0

ti-99-sig.png
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid


#8 lethalwire

lethalwire

    while(false){ ... }

  • Senior Member
  • PipPipPipPipPipPip
  • 766 posts
  • Programming Language:C, Java, PHP, JavaScript
  • Learning:PHP

Posted 27 April 2012 - 10:18 AM

I have no experience moving a netbeans project to eclipse but would this be the same thing?
http://article-stack...to-eclipse.amty

It might be worth trying. If it doesn't work, you could probably just finish your project out with netbeans. Then on your next projects, begin using eclipse.
I've never used a visual editor in eclipse either... I usually just program any gui I need. I haven't really gotten to a point where I need to pop out guis/forms quickly.
  • 0

#9 gregwarner

gregwarner

    Obi Wan of Programming

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1586 posts
  • Location:Arkansas
  • Programming Language:C, Java, C++, C#, PHP, Transact-SQL

Posted 27 April 2012 - 12:44 PM

Yeah, I've read this article before. I'm somewhat familiar with importing Netbeans projects into Eclipse. However, I've never done it to a project with a visually built GUI. My only concern is with Eclipse making sense of the automatically generated code produced by Matisse.

I have no idea how Matisse works. I've read that there is some meta data stored in an XML file somewhere that it uses to produce the Swing code, but I can't remember where I read that and I've never found that XML file, so I can't confirm that. If you expand the collapsed code generated by Matisse, you'll notice it's not directly editable by default. This is to protect the code so that Matisse can always make sense of it and refactor the code properly when you change something in the visual editor. Having Eclipse translate all that Matisse generated code into something that its own visual editor can reproduce seems like a long shot at best to me.
  • 0

ti-99-sig.png
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid


#10 gregwarner

gregwarner

    Obi Wan of Programming

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1586 posts
  • Location:Arkansas
  • Programming Language:C, Java, C++, C#, PHP, Transact-SQL

Posted 30 April 2012 - 12:49 PM

Just as a point of interest, I finally got my project working again. Deleting the Netbeans cache wasn't enough. Doing that caused it to stop copying some XML resource files into the output jar on build.

What I decided to do was save a copy of my source files, then completely delete the project. After deleting the project, I cleared Netbeans' cache one more time, then created a new empty project from the project menu and named it the exact same as my old one. Then, I copied only my source files from my backup into this new project and it finally worked.

I'm seriously tired of Netbeans' bugs. But, at least it saves me the trouble of migrating my entire project over to Eclipse.
  • 0

ti-99-sig.png
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid






Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download