• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Netbeans silently failing to compile *some* java classes. But only some of them.

 
Ranch Hand
Posts: 66
3
Netbeans IDE Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

So first; funny story about how I got here; if you don't want to read a funny story and you just want to read the problem description, skip this paragraph: This Monday I scheduled a meeting with one of my company's owners to demo the new features we've added to the site over the past few months because we're hoping to release them soon. Then about 15 minutes later I had the horrible realization that there was a *huge* unaddressed issue with the features we'd added which was going to ripple through the entire program architecture and break some things which are at the heart of our web application. We hadn't noticed it before because by incredible coincidence, 90% of the time it looked like it was working perfectly even though you were technically never more than a few clicks away from a 500 error or some horrendously wrong data showing up on the screen. In our database, a formerly one-to-one relationship (which was built on some assumptions about the data in multiple fields instead of an actual unique key) had been turned into a many-to-many. So we had a couple tens of thousands of rows in a database that needed to be associated with each other, and when I saw how they used to be associated I wasn't even sure it would be *possible* to put the puzzle pieces back together. So panic panic panic, the next day I spent from 8:30 to 1:30 PM figuring out how to knit the data back together, which involved writing a new java program to run a stupidly weird query for every row in the database to find the associated rows and set the values of two new columns in the database, then I spent from 1:30 to 12:30 AM adjusting all the code that used that table so it would use the new field and insert the right stuff into it on save, and chasing the ripple of this architecture change through the entire project.

Then at 12:30 AM, when I was finally ready to deploy the project to the live test server so the upper management people could use it during the demo the next day, it suddenly started throwing servlet exceptions every time I went to a certain page on the site, complaining that it couldn't find a class file which it totally should have been able to find, and my console started filling up with a horrifying endlessly cascading error message about a jsp associated with a completely different project which was not just "not running at the time", but had been undeployed, closed in netbeans, and deleted from the server and my netbeans projects folder hours ago. Why it suddenly decided to resurrect it and try to look at that jsp, I have no idea, but apparently something caused an issue in my tomcat server *and* in a totally unrelated error, netbeans stopped compiling class files correctly. It compiles most of them, but there's a few files which, when I compile my project and look in the build folder, are just totally missing. So around 12:30 AM yesterday I'm figuratively running around like a headless chicken trying to figure out why my compiler suddenly hates me, I haven't taken a break since 8:30 AM, and I'm about ready to shatter the windows with computer equipment and ask for my job back at Max and Erma's. But not really since I was slowly going nuts when I worked there and not getting paid nearly as much.

Yet, in spite of the story I just recounted, this is not urgent anymore. I am still sane and my windows are intact. I threw the code into another computer, compiled it there, and it built just fine, so the code itself is not the issue, and I was able to use the build produced by *that* computer to deploy to the live test server, and the demo went great. Also I have a laptop and a desktop, and only the laptop's environment is totally screwed up, so I can still do work on the desktop if need be but I'd really prefer to have a working environment on both of these machines.

SO. The actual error being thrown in the console reads as follows:

Jan 28, 2016 11:06:29 AM org.apache.struts.action.RequestProcessor processActionCreate
SEVERE: No action instance for path /<TheActionPath> could be created
java.lang.ClassNotFoundException: <something>.<myCompanyName>.actions.<subsetOfActions>.<TheStrutsActionUsedByTheActionPath>
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1722)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1573)
at org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.java:207)
at org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:231)
at org.apache.struts.action.RequestProcessor.processActionCreate(RequestProcessor.java:326)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:268)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)

Until you navigate to something that calls the missing class, it looks like everything is working fine. Also I've fiddled with the server and undeployed and redeployed contexts, looked for memory leaks, found and fixed memory leaks, and I think anything that was wrong with the server itself is fine now, but there's definitely still something wrong with netbeans. But it must be a related problem somehow because fiddling with the server had an effect on netbeans' behavior. Earlier, netbeans was failing to compile a java class that made a struts tag. Now it's failing to compile a different java class that makes a struts action. At some point it was also failing to compile an object factory class which didn't use anything from the struts library, so sadly I don't think we can assume it's a problem with something in struts. What's even stranger is there don't seem to be any errors thrown in the netbeans console during build; if I hit clean and build, Netbeans gets all proud of itself on and says "I did it!", then I go look at the build folder and stuff is missing, and I want to tell Netbeans but I don't know how. And it seems so please with itself I hardly have the heart to tell it even if I did know how.

