This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 69934 - run project can't find main class
Summary: run project can't find main class
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-06 12:17 UTC by bartvdc
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
log file (13.90 KB, text/plain)
2005-12-06 12:20 UTC, bartvdc
Details
errors loading the form (450.84 KB, image/jpeg)
2005-12-07 08:13 UTC, bartvdc
Details
open properties, click OK (417.09 KB, image/jpeg)
2005-12-07 08:14 UTC, bartvdc
Details
recovered form after reopening (307.75 KB, image/jpeg)
2005-12-07 08:15 UTC, bartvdc
Details
log with errors after gui problem (33.20 KB, text/plain)
2005-12-07 11:26 UTC, bartvdc
Details
screenshot reference probs (82.29 KB, image/jpeg)
2005-12-12 12:25 UTC, bartvdc
Details
messages.log (135.54 KB, text/plain)
2006-09-04 14:30 UTC, fjsfjsfjs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bartvdc 2005-12-06 12:17:26 UTC
Using NB Daily 200511271900.
If I try to run a project, NB says it can't find the main class (witch is 
set).I build the project, still nothing. I open the project properties, play 
with the libraries(move up, move down), click OK and now the project runs.
It does not happen always, but regurarly.
This is only one example. The same case for java files that won't run or 
compile single. In the project window context menu compile and run are 
disabled and the editor beeps when using F9. Do the same trick with the 
libraries and it's fixed.
Next : Libraries that are lost. When building NB can't find some libraries. 
After the trick it works.

Tried to upgrade to the last Qbuild but there I can't use my own beans in the 
gui builder. The message says it can't find the bean in the libraries.

My userdir survived some upgrades, probably all will go fine when recreating a 
new one. But I don't have the time to do it now
Comment 1 bartvdc 2005-12-06 12:20:41 UTC
Created attachment 27585 [details]
log file
Comment 2 bartvdc 2005-12-07 08:10:12 UTC
Another example.(see screenshots)
A form that gives errors when going in design mode. Open the properties, push 
OK, reopen the form, all OK. 
Comment 3 bartvdc 2005-12-07 08:13:47 UTC
Created attachment 27606 [details]
errors loading the form
Comment 4 bartvdc 2005-12-07 08:14:42 UTC
Created attachment 27607 [details]
open properties, click OK
Comment 5 bartvdc 2005-12-07 08:15:45 UTC
Created attachment 27608 [details]
recovered form after reopening
Comment 6 bartvdc 2005-12-07 09:04:45 UTC
Correction to the first remark. I don't have to rearrange the libs, just 
opening the properties and click OK is enough.
Comment 7 Milan Kubec 2005-12-07 09:11:15 UTC
What kind of project are you using?
Comment 8 bartvdc 2005-12-07 09:14:30 UTC
Plain J2SE projects, created from existing sources.
Comment 9 giorgio42 2005-12-07 10:21:21 UTC
I have read your posting to the nbusers list and just want to say, that you are
not alone. I had exactly the same problem with Q-builds and daily builds.

Until now the problem has not occurred with NB5Beta2, which I am now using.
Comment 10 Milan Kubec 2005-12-07 10:30:46 UTC
giorgio42, what project are you using? Also J2SE Project with existing sources?
Comment 11 Milan Kubec 2005-12-07 10:55:46 UTC
Guys, we will need help from you. I tried to reproduce the issue, but I'm not
succesful. Please describe step by step what are you doing, how do you set up
the project, dependencies, etc. Don't forget any detail. Thanks.
Comment 12 bartvdc 2005-12-07 11:25:12 UTC
I don't have to produce steps to get the problem (lucky me).
I'll attach my log file again. There are some errors logged after the gui 
problem. At startup there are also some warnings.
What is behind the OK button in the properties window that repairs the 
behavior? Should there be a change in a file that keeps the state of the 
project ?  

Comment 13 bartvdc 2005-12-07 11:26:24 UTC
Created attachment 27623 [details]
log with errors after gui problem
Comment 14 Tomas Zezula 2005-12-09 16:29:23 UTC
Please try to delete the userdir, if it helps. It seems that the file you tries
to run or compile is not under the source root. Either source roots are invalid
or FileUtil.isParentOf () returns wrong value.

Does it happen only after IDE start (or project open) or does it happen also
when the project was already opened in the ide and worked fine?
If you fix it by opening customizer does it appear again in the same IDE run?

