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 152831 - Switching the deployment location for Rails applications does not behave as expected
Summary: Switching the deployment location for Rails applications does not behave as e...
Status: RESOLVED WONTFIX
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 6.x
Hardware: Macintosh Mac OS X
: P4 blocker (vote)
Assignee: Vince Kraemer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-10 01:06 UTC by bkocik
Modified: 2012-11-27 12:55 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages.log file mentioned in bug description (62.62 KB, text/plain)
2008-11-10 01:07 UTC, bkocik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bkocik 2008-11-10 01:06:40 UTC
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
Comment 1 bkocik 2008-11-10 01:07:36 UTC
Created attachment 73562 [details]
messages.log file mentioned in bug description
Comment 2 _ pcw 2008-12-09 17:51:23 UTC
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.
Comment 3 _ pcw 2009-05-20 00:47:29 UTC
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
Comment 4 Vince Kraemer 2009-09-16 23:58:46 UTC
pickup half of pcw's issues
Comment 5 Vince Kraemer 2009-09-25 22:59:59 UTC
I cannot commit to any thing earlier for this issue
Comment 6 Vince Kraemer 2010-04-23 17:14:22 UTC
glassfish scripting is not a high priority currently
Comment 7 TomasKraus 2012-11-27 12:55:46 UTC
We do not support JRuby on Rails in current GlassFish plugin releases.
Closing this bug.