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 189955 - Runing file within web project runs project
Summary: Runing file within web project runs project
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 7.0
Hardware: PC Windows XP
: P1 normal (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-27 20:22 UTC by javydreamercsw
Modified: 2010-12-07 20:57 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Sample Projects 1/4 (10.00 MB, application/x-zip-compressed)
2010-08-31 14:18 UTC, javydreamercsw
Details
Sample Projects 2/4 (10.00 MB, application/octet-stream)
2010-08-31 14:19 UTC, javydreamercsw
Details
Sample Projects 3/4 (10.00 MB, application/octet-stream)
2010-08-31 14:20 UTC, javydreamercsw
Details
Sample Projects 4/4 (4.43 MB, application/x-zip-compressed)
2010-08-31 14:21 UTC, javydreamercsw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description javydreamercsw 2010-08-27 20:22:55 UTC
Runing a class within a Web project with a main method runs the project instead of the class. The same happens with shift+F6 within the class source.
Comment 1 Peter Pis 2010-08-30 07:21:06 UTC
Please evaluate.
Comment 2 David Konecny 2010-08-30 20:36:00 UTC
Works fine for me on yesterday's build: I created a fresh new Web Application project; then Java Main class in it and run it via Shift-F6 and via top menu 'Run File'.

Product Version: NetBeans IDE Dev (Build 100830-ca2c595c9d1e)
Java: 1.6.0_20; Java HotSpot(TM) Client VM 16.3-b01
System: Linux version 2.6.32-24-generic running on i386; UTF-8; en_NZ (nb)
Userdir: /home/david2010/.netbeans/_UD3
Comment 3 javydreamercsw 2010-08-31 12:01:47 UTC
Will give it a try later today.
Comment 4 javydreamercsw 2010-08-31 14:18:16 UTC
Created attachment 101776 [details]
Sample Projects 1/4
Comment 5 javydreamercsw 2010-08-31 14:19:35 UTC
Created attachment 101777 [details]
Sample Projects 2/4
Comment 6 javydreamercsw 2010-08-31 14:20:38 UTC
Created attachment 101778 [details]
Sample Projects 3/4
Comment 7 javydreamercsw 2010-08-31 14:21:10 UTC
Created attachment 101779 [details]
Sample Projects 4/4
Comment 8 David Konecny 2010-09-01 00:24:44 UTC
I cannot unzip your archive, I always get error:

Archive:  /home/david2010/Downloads/Sample Project Parts.zip
warning [/home/david2010/Downloads/Sample Project Parts.zip]:  zipfile claims to be last disk of a multi-part archive;
  attempting to process anyway, assuming all parts have been concatenated
  together in order.  Expect "errors" and warnings...true multi-part support
  doesn't exist yet (coming soon).
file #1:  bad zipfile offset (local header sig):  4
file #2:  bad zipfile offset (local header sig):  49
file #3:  bad zipfile offset (local header sig):  762
file #4:  bad zipfile offset (local header sig):  2572
[...]

I was able to extract sources but most of the libraries are missing so I cannot compile/run file. I tried Run File on several random Java files from xinco web project but message box saying that file does not have a main class nor it is servlet is shown (accidentally it is shown four times in total - will try to fix at least that.) Which file do you run? Which exact version of NB and OS/JDK you run on? You can send test projects directly at my email at david.konecny at oracle. Or I can download it from somewhere. Thx.
Comment 9 javydreamercsw 2010-09-01 18:12:15 UTC
For some reason atachments 1 and 4 point to the same file even though they show different file names in its details.

I tried again on 6.9.1 and it works. I tried in Build 20100831001 and it starts the web app. I'm running the com.bluecubs.xinco.tools.MD5.java file.

I'll send the files to the email provided in a bit.
Comment 10 javydreamercsw 2010-09-01 18:27:19 UTC
Actually I committed those files to my project's repository. Probably easier to get from there. I had issues trying to send the file via email.

https://xinco.svn.sourceforge.net/svnroot/xinco/trunk
Comment 11 David Konecny 2010-09-09 02:26:21 UTC
Thanks for the patience. I checked out your project from SVN and was able to reproduce the problem.
Comment 12 David Konecny 2010-09-09 02:27:37 UTC
c663d32468c3
Comment 13 javydreamercsw 2010-09-09 02:55:56 UTC
Glad you were able to reproduce and fix the issue. Glad to help!
Comment 14 David Konecny 2010-12-07 20:57:40 UTC
Just for record: this fix caused regression - issue 192922