It may be related to the warning from getNormalizedFile ().
Comment 15 Tomas Zezula 2005-12-09 16:49:55 UTC
One more question.
The problems with forms may be duplicate to fixed issue #69744. Are the not
found classes eg: be.mil.cccis.client.process.organisation.common.DirectorPanel
from projects which are rebuilt or from archives which may be deleted and recreated?
Comment 16 Tomas Zezula 2005-12-09 17:44:13 UTC
What is the
D:\Workspace\Development\Gp_MRJava\SELECT\implementation\src\unit-test\server\be\mil\application\energyinvoice\ate:
`EnergyInvoiceBusinessFacadeBeanTest.java' file for and how it was created? It
cantains illegal character :
Comment 17 bartvdc 2005-12-11 20:14:07 UTC
Just a quick reply
energyinvoice\ate:
`EnergyInvoiceBusinessFacadeBeanTest.java' 
The "ate:" is not existing, too much in the path, energyInvoice is the last 
package name.

The DirectorPanel is a panel in the same project. It subclasses a panel in a 
library (the gui framework).

Does it happen only after IDE start (or project open) or does it happen also
when the project was already opened in the ide and worked fine? 
No,yes , it happens all the time , even on projects I am working on (I know 
for sure for the form problem).
For the unrecognized main class or java files, I notice it when switching 
between open projects.
If you fix it by opening customizer does it appear again in the same IDE run? 
Yes.


I'll do some more tests tomorrow.


 

Comment 18 bartvdc 2005-12-12 12:23:25 UTC
Tried with an almost fresh userdir. Kept just the config folder in it without 
the windows2Local.
All the projects complain for reference problems while they have the 
libraries.Even after removing and readding the library from the project See 
screenshot.
What do I have to delete to start up without open projects?

Bart
Comment 19 bartvdc 2005-12-12 12:25:03 UTC
Created attachment 27736 [details]
screenshot reference probs
Comment 20 Tomas Zezula 2005-12-12 17:01:11 UTC
To solve the problem with broken references you have to delete:
${nb_user_dir}/build.properties 
${nb_user_dir}/config/org-netbeans-api-project-libraries/libraries-timestamps.properties

To start with no open project you have to delete also:
${nb_user_dir}/config/Services/org-netbeans-modules-project-ui-OpenProjectList.settings
Comment 21 Tomas Zezula 2005-12-12 17:07:54 UTC
It is also important to delete the 
${nb_user_dir}/var folder, it may contain some wrong data
Comment 22 Tomas Zezula 2005-12-12 17:16:40 UTC
Can you try to reproduce it with Daily build from today?
There was an issue regarding classpath refresh when a library project was on the
classpath. The issue is already fixed in this build.

Comment 23 bartvdc 2005-12-13 09:39:25 UTC
Tried 200512111900 for an half hour now and did not find any of the problems. 
Also the problem I had with my own GUI beans in the latest Q build are gone.
I deleted the userDir folders you mentioned, except the open projects file.

Thanks,

Bart
Comment 24 Tomas Zezula 2005-12-13 13:42:40 UTC
Thanks for your help.
Comment 25 bartvdc 2006-02-07 15:12:39 UTC
I get the same problem again in the final release 5.0 with a cleaned up 
userDir. Forgotten something ?

Bart
Comment 26 Tomas Zezula 2006-02-10 08:11:40 UTC
This j2seproject uses javacore to find all main classes. It sometimes does not work.
To reporter: Can you try to delete the ${nb_user_dir}/var folder if it helps?
Comment 27 bartvdc 2006-02-20 07:20:56 UTC
It seems to work with the cleaned up var folder, the problem don't comes back.
I did start without the var folder, so it appears when something conflicts in 
the var folder. 
Comment 28 fjsfjsfjs 2006-09-04 14:26:57 UTC
I have the same problems. When running the project, the "Select the main class"
window pops up, saying its initializing. It keeps in this state forever.
Attaching log file...
Comment 29 fjsfjsfjs 2006-09-04 14:30:28 UTC
Created attachment 33560 [details]
messages.log
Comment 30 Jan Becicka 2006-10-26 16:27:55 UTC
Javacore module was replaced by Retouche infrastructure. This bug is not valid
in trunk any more.
Comment 31 Quality Engineering 2007-09-20 09:55:16 UTC
Reorganization of java component