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.
Setup: NetBeans 6.5 RC2 Sun (Apple) JDK 1.6.0_07 Mac OS X Leopard (10.5.5) NetBeans-bundled JRuby 1.1.4 Rails 2.1.0 Beginning with "Tools -> Servers -> GlassFish v3 Prelude -> Jruby -> Deploy All Rails Applications At Root Context (/)" turned on, and my application (twittertracks) running at "/", I perform the following steps. 1) Shut down the GlassFish server by clicking the "Stop the Server (X)" button next to its output pane. 2) Change the root context setting to off. 3) Start the GlassFish server back up either by right-clicking on the project and choosing "Run", or via the "Services" pane 4) Observe in the server output: INFO: Jruby version is: 1.1.4 INFO: Starting Rails instances INFO: New instance created in 13,495 milliseconds INFO: Loading Rails application twittertracks at / INFO: Loading twittertracks Application done is 14084 ms Expected: The application should not have been loaded at the root context. It should have deployed at /twittertracks. NetBeans then sends the browser to http://localhost:8080/twittertracks/, and a Rails routing error is returned because the application is not there. 5) Stop the server again, the same way as shown above. 6) Start the server again, by right-clicking on the app and choosing "Run". 7) Observe in the server output: INFO: Jruby version is: 1.1.4 INFO: Starting Rails instances INFO: New instance created in 13,359 milliseconds INFO: Loading Rails application twittertracks at /twittertracks INFO: Loading twittertracks Application done is 13927 ms It has gotten it right on the second try. The application is now loaded where it should be. This next set of steps is slightly different, and demonstrates another aspect of the problem. 8) Change the "root context" setting mentioned at the outset back to on without first stopping the server. 9) Right-click on the application and choose "Run". 10) Observe: The application is not redeployed at "/" as is expected. The browser is sent to http://localhost:8080/ and finds a GlassFish welcome page there, instead of the Rails application. The Rails application is still available at http://localhost:8080/twittertracks/ 11) Repeat steps 9 and 10 as often as you like. (In the attached log, I ran through them only once more before continuing.) 12) Stop the server. 13) Start the server (right-click and "Run" application) 14) Observe in server log: INFO: Jruby version is: 1.1.4 INFO: Starting Rails instances INFO: New instance created in 12,980 milliseconds INFO: Loading Rails application twittertracks at / INFO: Loading twittertracks Application done is 13705 ms It has now correctly loaded the application at the root context, in accordance with the setting changed in step 8. Attached is the messages.log file I generated by running through all of the above steps after starting NetBeans from the command line, passing it -J-Dglassfish.level=FINE
Created attachment 73562 [details] messages.log file mentioned in bug description
Evaluation: This issue was filed by the customer at my request. It needs further in depth investigation. If I'm the one doing that, it'll have to wait until January. If it can be demonstrated (and resolved), should be considered for a 6.5 patch candidate due to the confusion that can arise.
What's going on here is that right after server startup, NetBeans is altering the context root of the application, but it's being done at the wrong time -- the application is in the process of being loaded (ok, the app is loaded, but rails isn't fully initialized yet) and so the change doesn't take. A server restart will fix it, as will undeploying and redeploying the application. It would be nice if just <Run> a second time fixed it, but it doesn't because the new context root is already stored in domain.xml so the IDE doesn't know the server loaded the app at the old location. Not going to be resolved for 6.7
pickup half of pcw's issues
I cannot commit to any thing earlier for this issue
glassfish scripting is not a high priority currently
We do not support JRuby on Rails in current GlassFish plugin releases. Closing this bug.