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 131920 - Unable to open visual page when using the server library
Summary: Unable to open visual page when using the server library
Status: CLOSED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: visualweb (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: _ sandipchitale
URL:
Keywords:
: 132043 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-04-03 12:46 UTC by Petr Hejl
Modified: 2008-04-08 17:19 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
proposed patch (1.50 KB, text/plain)
2008-04-03 13:00 UTC, Petr Hejl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Hejl 2008-04-03 12:46:15 UTC
1) create visual web project with following options checked
"Use dedicated folder for storing libraries"
"Use dedicated library folder for server JAR files"
2) NPE

java.lang.NullPointerException
	at org.netbeans.modules.visualweb.insync.ModelSet.getProjectClassLoader(ModelSet.java:468)
	at org.netbeans.modules.visualweb.insync.ModelSet.<init>(ModelSet.java:339)
	at org.netbeans.modules.visualweb.insync.models.FacesModelSet.<init>(FacesModelSet.java:410)
Caused: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
	at org.netbeans.modules.visualweb.insync.ModelSet.createInstance(ModelSet.java:263)
Caused: java.lang.RuntimeException
	at org.netbeans.modules.visualweb.insync.ModelSet.createInstance(ModelSet.java:267)
	at org.netbeans.modules.visualweb.insync.ModelSet.getInstance(ModelSet.java:248)
	at org.netbeans.modules.visualweb.insync.ModelSet$1.run(ModelSet.java:215)
[catch] at java.lang.Thread.run(Thread.java:595)
Comment 1 Petr Hejl 2008-04-03 13:00:41 UTC
Created attachment 59610 [details]
proposed patch
Comment 2 _ potingwu 2008-04-03 19:10:07 UTC
It happened even on regular web project without using the server library (i.e., non-shared libraries). To reproduce,

Install Portal Pack by going to Portal Pack download page (http://portalpack.netbeans.org/nb6/download.html), and
install the following 3:
    Portal-pack-plugin-2_0_Beta 3.zip
    Visual Portlet Builder Beta
    JSF Portlet Bridge Library

Steps to reproduce:
1. Create a simple web project without any framework
2. Right click on Web Pages and select New->JSF Portlet Page

Then you will see an empty designer with the same exceptions.
Comment 3 _ krystyna 2008-04-03 20:50:21 UTC
Is this the 6.1 branch because I am not seeing this on
installer 6.1: NetBeans IDE Dev (Build 200804030815)
Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19
System: Windows XP version 5.1



Comment 4 _ krystyna 2008-04-03 21:09:17 UTC
Reproduced. I see it now - got a hold of a later 6.1 installer build:
NetBeans IDE Dev (Build 200804031432)
Comment 5 _ krystyna 2008-04-03 21:15:01 UTC
And with a clean userdir, I cannot even create a plain VW project without getting the NPE.
This should not have passed sanity test.
Comment 6 _ sandipchitale 2008-04-03 21:26:08 UTC
Looks like the patch works.
Comment 7 _ sandipchitale 2008-04-03 22:10:08 UTC
This is really a P1 as no Visualweb projects can be created.
Comment 8 _ sandipchitale 2008-04-03 22:15:06 UTC
Fixed in trunk. Waiting for review to commit and push to release61 branch.

changeset:   77201:583b3aa651e5
tag:         tip
user:        Sandip V. Chitale <sandipchitale@netbeans.org>
date:        Thu Apr 03 14:08:51 2008 -0700
summary:     Bug Fix # 131920 Unable to open visual page when using the server library

diff -r 116c526e7461 -r 583b3aa651e5 visualweb.insync/src/org/netbeans/modules/visualweb/insync/ModelSet.java
--- a/visualweb.insync/src/org/netbeans/modules/visualweb/insync/ModelSet.java  Thu Apr 03 17:41:59 2008 +0200
+++ b/visualweb.insync/src/org/netbeans/modules/visualweb/insync/ModelSet.java  Thu Apr 03 14:08:51 2008 -0700
@@ -464,10 +464,14 @@ public abstract class ModelSet implement
                 String[] j2eeJars = JsfProjectUtils.getJ2eeClasspathEntries(project);
                 for (String j2eeJar : j2eeJars) {
                     for (URL url : urls) {
-                        File file = FileUtil.toFile(URLMapper.findFileObject(url));
-                        if (j2eeJar.equals(file.getPath())) {
-                            urlSet.remove(url);
-                            break;
+                        URL fileURL = FileUtil.getArchiveFile(url);
+                        FileObject fileObj = URLMapper.findFileObject(fileURL != null ? fileURL : url);
+                        if (fileObj != null) {
+                            File file = FileUtil.toFile(fileObj);
+                            if (file != null && j2eeJar.equals(file.getPath())) {
+                                urlSet.remove(url);
+                                break;
+                            }
                         }
                     }
                 }
Comment 9 _ krystyna 2008-04-04 01:26:06 UTC
Pre-integration test looks good.  Applied Sandip's jar to 
the same build which had failed earlier, NetBeans IDE Dev (Build 200804031432)

1. tested created plain VW project -- AOK - no exceptions (and deployed AOK)
2. tested created VW project  checking "use dedicated folder for storing libraries" and "use dedicated library folder 
for serverJAR files" -- AOK -- no exceptions (and deployed AOK).
3. did the same for ee1.4 VW project - all AOK
Comment 10 _ sandipchitale 2008-04-04 19:26:12 UTC
Fixed in trunk. Waiting for QE verification on trunk before integration in release61.
Comment 11 _ krystyna 2008-04-04 22:07:28 UTC
Ok. Verified in trunk build 1479 (Build 20080404174625).
Comment 12 _ sandipchitale 2008-04-05 01:12:10 UTC
Fixed in release61.

changeset:   76978:7c475078c8ad
user:        Sandip V. Chitale <sandipchitale@netbeans.org>
date:        Thu Apr 03 14:08:51 2008 -0700
summary:     Bug Fix # 131920 Unable to open visual page when using the server library
Comment 13 _ sandipchitale 2008-04-06 16:29:33 UTC
*** Issue 132043 has been marked as a duplicate of this issue. ***
Comment 14 Martin Schovanek 2008-04-07 13:10:53 UTC
Dane, please can you verify in release61?
Comment 15 Dan Kolar 2008-04-08 15:41:30 UTC
v. in release61