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 114697 - NPE: Build failed redeploying Visual Web Project
Summary: NPE: Build failed redeploying Visual Web Project
Status: VERIFIED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Sun Appserver 9 (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Vince Kraemer
URL:
Keywords: RANDOM, RELNOTE
: 115093 115795 116358 116604 116638 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-09-04 23:59 UTC by _ krystyna
Modified: 2007-10-01 08:27 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Server log (14.23 KB, application/octet-stream)
2007-09-05 00:01 UTC, _ krystyna
Details
IDE messages.log (60.39 KB, application/octet-stream)
2007-09-05 00:01 UTC, _ krystyna
Details
VWP ee5 project (24.99 KB, application/octet-stream)
2007-09-05 18:42 UTC, _ krystyna
Details
j2eeserver module with additional logging (808.45 KB, application/octet-stream)
2007-09-06 17:38 UTC, Petr Hejl
Details
IDE log with replaced jar (48.53 KB, application/octet-stream)
2007-09-06 17:48 UTC, Andrey Yamkovoy
Details
IDE log with replaced jar (48.53 KB, text/plain)
2007-09-06 17:48 UTC, Andrey Yamkovoy
Details
patched jar for beta 1 users (916.26 KB, application/octet-stream)
2007-09-18 17:38 UTC, Vince Kraemer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ krystyna 2007-09-04 23:59:53 UTC
Netbeans Beta 1(Build 200709041200) 
Java: 1.6.0_01;
WinXP
Glassfish V2 b58d


-Third (incremental) deployment of a j2ee1.5 project ended with a "build failed, check server log"


C:\Documents and Settings\Krystyna Polomski\My Documents\NetBeansProjects\WebApplication441\nbproject\build-
impl.xml:562: Deployment error:
null
See the server log for details.
BUILD FAILED (total time: 0 seconds)

-Checked the server log, I saw no errors (attaching)

-Checked messages.log, saw:

java.lang.NullPointerException
        at org.netbeans.modules.j2ee.deployment.impl.TargetModule.findTarget(TargetModule.java:106)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.processLastTargetModules(TargetServer.java:339)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.init(TargetServer.java:109)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.deploy(TargetServer.java:446)
[catch] at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:126)
        at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:82)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor197.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:255)
        at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:438)
        at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:129)
INFO [org.netbeans.modules.editor.settings.storage.SettingsProvider]: Won't provide any settings for text/base It's 
been deprecated, use MimePath.EMPTY instead.
Comment 1 _ krystyna 2007-09-05 00:01:00 UTC
Created attachment 48104 [details]
Server log
Comment 2 _ krystyna 2007-09-05 00:01:56 UTC
Created attachment 48105 [details]
IDE messages.log
Comment 3 _ krystyna 2007-09-05 01:33:57 UTC
-workaround by re-starting the appserver from glassfish node in Services tab
-this is consistently reproducible on second or third incremental deployment 
-(Noting: both glassfish 58d and NB beta1 installed and run with jdk1.6.0_01)
Comment 4 Vince Kraemer 2007-09-05 17:38:04 UTC
corrected some of the entries
Comment 5 Vince Kraemer 2007-09-05 17:46:32 UTC
additional details about the project would be useful.  attaching the projects would be really useful.
Comment 6 _ krystyna 2007-09-05 18:05:02 UTC
Nothing special about the project: the simplest one page VWP ee5 project with  two or three
components on it will produce the error. No databases involved. I will prepare and attach a simple such 
project. (I had originally seen this issue with a 2 page navigation project.)
Comment 7 _ krystyna 2007-09-05 18:42:17 UTC
Created attachment 48188 [details]
VWP ee5 project
Comment 8 _ krystyna 2007-09-05 18:45:20 UTC
Directions: 
-open and deploy project just attached - first deployment will work ok
-drop any Basic component (or simply move one of the existing components on designer screen) 
 and re-deploy
>Build will fail
-restart glassfish and redeploy - this will work


Comment 9 Vince Kraemer 2007-09-05 19:28:05 UTC
I am able to replicate the behavior.

I am also able to get the project to successfully 'undeploy and deploy' after encountering this issue WITHOUT
restarting, which makes the issue less critical (to me).

still investigating, but I am tempted to lower the priority on this, since the w-a is to "try again"
Comment 10 Vince Kraemer 2007-09-05 20:07:55 UTC
on line 106...

either instance is null or the return value of instance.getServerTarget(targetName) is null...

a null check might be useful somewhere in findTarget()...
Comment 11 _ krystyna 2007-09-05 21:23:14 UTC
-Note: Duplicated this on Solaris 10. beta 1 09050000 build. Took two re-deploys to recover.
Comment 12 Petr Hejl 2007-09-05 21:47:42 UTC
I'm unable to reproduce on this configuration:

Linux 2.6.20-16-generic
jdk 1.5.0_11
Glassfish V2 b58d
NetBeans cvs build
Comment 13 Petr Hejl 2007-09-05 22:11:35 UTC
I'm unable to reproduce even on this configuration:

Linux 2.6.20-16-generic
jdk 1.6.0_00
Glassfish V2 b58d
NetBeans cvs build

Are there any specific steps not mentioned in desc9? I'm using "undeploy and deploy" from context menu, after making
change in the jsp page.
Comment 14 Vince Kraemer 2007-09-05 22:29:50 UTC
I had figured this was a windows only type of issue...  a strange case of the file locking issues.   if this is
happening in other contexts, that is good news... Since I have lots of Unix based builds and do not have an machine
configured to do NetBeans development that is running Windows....
Comment 15 _ krystyna 2007-09-05 22:44:06 UTC
-I am working within a VWP project environment which you can open and use to deploy.
 Important, I am not undeploying. I am only doing deployment and re-deployment (what is
 known as incremental deployment) via toolbar Green arrow. It does not require an undeploy action.
 After project is initially deployed, make a change to the project, and press green arrow to
 deploy again.  
Comment 16 Petr Hejl 2007-09-06 09:59:12 UTC
Now I am able to reproduce (on linux) - well just in a few cases. For me there does not exist reliable scenario to
reproduce. Even in the case it fails the next deployment will pass. I think we should consider lowering priority to P3
(with further investigation).
Comment 17 Andrey Yamkovoy 2007-09-06 16:36:56 UTC
I am able to reproduce this issue with NB full 200709060000 and AS b58f-fcs on the WinXP.
For me the deployment does not work in 9 of 10 cases for all types of projects (WebApp, EJB ...).
Moreover it reproducible even for the empty WebApp project just created from wizard and not changed.

Comment 18 Petr Hejl 2007-09-06 17:36:34 UTC
I prepared modified j2ee plugin with some additional logging. Andrey, please copy it to enterprise4/modules directory
(replacing the original one). After that please run netbeans with additional parameter
-J-Dorg.netbeans.modules.j2ee.deployment.level=0. Try to reproduce the exception and upload the file
var/log/messages.log from the userdir. At least this should help us to find which variable is null.
Comment 19 Petr Hejl 2007-09-06 17:38:04 UTC
Created attachment 48302 [details]
j2eeserver module with additional logging
Comment 20 Andrey Yamkovoy 2007-09-06 17:46:58 UTC
I downloaded and installed the latest NB 200709060000 with the bundled AS and reproduced this issue with your jar.
See attached IDE log.
Comment 21 Andrey Yamkovoy 2007-09-06 17:48:39 UTC
Created attachment 48305 [details]
IDE log with replaced jar
Comment 22 Andrey Yamkovoy 2007-09-06 17:48:49 UTC
Created attachment 48307 [details]
IDE log with replaced jar
Comment 23 Andrey Yamkovoy 2007-09-06 17:52:54 UTC
So, now I reproduced this issue on the different 2 PCs (WinXP on both) and different AS versions.
Comment 24 Petr Hejl 2007-09-06 21:20:25 UTC
I've just add some more logging and I was lucky with reproduction (once). Here is the interesting fragment:

FINER [org.netbeans.modules.j2ee.deployment.impl.TargetServer]: Instance URL:
[/home/sickboy/servers/glassfishv2b58d]deployer:Sun:AppServer::localhost:4848
FINER [org.netbeans.modules.j2ee.deployment.impl.TargetServer]: IDE deployed module:
[/home/sickboy/servers/glassfishv2b58d]deployer:Sun:AppServer::localhost:4848
FINER [org.netbeans.modules.j2ee.deployment.impl.TargetServer]: IDE deployed module name: server
FINER [org.netbeans.modules.j2ee.deployment.impl.TargetServer]: Available modules ids from server 0
FINER [org.netbeans.modules.j2ee.deployment.impl.TargetServer]: Map does not contain WebApplication454_localhost:4848_server
FINER [org.netbeans.modules.j2ee.deployment.impl.TargetModule]: Finding target
FINER [org.netbeans.modules.j2ee.deployment.impl.TargetModule]: Instance is GlassFish V2
FINER [org.netbeans.modules.j2ee.deployment.impl.ServerInstance]: Getting ServerTarget for server
FINER [org.netbeans.modules.j2ee.deployment.impl.ServerInstance]: Called getTargetMap() by exec_null_3 at 1189109044722
FINER [org.netbeans.modules.j2ee.deployment.impl.ServerInstance]: Fresh targets fetched from server, its count is 0
FINER [org.netbeans.modules.j2ee.deployment.impl.ServerInstance]: Updating target map with new one with size 0
FINER [org.netbeans.modules.j2ee.deployment.impl.TargetModule]: Target is null
INFO [global]
java.lang.NullPointerException
	at org.netbeans.modules.j2ee.deployment.impl.TargetModule.findTarget(TargetModule.java:112)
	at org.netbeans.modules.j2ee.deployment.impl.TargetServer.processLastTargetModules(TargetServer.java:367)
	at org.netbeans.modules.j2ee.deployment.impl.TargetServer.init(TargetServer.java:112)
	at org.netbeans.modules.j2ee.deployment.impl.TargetServer.deploy(TargetServer.java:474)
[catch] at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:126)
	at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:82)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
	at sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:357)
	at org.apache.tools.ant.Target.performTasks(Target.java:385)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
	at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:255)
	at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:438)
	at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:129)

Note the lines:
FINER [org.netbeans.modules.j2ee.deployment.impl.TargetServer]: Available modules ids from server 0
and
FINER [org.netbeans.modules.j2ee.deployment.impl.ServerInstance]: Fresh targets fetched from server, its count is 0

Considering this it seems to be some strange situation when the appserver plugin returns empty array when requesting
getAvailableModules(). Consequently it even returns empty list of targets (call to getTargets()) - and because the list
of targets is empty it does not contain the intended target for deployment -> NPE.

Could be some synchronization issue in appserver plugin, j2ee server or both.

Vince, may be you could trace what is happening inside the appserver plugin in this situation?
Comment 25 Vince Kraemer 2007-09-07 00:36:17 UTC
it looks like this is related changes for issue 102770

I am testing changes that resolve this side-effect, but preserves the fix to 102770.
Comment 26 Vince Kraemer 2007-09-07 20:37:08 UTC
need to synchronize around access to secureStatusHasBeenChecked
Comment 28 Petr Hejl 2007-09-09 18:28:35 UTC
*** Issue 115093 has been marked as a duplicate of this issue. ***
Comment 29 Petr Hejl 2007-09-10 09:44:18 UTC
Krystyna, andrey, please can you verify the solution?
Comment 30 _ krystyna 2007-09-10 23:30:18 UTC
Verified FIXED in trunk build with VWP 1.4 and 1.5 type projects.
For beta1, we should note that issue is fixed in the trunk/beta2.

NetBeans IDE Dev (Build 070910) Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b02 System: Windows XP version 5.1 
running on x86; Cp1252; en_US (nb). Glassfish - v2 (b58g)
Comment 31 Petr Blaha 2007-09-18 09:01:30 UTC
*** Issue 115795 has been marked as a duplicate of this issue. ***
Comment 32 vanob 2007-09-18 10:28:51 UTC
It would be great to post a binary patch for this issue.
I guess beta 2 will be released after a month, so people who
work on enterprise projects will be frustrated. It's really time consuming
to restart server every time you need to deploy ear.
Comment 33 brettbergquist 2007-09-18 12:49:56 UTC
I agree with the last comment.  This one bug will stop me from even starting to use NB 6.0 Beta 1.  I guess I will just
have to stick with the daily builds :(
Comment 34 Vince Kraemer 2007-09-18 17:38:45 UTC
Created attachment 49004 [details]
patched jar for beta 1 users
Comment 35 Petr Hejl 2007-09-21 19:06:03 UTC
*** Issue 116358 has been marked as a duplicate of this issue. ***
Comment 36 Petr Hejl 2007-10-01 08:25:23 UTC
*** Issue 116604 has been marked as a duplicate of this issue. ***
Comment 37 Petr Hejl 2007-10-01 08:27:41 UTC
*** Issue 116638 has been marked as a duplicate of this issue. ***