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 37896 - Webmodule execution/deployment is not working
Summary: Webmodule execution/deployment is not working
Status: CLOSED WORKSFORME
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Tomcat (show other bugs)
Version: 3.x
Hardware: PC All
: P2 blocker (vote)
Assignee: Pavel Buzek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-09 14:40 UTC by Marek Fukala
Modified: 2006-06-03 23:13 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The progress dialog window screenshot (9.00 KB, image/png)
2003-12-10 09:05 UTC, Marek Fukala
Details
The part of the IDE output. (1.32 KB, text/plain)
2003-12-10 12:30 UTC, Marek Fukala
Details
List command output from manager application (611 bytes, text/plain)
2003-12-12 12:41 UTC, Marek Fukala
Details
IDE output regarding the deployment (604 bytes, text/plain)
2003-12-12 12:42 UTC, Marek Fukala
Details
The tomcat directory from user's dir (108.77 KB, text/plain)
2003-12-12 12:45 UTC, Marek Fukala
Details
The webmodule (3.17 KB, text/plain)
2003-12-12 12:46 UTC, Marek Fukala
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Fukala 2003-12-09 14:40:36 UTC
[dev #20031208]
After trying to execute/deploy a webmodule withing
the IDE the internal Tomcat starts but the
deployment fails. The progress window shows a
message about wm deployment and then shows a fail
status with message String index out of range: -1.
Comment 1 Pavel Buzek 2003-12-09 23:20:47 UTC
I cannot reproduce this exact problem BUT I see a similar one.
The deployment fails for me occasionally, but with a different error:
"No context exists for path /aaa"
It only happens for the first deployment with clean userdir and tomcat
not running.

please copy the message exactly rather then saying what it is about ;-)

also attach the jakarta-tomcat-5.0.16_base\logs\* file from your
userdir (or its relevant part) and if there are any exceptions is ide log.
Comment 2 Pavel Buzek 2003-12-10 04:42:49 UTC
after some (presumingly unrelated :-) changes in deployment this works
for me, please test and close or add info and rise again. tx.
Comment 3 Marek Fukala 2003-12-10 09:04:44 UTC
> please copy the message exactly rather then saying what it is about ;-)
That is the exact message displayed in the progress window in the
place where are status messages displayed. For those who cannot
imagine that I'm attaching a screenshot ;-)
Comment 4 Marek Fukala 2003-12-10 09:05:33 UTC
Created attachment 12492 [details]
The progress dialog window screenshot
Comment 5 Marek Fukala 2003-12-10 12:29:27 UTC
The behaviour has changed since #20031209 (I haven't investigated if
its caused by your commits or not). The problem with the 'string index
out of range' disappeard (at least I am not able to reproduce it now),
but some other problems showed up. The deployment process starts the
tomcat process, but then during the stage of webmodule deployment it
fails (signaled by the 'Failed' window name) and some debug messages
in IDE log indicates a possible problem. The IDE output regarding the
problem is attached. The tomcat log doesn't contain anything
interesting related to the problem.
Comment 6 Marek Fukala 2003-12-10 12:30:36 UTC
Created attachment 12500 [details]
The part of the IDE output.
Comment 7 Pavel Buzek 2003-12-12 01:37:38 UTC
fixed
Comment 8 Marek Fukala 2003-12-12 12:39:49 UTC
Hi Pavel,
I am affraid the functionality is still broken. I have tried last nb
build and also built an own one from latest sources without success.
The problem still seems to be the some.
I am attaching ide log output, an output from tomcat manager list
command, the very simple webmodule and also the tomcat directory from
user dir. I hope it can help. 

Please try following steps:
o run ide with a clean userdir
o mount an empty directory as a local filesystem
o convert it into wm
o 'execute' it 

the resulting outputs following these actions are attached (and
described above)

thanks
Comment 9 Marek Fukala 2003-12-12 12:41:32 UTC
Created attachment 12546 [details]
List command output from manager application
Comment 10 Marek Fukala 2003-12-12 12:42:06 UTC
Created attachment 12547 [details]
IDE output regarding the deployment
Comment 11 Marek Fukala 2003-12-12 12:45:32 UTC
Created attachment 12548 [details]
The tomcat directory from user's dir
Comment 12 Marek Fukala 2003-12-12 12:46:02 UTC
Created attachment 12549 [details]
The webmodule
Comment 13 Marek Fukala 2003-12-12 12:51:29 UTC
raised priority
Comment 14 Marek Fukala 2003-12-12 14:15:19 UTC
Hi again ;-)
During a quite long talk about webmodules with Petr Pisl a discovered
that there is something rotten in the state of Denmark.

I probably missed an alleged email (we cannot find it now) sent by you
concering hacks need to be done during webmodule deployment.

So after applying the 'necessary' steps the deployment of a webmodule
works.

I suggest to lower the priority of this bug and mark it as fixed just
after the 'necessary' additional steps are not needed anymore.

do you agree?
Comment 15 Petr Pisl 2003-12-12 15:49:40 UTC
I'm not able to execute a web module on the linux. During deploying
there is no war.file. So the modelu is not deployed. If you create the
war file, then the deploy is successful.
Comment 16 Petr Pisl 2003-12-12 16:29:41 UTC
The second problem is that during deploying I always get message in
the progress bar window: "FAIL - Application already exists at path"
/contextname". I get this message every time with new userdir. The
application is deployed correctly and is running. I can access it via
browser, but the browser is not started from the ide.

There are these messages in the console:
ProgressEvent RUNNING 6. Incrementally deploying
http://localhost:8080/manager/
ProgressEvent COMPLETED. 7. Completed incremental deployment of
org.netbeans.modules.j2ee.deployment.config.DeployableObjectImpl@1b02a96
DeployProgressMonitor.setProgressObject
org.netbeans.modules.tomcat5.TomcatManagerImpl@f76647
Initial status = A=execute S=running deploy?path=/kocka&war=kocka
command=distribute
DeployProgressMonitor cancel supported: false , stop is supported:
false.  Command: Distribute
ProgressEvent RUNNING 8. FAIL - Application already exists at path /kocka
mw DistributeEventHandler.handleProgressEvent state= running
ProgressEvent RUNNING 9.
mw DistributeEventHandler.handleProgressEvent state= running
[org.netbeans.modules.tomcat5] INFORMATIONAL *********** Exception
occurred ************ at Fri Dec 12 17:21:28 CET 2003
java.lang.Exception: FAIL - Application already exists at path /kocka
[catch] at
org.netbeans.modules.tomcat5.TomcatManagerImpl.run(TomcatManagerImpl.java:402)
        at org.openide.util.Task.run(Task.java:136)
        at
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330)
        at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:678)
ProgressEvent FAILED. FAIL - Application already exists at path /kocka
mw DistributeEventHandler.handleProgressEvent state= failed


I'm shure that the application was not running before execution
action. For verification I used the build 20031212-1427 on the linux.
Comment 17 Pavel Buzek 2003-12-12 17:48:40 UTC
Marek: you need to set web module context for a new module. This can
be done by right-clikcing on WEB-INF, selecting Configure (editor with
one ugly node opens), then right-click on that node and select
Properties (the only item) and set the Context property.
I agree this is a bug, but it is files as issue 37766 (rise to P2 if
you want) and I am working on it. It will require some architecture
changes in j2eeserver so it will take couple more days.

I've added this info in Tomcat 5 home page.
Comment 18 Pavel Buzek 2003-12-12 17:52:45 UTC
Petr: I will test this on Linux.
As for the secong problem is happened to me in past (an the
application was not there before) but I could not reproduce it now. It
might be related to the autodeploy property of server, I will try to
test this more.
Comment 19 Pavel Buzek 2003-12-13 07:15:29 UTC
non fix yet, only more info: 
the problem: "FAIL - Application already exists at path.." does not
happen (to me) if I start tomcat before the first deployment
Comment 20 navneet 2003-12-24 15:09:38 UTC
I tried this by changing the web module using th econfig process
specified above, but i still get the "failed.." error. This is using
the 200312231900 build.
Comment 21 Pavel Buzek 2004-01-06 02:42:47 UTC
I think that the problem was that when you did not start tomcat before
first deployment it loaded the module you were deploying automatically
and then the deployment failed ('app already exists' message).

I've added an additional check in tomcat startup that should prevent this.

When I create clean build, create web module with one jsp (index.jsp)
and deploy it (without starting tomcat first) it works. When I change
the jsp and execute it again it works again. Reopen if there are still
the same problems mentioned here.

Note that if the deployment fails once it would likely fail always for
that module (37817).
Comment 22 Marek Fukala 2004-01-07 14:36:56 UTC
[20040106]
Pavle, 
I must reopen this bug due to a very random behaviour. Please try to
follow these steps:
1) get a last build and run it with a new empty userdir
2) convert the sample fs into a webmodule
3) execute the wm

Note that I always ensure before running IDE there is not an already
running tomcat.

There are three possible scenarios I get:
1) tomcat is started, the wm deployed and browser is opened
(everything works) [10%]
2) tomcat is started, deployment done and but progress dialog stays
opened claiming that the deployment is completed successfully. Browser
is not opened, but the deployment is sucessful [70%]
3) tomcat is started but the deployment process fails with this
message: FAIL - Application already exists at path /sampledir and this
exception:
java.lang.Exception: FAIL - Application already exists at path /sampledir
[catch] at
org.netbeans.modules.tomcat5.TomcatManagerImpl.run(TomcatManagerImpl.java:402)
        at org.openide.util.Task.run(Task.java:136)
        at
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330)
        at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:678)

[20%]

It seems that there is a problem with synchronization of something
because these cases occuress pretty randomly. I am not able to
identify why sometimes the particular case happen and sometimes not.

Comment 23 Pavel Buzek 2004-01-08 02:59:55 UTC
long lived bug in deed, although this is in fact about 4th diferent
problem being reported in this issue.. so let's make a deal that after
I fix this one you will file a new bug for the next one:-)

Do you mean that you clean the user dir after each try?
What I am getting is that the first time deployment works 100% time so
that it shows the browser, although the progress dialog sometimes
remains open (showing Completed staus).
 
I am getting the message that you describe for subsequent deployments.
This is because j2eeserver really _is_ asking tomcat to distribute the
module, not to do incremental redeployment. I will investigate why.
Comment 24 Pavel Buzek 2004-01-08 03:23:42 UTC
BTW: you can tell what the j2eeserver is trying to do from the
following debugging printouts.

either:
DeployProgressMonitor.setProgressObject
org.netbeans.modules.j2ee.deployment.impl.InitialServerFileDistributor@a55242

or:
DeployProgressMonitor.setProgressObject
org.netbeans.modules.j2ee.deployment.impl.ServerFileDistributor@1270aef
Comment 25 Pavel Buzek 2004-01-08 05:22:01 UTC
the reason why j2eeserver is trying to do initial deployment is that
it does not have any targetModules stored in nbattrs for the module
(i.e. in TargetServer.processLastTargetModules() the
dtarget.getTargetModules(); returns null). I am not sure what is the
rule for this to be null. Any suggestions, Nam?
Comment 26 Nam Nguyen 2004-01-08 07:20:53 UTC
TargetServer.distribute() would return no TargetModule if
initialDeploy() 's progressObject does not generate COMPLETED event,
or if so the subsequent ProgressObject.getResultTargetModuleIDs()
returns empty.
If Tomcat does these, then might be some race condition.  I will try
to debug furthermore tomorrow.
Comment 27 Marek Fukala 2004-01-12 15:34:21 UTC
Since the deployment is working better (I can deploy / redeploy
webmodules mounted in various ways) I am closing this bug. I will fill
a new one when I find a new more particullar problem regarding the
deployment.
Comment 28 Marek Fukala 2004-07-07 16:50:47 UTC
verified