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 44768 - WebApp with a library throws exceptions
Summary: WebApp with a library throws exceptions
Status: CLOSED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P1 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords:
: 44907 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-06-11 13:52 UTC by zikmund
Modified: 2007-04-03 18:02 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
java.lang.NullPointerException (521 bytes, text/plain)
2004-06-11 13:52 UTC, zikmund
Details
java.lang.RuntimeException (1.21 KB, text/plain)
2004-06-11 13:54 UTC, zikmund
Details
org.netbeans.mdr.persistence.StorageBadRequestException (2.67 KB, text/plain)
2004-06-14 10:25 UTC, zikmund
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zikmund 2004-06-11 13:52:05 UTC
Build 200406101800

How to reproduce:
1) Create new WebApp project (J2SE works fine)
2) Create new J2SE library
3) Add dependepcy of WebApp of the Library
more detailed:
a) select WebApp project -> context menu -> Properties
b) Build|Compiling Sources|Add Project
c) Browse the created library
4) EXCEPTION
java.lang.NullPointerException - see attachment #1 [details]
5) Close library project
6) select WebApp project -> context menu -> Open
Required Projects
7) EXCEPTION
java.lang.RuntimeException - see attachment #2 [details]
8) Copy some sources to both projects
9) Compile them - OK
10) Invoke any code completion (even on java
libraries)
11) EXCEPTION
org.netbeans.mdr.persistence.StorageBadRequestException
- see attachment #3 [details]

Setting to P1 because no any chance how to work
with real projects (using code completion etc.)
Comment 1 zikmund 2004-06-11 13:52:47 UTC
Created attachment 15655 [details]
java.lang.NullPointerException
Comment 2 zikmund 2004-06-11 13:54:08 UTC
Created attachment 15656 [details]
java.lang.RuntimeException
Comment 3 Jesse Glick 2004-06-11 19:11:58 UTC
Probably a bug in refactoring code, but assigning to web apps for
initial evaluation to see if this is reproducible etc.
Comment 4 Pavel Buzek 2004-06-11 23:11:46 UTC
On my build (co from cvs and built myself today) I can reproduce the
first EX but does not seem to do any harm. Even w/o compilation code
completion in web app offers a class I created in java library.

Does not look like anything in web apps. Refactoring please evaluate
and probably downgrade to P2 or P3.
Comment 5 zikmund 2004-06-14 10:25:24 UTC
Created attachment 15675 [details]
org.netbeans.mdr.persistence.StorageBadRequestException
Comment 6 psuk 2004-06-16 11:42:58 UTC
Similar stacktrace is in Issue 44907
java.lang.NullPointerException
org.netbeans.modules.javacore.JMManager.cleanUpCodebases(JMManager.java:675)
org.netbeans.modules.javacore.JMManager.access$200(JMManager.java:59)
Comment 7 psuk 2004-06-16 11:44:47 UTC
*** Issue 44907 has been marked as a duplicate of this issue. ***
Comment 8 psuk 2004-06-16 12:35:21 UTC
First NPE is 100% reproducible [build from CVS 20040616].
(JMManager.java:675)

Evaluation:
1. this.classPath.getRoots returns null
   (which would never happen, according to javadoc in ClassPath.getRoots)
2. roots.length causes the exception

Questions to ask:
Q1: Why cleanUpCodebases is called at all, if we are adding a library
Q2: Why ClassPath.getRoots returns null
Comment 9 Martin Matula 2004-06-16 14:08:49 UTC
This is due to a race condition in the ClassPath implementation.
Reassigning to Tomas Zezula...
Comment 10 Tomas Zezula 2004-06-16 14:34:48 UTC
Checking in ClassPath.java;
/cvs/java/api/src/org/netbeans/api/java/classpath/ClassPath.java,v 
<--  ClassPath.java
new revision: 1.21; previous revision: 1.20
done
Comment 11 psuk 2004-06-16 17:55:10 UTC
It works now. No NPE.
Comment 12 zikmund 2004-06-22 09:47:13 UTC
Verified.