So this is where I'm at now. I haven't been able to find a pattern in the files it fails to compile, but I do know that the files it fails to compile are consistent between build attempts, and somehow, changing things in the tomcat environment has an influence on *which* files it fails to compile.
 
Rancher
Posts: 1093
29
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So everything works well on a different box, and this box is the problem. Hopefully that understanding is correct because everything I say from this point is based on it.

You have 2 paths you can follow here:

1--say "man this is mess" and nuke it, then start over.
2--try to track down every where in the background support files that things are corrupted and individually solve their problems.

I always prefer option 1 when I find myself in a situation like you have explained, so here is what I suggest:

1--you obviously have the project files safe and on a different computer, since you transferred them to another box and compiled the project for the demo. Check and make sure they are indeed safe and you can reinstall them to your screwball box again soon.
2--uninstall NetBeans from your screwball box.
3--delete the project from the screwball box.
4--reboot.
5--download CCleaner, it is a free ware utility from the web, and install it on the screwball box.
6--run CCleaner and let it remove any and all temporary files.
7--do the registry cleaner in CCleaner and let it repair or remove ALL registry errors. Do not bother saving these as you do not want them ever to be restored back to your box.
8--do #7 until ALL registry errors are cleaned and you no longer have any show up when the registry scan is done.
9--reboot.
10--install a clean copy of NetBeans
11--reinstall your project.

I would suggest you save off all your data and projects before starting this, as your screwball box my be further down the road of corruption than anyone may think and you may need to go to step #12

12--still does not work, then nuke the box by reinstalling you OS and programs back to factory settings.
13--start over at #4 through #11

Good luck. I've been a computer programmer now for over 25 years and my boxes usually get messed up enough every year and a half to 2 years that they have to be completely wiped and restored. It's a harsh path, but I have found it is actually the quickest, and it is definitely the most sure solution.

Les
 
Alex Lieb
Ranch Hand
Posts: 66
3
Netbeans IDE Notepad Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alright... I was afraid of that. I've replaced my tomcat, and netbeans still doesn't compile the stuff correctly, but when I change tomcat environment things, it *does* have an influence on *how* java fails. So I suspect this is some kind of issue in netbeans, but it's an issue which relates to the tomcat configuration. I was hoping I wouldn't have to go this far, but I think I will go ahead and back up my Netbeans Projects folder, then nuke netbeans and do a clean install of it. I'm wary of using any free PC cleaner-type software on a work box, and also CCleaner appears to be a windows thing and I'm running this on a Linux box, but I'm hoping doing a clean reinstall will overwrite any bad registry information associated with netbeans. I think I'll also grab a new copy of tomcat to go with my new netbeans.

Thanks!
 
Alex Lieb
Ranch Hand
Posts: 66
3
Netbeans IDE Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Reinstalling those did not work, and I really don't want to nuke everything, so I kept searching, and several hours later, after combing through a lot of logs and messing with a lot of build settings, I discovered that it IS building the files correctly, but the reason I don't see them in the Netbeans Projects build folder for the project is when you deploy your project, it deletes the file! If you run the clean/build first, then deploy in a separate step, you can watch the file disappear in your file browser. There's 2 files which are present after compile, but are deleted when I deploy. When I started googling for *that* error google suddenly became much more helpful:

https://forums.netbeans.org/topic19798.html

This is *exactly* the problem I'm having. Unfortunately the answers here don't seem to indicate why exactly it's happening, but there's a few proposed solutions here... So I'll try those. Apparently this used to be a relatively common bug in Netbeans 6.x. I'm running Netbeans 8.0.2, but it sounds like exactly the same problem, so I'm hoping the fixes they tried will still work.
 
Alex Lieb
Ranch Hand
Posts: 66
3
Netbeans IDE Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So it's fixed now. I went into project properties, and under "Sources" changed "Source/Binary Format" to JDK 6, hit "OK", then went and changed it back to 7. It builds and deploys correctly now. Something was reset. Somewhere.
 
Any sufficiently advanced technology will be used as a cat toy. And this tiny ad contains a very small cat:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic