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.
[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.
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.
after some (presumingly unrelated :-) changes in deployment this works for me, please test and close or add info and rise again. tx.
> 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 ;-)
Created attachment 12492 [details] The progress dialog window screenshot
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.
Created attachment 12500 [details] The part of the IDE output.
fixed
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
Created attachment 12546 [details] List command output from manager application
Created attachment 12547 [details] IDE output regarding the deployment
Created attachment 12548 [details] The tomcat directory from user's dir
Created attachment 12549 [details] The webmodule
raised priority
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?
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.
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.
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.
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.
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
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.
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).
[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.
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.
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
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?
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.
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.
verified