From fausto.lelli at gmail.com Fri Dec 1 08:10:01 2006 From: fausto.lelli at gmail.com (Fausto Lelli) Date: Fri, 1 Dec 2006 14:10:01 +0100 Subject: [Jruby-extras-devel] WAR'ing a RoR app In-Reply-To: <456F3D8E.50408@cs.auckland.ac.nz> References: <456E1EA4.9010102@sun.com> <456E60C5.7010505@sun.com> <456F28F1.7070408@sun.com> <456F3D8E.50408@cs.auckland.ac.nz> Message-ID: Hi Robert, Although I'm totally swamped at work and a total newbie in these fields, I'd like to help. What do you think of Charles proposal of having a generator ? If that should be the case I think the hardest part is understanding where to put on the new stuff, rather than creating the script itself. The script should zip all the rails-webapp directory itself and add the WEB-INF dir filled with the web.xml and the lib/rails-integration.jar, the only parameter to be passed in being the location of the jruby_home, and optionally putting all jruby jars into the lib directory. Is it correct ? Cheers, Fausto On 11/30/06, Robert Egglestone wrote: > > Building the war file will most likely take the form of a Rake task, > however as far as I know no-one has had a look at doing this yet. > I'll have a go at it this weekend. > > Cheers, > Robert > > > > > Ashish Sahni wrote: > Thats great ! For a ruby newbie like can you clarify ... > > Currently the ruby dependencies seem to be > 1. JRuby runtime interpreter > 2. Rails framework libraries > 3. Rails-integration glue code > 4. RoR application code. > > Is the goal of the complete-ruby to have all of these dependencies > bundled as one ? > Also, how are we envisioning the ruby developers to use this facility to > go from > have a RoR app to a war file in one-magical-command ? > > Thanks > Ashish > > Charles Oliver Nutter wrote: > > > Ashish Sahni wrote: > > > > Hi Folks, > > I guess one of the (obvious) goals of the rails-integration project would be > to come up with a simple way via which a standard RoR app can be bundled > as a WAR file. > > Would rake file be the candidate here ? Also, when is > rails-integration-snapshot > going to make it as a separate binary downloadable ? > Any other thoughts on the matter ? > > > I'm obviously super interested in Rails-in-a-WAR, since suddenly Rails > gets all the deployment benefit of a classic Java web application. And I > believe it's possible; I already have an ant target that creates a > complete Ruby interpreter in a single jar; the next step of stuffing > Rails and a Rails app in there doesn't seem far away... > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > From Ashish.Sahni at Sun.COM Fri Dec 1 12:24:36 2006 From: Ashish.Sahni at Sun.COM (Ashish Sahni) Date: Fri, 01 Dec 2006 09:24:36 -0800 Subject: [Jruby-extras-devel] WAR'ing a RoR app In-Reply-To: References: <456E1EA4.9010102@sun.com> <456E60C5.7010505@sun.com> <456F28F1.7070408@sun.com> <456F3D8E.50408@cs.auckland.ac.nz> Message-ID: <45706554.6020803@sun.com> I've been using this ant target to war a rails app. Need to specify rails-app-dir, rails-app-name and JRUBY_HOME needs to be defined. Thanks Ashish Fausto Lelli wrote: >Hi Robert, > >Although I'm totally swamped at work and a total newbie in these fields, >I'd like to help. What do you think of Charles proposal of having a generator ? >If that should be the case I think the hardest part is understanding where >to put on the new stuff, rather than creating the script itself. > >The script should zip all the rails-webapp directory itself >and add the WEB-INF dir filled with the web.xml and the >lib/rails-integration.jar, >the only parameter to be passed in being the location of the jruby_home, >and optionally putting all jruby jars into the lib directory. > >Is it correct ? >Cheers, >Fausto > >On 11/30/06, Robert Egglestone wrote: > > >> Building the war file will most likely take the form of a Rake task, >>however as far as I know no-one has had a look at doing this yet. >> I'll have a go at it this weekend. >> >> Cheers, >> Robert >> >> >> >> >> Ashish Sahni wrote: >> Thats great ! For a ruby newbie like can you clarify ... >> >>Currently the ruby dependencies seem to be >>1. JRuby runtime interpreter >>2. Rails framework libraries >>3. Rails-integration glue code >>4. RoR application code. >> >>Is the goal of the complete-ruby to have all of these dependencies >>bundled as one ? >>Also, how are we envisioning the ruby developers to use this facility to >>go from >>have a RoR app to a war file in one-magical-command ? >> >>Thanks >>Ashish >> >>Charles Oliver Nutter wrote: >> >> >> Ashish Sahni wrote: >> >> >> >> Hi Folks, >> >>I guess one of the (obvious) goals of the rails-integration project would be >>to come up with a simple way via which a standard RoR app can be bundled >>as a WAR file. >> >>Would rake file be the candidate here ? Also, when is >>rails-integration-snapshot >>going to make it as a separate binary downloadable ? >>Any other thoughts on the matter ? >> >> >> I'm obviously super interested in Rails-in-a-WAR, since suddenly Rails >>gets all the deployment benefit of a classic Java web application. And I >>believe it's possible; I already have an ant target that creates a >>complete Ruby interpreter in a single jar; the next step of stuffing >>Rails and a Rails app in there doesn't seem far away... >> >> >> >> _______________________________________________ >>Jruby-extras-devel mailing list >>Jruby-extras-devel at rubyforge.org >>http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >>_______________________________________________ >>Jruby-extras-devel mailing list >>Jruby-extras-devel at rubyforge.org >>http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> >> >_______________________________________________ >Jruby-extras-devel mailing list >Jruby-extras-devel at rubyforge.org >http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > From robert at cs.auckland.ac.nz Fri Dec 1 17:41:08 2006 From: robert at cs.auckland.ac.nz (Robert Egglestone) Date: Sat, 02 Dec 2006 11:41:08 +1300 Subject: [Jruby-extras-devel] WAR'ing a RoR app In-Reply-To: References: <456E1EA4.9010102@sun.com> <456E60C5.7010505@sun.com> <456F28F1.7070408@sun.com> <456F3D8E.50408@cs.auckland.ac.nz> Message-ID: <4570AF84.1050800@cs.auckland.ac.nz> Yesterday I had a look into rake and putting some stuff together. Regardless of how it's exposed, if it's written in Ruby will allow us to make better packaging decisions than were possible previously. For example, having the routing information means we don't need FileServlet. I guess we have to support at least a standalone war, a shared war (no JRuby or gems inside the war), and a normal Rails webapp on disk. The extra gems required for a standalone war mean a bit more work is required. One area I'm not sure about is the rb.ast compilation. Should we aim to do this to all packaged Ruby files? Currently Rails loads slowly, will this significantly speed it up? I'm also not sure about how to distribute the builder. I'd like to be able to install a gem and a new generator becomes available or a new Rake task shows up. However I don't know how to do this, or if it's possible. We could install a Rake task lib from a gem, but I suspect only the Rails tasks and those in webapp/lib/tasks are included by default. Cheers, Robert Fausto Lelli wrote: > Hi Robert, > > Although I'm totally swamped at work and a total newbie in these fields, > I'd like to help. What do you think of Charles proposal of having a generator ? > If that should be the case I think the hardest part is understanding where > to put on the new stuff, rather than creating the script itself. > > The script should zip all the rails-webapp directory itself > and add the WEB-INF dir filled with the web.xml and the > lib/rails-integration.jar, > the only parameter to be passed in being the location of the jruby_home, > and optionally putting all jruby jars into the lib directory. > > Is it correct ? > Cheers, > Fausto > > On 11/30/06, Robert Egglestone wrote: > >> Building the war file will most likely take the form of a Rake task, >> however as far as I know no-one has had a look at doing this yet. >> I'll have a go at it this weekend. >> >> Cheers, >> Robert >> >> >> >> >> Ashish Sahni wrote: >> Thats great ! For a ruby newbie like can you clarify ... >> >> Currently the ruby dependencies seem to be >> 1. JRuby runtime interpreter >> 2. Rails framework libraries >> 3. Rails-integration glue code >> 4. RoR application code. >> >> Is the goal of the complete-ruby to have all of these dependencies >> bundled as one ? >> Also, how are we envisioning the ruby developers to use this facility to >> go from >> have a RoR app to a war file in one-magical-command ? >> >> Thanks >> Ashish >> >> Charles Oliver Nutter wrote: >> >> >> Ashish Sahni wrote: >> >> >> >> Hi Folks, >> >> I guess one of the (obvious) goals of the rails-integration project would be >> to come up with a simple way via which a standard RoR app can be bundled >> as a WAR file. >> >> Would rake file be the candidate here ? Also, when is >> rails-integration-snapshot >> going to make it as a separate binary downloadable ? >> Any other thoughts on the matter ? >> >> >> I'm obviously super interested in Rails-in-a-WAR, since suddenly Rails >> gets all the deployment benefit of a classic Java web application. And I >> believe it's possible; I already have an ant target that creates a >> complete Ruby interpreter in a single jar; the next step of stuffing >> Rails and a Rails app in there doesn't seem far away... >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/jruby-extras-devel/attachments/20061202/3a4d6d67/attachment.html From fausto.lelli at gmail.com Fri Dec 1 18:38:30 2006 From: fausto.lelli at gmail.com (Fausto Lelli) Date: Sat, 2 Dec 2006 00:38:30 +0100 Subject: [Jruby-extras-devel] WAR'ing a RoR app In-Reply-To: <4570AF84.1050800@cs.auckland.ac.nz> References: <456E1EA4.9010102@sun.com> <456E60C5.7010505@sun.com> <456F28F1.7070408@sun.com> <456F3D8E.50408@cs.auckland.ac.nz> <4570AF84.1050800@cs.auckland.ac.nz> Message-ID: On 12/1/06, Robert Egglestone wrote: > Regardless of how it's exposed, if it's written in Ruby will allow us to > make better packaging decisions than were possible previously. For example, > having the routing information means we don't need FileServlet. Yep. On the other side java has the zip-stream support out of the box. I already have a java routine that packages a directory tree in a zip, modifing it to make a war file should be trivial. I don't know about Ruby, does one have to install the ruby-zip gem as an extra step ? > > I guess we have to support at least a standalone war, a shared war (no > JRuby or gems inside the war), and a normal Rails webapp on disk. The extra > gems required for a standalone war mean a bit more work is required. not sure about terminology here. with standalone war do you mean with WEB-INF/lib/jruby.jar,emma.jar, ecc and shared war without these jars ? One other thing one could do is producing a context.xml file to put under the conf directory of tomcat to launch the webapp anywhere in the filesystem. At least for tomcat. > One area I'm not sure about is the rb.ast compilation. Should we aim to do > this to all packaged Ruby files? Currently Rails loads slowly, will this > significantly speed it up? I'll shamelessly say that I don't know what the rb.ast compilation is. Anyway slowliness of rails startup is problem #1 for testing. anything that copes with that would be fine. I've just finished setting up jetty to do some testing faster, but rails startup is still a pain. > I'm also not sure about how to distribute the builder. I'd like to be able > to install a gem and a new generator becomes available or a new Rake task > shows up. However I don't know how to do this, or if it's possible. We could > install a Rake task lib from a gem, but I suspect only the Rails tasks and > those in webapp/lib/tasks are included by default. Yes, i did take a look about the generator, and noticed that the real scripts are buried deep inside the rails gem distribution. Of course, "make war" will never make part of a "standard" rails distribution. wait, maybe a plugin is the way to go ? Cheers, Fausto > Cheers, > Robert > > > > Fausto Lelli wrote: > Hi Robert, > > Although I'm totally swamped at work and a total newbie in these fields, > I'd like to help. What do you think of Charles proposal of having a > generator ? > If that should be the case I think the hardest part is understanding where > to put on the new stuff, rather than creating the script itself. > > The script should zip all the rails-webapp directory itself > and add the WEB-INF dir filled with the web.xml and the > lib/rails-integration.jar, > the only parameter to be passed in being the location of the jruby_home, > and optionally putting all jruby jars into the lib directory. > > Is it correct ? > Cheers, > Fausto > > On 11/30/06, Robert Egglestone wrote: > > > Building the war file will most likely take the form of a Rake task, > however as far as I know no-one has had a look at doing this yet. > I'll have a go at it this weekend. > > Cheers, > Robert > > > > > Ashish Sahni wrote: > Thats great ! For a ruby newbie like can you clarify ... > > Currently the ruby dependencies seem to be > 1. JRuby runtime interpreter > 2. Rails framework libraries > 3. Rails-integration glue code > 4. RoR application code. > > Is the goal of the complete-ruby to have all of these dependencies > bundled as one ? > Also, how are we envisioning the ruby developers to use this facility to > go from > have a RoR app to a war file in one-magical-command ? > > Thanks > Ashish > > Charles Oliver Nutter wrote: > > > Ashish Sahni wrote: > > > > Hi Folks, > > I guess one of the (obvious) goals of the rails-integration project would be > to come up with a simple way via which a standard RoR app can be bundled > as a WAR file. > > Would rake file be the candidate here ? Also, when is > rails-integration-snapshot > going to make it as a separate binary downloadable ? > Any other thoughts on the matter ? > > > I'm obviously super interested in Rails-in-a-WAR, since suddenly Rails > gets all the deployment benefit of a classic Java web application. And I > believe it's possible; I already have an ant target that creates a > complete Ruby interpreter in a single jar; the next step of stuffing > Rails and a Rails app in there doesn't seem far away... > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > From charles.nutter at sun.com Fri Dec 1 19:28:57 2006 From: charles.nutter at sun.com (Charles Oliver Nutter) Date: Fri, 01 Dec 2006 18:28:57 -0600 Subject: [Jruby-extras-devel] WAR'ing a RoR app In-Reply-To: <4570AF84.1050800@cs.auckland.ac.nz> References: <456E1EA4.9010102@sun.com> <456E60C5.7010505@sun.com> <456F28F1.7070408@sun.com> <456F3D8E.50408@cs.auckland.ac.nz> <4570AF84.1050800@cs.auckland.ac.nz> Message-ID: <4570C8C9.1020902@sun.com> Robert Egglestone wrote: > Yesterday I had a look into rake and putting some stuff together. > > Regardless of how it's exposed, if it's written in Ruby will allow us to > make better packaging decisions than were possible previously. For > example, having the routing information means we don't need FileServlet. I have numbers for Rails deployed in GlassFish serving up static files and it's extremely fast...on the order of 2500-3000 pages per second with a single threaded Grizzly HTTP listener. I wouldn't worry too much about the speed of routing to static files in Rails once it's deployed to an app server. > > I guess we have to support at least a standalone war, a shared war (no > JRuby or gems inside the war), and a normal Rails webapp on disk. The > extra gems required for a standalone war mean a bit more work is required. Exactly the three areas I see as important, with the "complete" WAR version being the holy grail for ease-of-deployment and the other two being appropriate for larger hosting environments or for in-development systems, respectively. The last one is going to be the easiest, since that's close to "standard" deployment. > One area I'm not sure about is the rb.ast compilation. Should we aim to > do this to all packaged Ruby files? Currently Rails loads slowly, will > this significantly speed it up? Compilation and preparsing are two separate items. Preparsing has no effect on long-term performance, and only helps speed startup times. However given that in a test environment you'd have to pre-parse whenever you make a change, it seems to have little overall value. Compilation is not yet supported in JRuby, but it's going to be a top priority now that we're getting close to full Rails support. Compilation of a full webapp + libraries will be a very big boost for both startup and long-term performance. But we'll cross that bridge when we come to it, basically by providing the ability to create a "precompiled" application (JAR, WAR, whatever) that doesn't include any .rb file source in it anymore. At that point...we're basically done. > I'm also not sure about how to distribute the builder. I'd like to be > able to install a gem and a new generator becomes available or a new > Rake task shows up. However I don't know how to do this, or if it's > possible. We could install a Rake task lib from a gem, but I suspect > only the Rails tasks and those in webapp/lib/tasks are included by default. I'm positive there's a way to create additional generators, because I've seen them demoed. I'd guess there's some way to do it through plugins, but I don't know enough about Rails to be sure. Basically, plugins are loaded at init time for any Rails script, so you must be able to register generators then. -- Charles Oliver Nutter, JRuby Core Developer Blogging on Ruby and Java @ headius.blogspot.com Help spec out Ruby today! @ www.headius.com/rubyspec headius at headius.com -- charles.nutter at sun.com From robert at cs.auckland.ac.nz Fri Dec 1 19:34:22 2006 From: robert at cs.auckland.ac.nz (Robert Egglestone) Date: Sat, 02 Dec 2006 13:34:22 +1300 Subject: [Jruby-extras-devel] WAR'ing a RoR app In-Reply-To: References: <456E1EA4.9010102@sun.com> <456E60C5.7010505@sun.com> <456F28F1.7070408@sun.com> <456F3D8E.50408@cs.auckland.ac.nz> <4570AF84.1050800@cs.auckland.ac.nz> Message-ID: <4570CA0E.7020406@cs.auckland.ac.nz> I'm thinking of a standalone war being one that includes all jars and gems that are required to run it, so that it has no external dependencies. Shared wars are something I'm still a bit fuzzy on what's best to include. It could be no libraries, or just the Java libraries, or perhaps a subset of them. I've got a packaging script together in Ruby now, it's currently sitting included in the helloworld-rake as a Rake task. I haven't tried it on Windows yet. Do you want to look into the best way of packaging up a plugin or task or something that we can distribute? Cheers, Robert Fausto Lelli wrote: > On 12/1/06, Robert Egglestone wrote: > > >> Regardless of how it's exposed, if it's written in Ruby will allow us to >> make better packaging decisions than were possible previously. For example, >> having the routing information means we don't need FileServlet. >> > > Yep. On the other side java has the zip-stream support out of the box. > I already have a java routine that packages a directory tree in a zip, > modifing it to make a war file should be trivial. I don't know about Ruby, > does one have to install the ruby-zip gem as an extra step ? > > >> I guess we have to support at least a standalone war, a shared war (no >> JRuby or gems inside the war), and a normal Rails webapp on disk. The extra >> gems required for a standalone war mean a bit more work is required. >> > > not sure about terminology here. with standalone war do you mean with > WEB-INF/lib/jruby.jar,emma.jar, ecc and shared war without these jars ? > One other thing one could do is producing a context.xml file to put under > the conf directory of tomcat to launch the webapp anywhere in the filesystem. > At least for tomcat. > > >> One area I'm not sure about is the rb.ast compilation. Should we aim to do >> this to all packaged Ruby files? Currently Rails loads slowly, will this >> significantly speed it up? >> > I'll shamelessly say that I don't know what the rb.ast compilation is. > Anyway slowliness of rails startup is problem #1 for testing. anything > that copes with that would be fine. I've just finished setting up jetty to > do some testing faster, but rails startup is still a pain. > > >> I'm also not sure about how to distribute the builder. I'd like to be able >> to install a gem and a new generator becomes available or a new Rake task >> shows up. However I don't know how to do this, or if it's possible. We could >> install a Rake task lib from a gem, but I suspect only the Rails tasks and >> those in webapp/lib/tasks are included by default. >> > > Yes, i did take a look about the generator, and noticed that the real > scripts are > buried deep inside the rails gem distribution. Of course, "make war" > will never make part > of a "standard" rails distribution. wait, maybe a plugin is the way to go ? > > Cheers, > Fausto > > >> Cheers, >> Robert >> >> >> >> Fausto Lelli wrote: >> Hi Robert, >> >> Although I'm totally swamped at work and a total newbie in these fields, >> I'd like to help. What do you think of Charles proposal of having a >> generator ? >> If that should be the case I think the hardest part is understanding where >> to put on the new stuff, rather than creating the script itself. >> >> The script should zip all the rails-webapp directory itself >> and add the WEB-INF dir filled with the web.xml and the >> lib/rails-integration.jar, >> the only parameter to be passed in being the location of the jruby_home, >> and optionally putting all jruby jars into the lib directory. >> >> Is it correct ? >> Cheers, >> Fausto >> >> On 11/30/06, Robert Egglestone wrote: >> >> >> Building the war file will most likely take the form of a Rake task, >> however as far as I know no-one has had a look at doing this yet. >> I'll have a go at it this weekend. >> >> Cheers, >> Robert >> >> >> >> >> Ashish Sahni wrote: >> Thats great ! For a ruby newbie like can you clarify ... >> >> Currently the ruby dependencies seem to be >> 1. JRuby runtime interpreter >> 2. Rails framework libraries >> 3. Rails-integration glue code >> 4. RoR application code. >> >> Is the goal of the complete-ruby to have all of these dependencies >> bundled as one ? >> Also, how are we envisioning the ruby developers to use this facility to >> go from >> have a RoR app to a war file in one-magical-command ? >> >> Thanks >> Ashish >> >> Charles Oliver Nutter wrote: >> >> >> Ashish Sahni wrote: >> >> >> >> Hi Folks, >> >> I guess one of the (obvious) goals of the rails-integration project would be >> to come up with a simple way via which a standard RoR app can be bundled >> as a WAR file. >> >> Would rake file be the candidate here ? Also, when is >> rails-integration-snapshot >> going to make it as a separate binary downloadable ? >> Any other thoughts on the matter ? >> >> >> I'm obviously super interested in Rails-in-a-WAR, since suddenly Rails >> gets all the deployment benefit of a classic Java web application. And I >> believe it's possible; I already have an ant target that creates a >> complete Ruby interpreter in a single jar; the next step of stuffing >> Rails and a Rails app in there doesn't seem far away... >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/jruby-extras-devel/attachments/20061202/f23fb04b/attachment.html From superchrisnelson at gmail.com Fri Dec 1 20:28:52 2006 From: superchrisnelson at gmail.com (Chris Nelson) Date: Fri, 1 Dec 2006 20:28:52 -0500 Subject: [Jruby-extras-devel] Added a bug for JRuby on Rails date issue Message-ID: Guys, I added a bug in the Jruby-extras tracker for the problemn I and Ashish have been seeing with scaffolded apps and the Rails date picker. It's pretty easy to reproduce I think, but without a real good way to debug jruby scripts (if someone has an idea here i'm all ears!) I'm not sure how to go about looking into it more. Here is the link: http://rubyforge.org/tracker/?func=detail&aid=6906&group_id=2014&atid=7857 From charles.nutter at sun.com Fri Dec 1 21:10:21 2006 From: charles.nutter at sun.com (Charles Oliver Nutter) Date: Fri, 01 Dec 2006 20:10:21 -0600 Subject: [Jruby-extras-devel] Added a bug for JRuby on Rails date issue In-Reply-To: References: Message-ID: <4570E08D.6050501@sun.com> Chris Nelson wrote: > Guys, > > I added a bug in the Jruby-extras tracker for the problemn I and > Ashish have been seeing with scaffolded apps and the Rails date > picker. It's pretty easy to reproduce I think, but without a real > good way to debug jruby scripts (if someone has an idea here i'm all > ears!) I'm not sure how to go about looking into it more. > > Here is the link: > http://rubyforge.org/tracker/?func=detail&aid=6906&group_id=2014&atid=7857 I'm guessing this is probably a JRuby issue...have you entered a bug in the JRuby JIRA for this too? Of course having it narrowed down more helps, but getting it in there guarantees we'll *eventually* fix it. -- Charles Oliver Nutter, JRuby Core Developer Blogging on Ruby and Java @ headius.blogspot.com Help spec out Ruby today! @ www.headius.com/rubyspec headius at headius.com -- charles.nutter at sun.com From fausto.lelli at gmail.com Sat Dec 2 04:53:45 2006 From: fausto.lelli at gmail.com (Fausto Lelli) Date: Sat, 2 Dec 2006 10:53:45 +0100 Subject: [Jruby-extras-devel] WAR'ing a RoR app In-Reply-To: <4570CA0E.7020406@cs.auckland.ac.nz> References: <456E1EA4.9010102@sun.com> <456E60C5.7010505@sun.com> <456F28F1.7070408@sun.com> <456F3D8E.50408@cs.auckland.ac.nz> <4570AF84.1050800@cs.auckland.ac.nz> <4570CA0E.7020406@cs.auckland.ac.nz> Message-ID: Hi all, I've set up a plugin that calls the rake script you've made but need to find a place in the svn to put it. This is somewhat relevant because users will need the install the plugin with a repository url like ./script/plugin install \ svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war or something. I've also testing the rake task under windows but I have this (very natural) problem: rake aborted! couldn't find HOME environment -- expanding `~/.m2/repository' C:/Workspace32/rails-integration/samples/helloworld-rake/rakefile:10 I'll submit a patch soon. Oh, accidentally I rechristianized the task from "war" to "create_war" (as the name of the plugin), can we eventually keep this ? Cheers, Fausto On 12/2/06, Robert Egglestone wrote: > > I'm thinking of a standalone war being one that includes all jars and gems > that are required to run it, so that it has no external dependencies. > Shared wars are something I'm still a bit fuzzy on what's best to include. > It could be no libraries, or just the Java libraries, or perhaps a subset of > them. > > I've got a packaging script together in Ruby now, it's currently sitting > included in the helloworld-rake as a Rake task. I haven't tried it on > Windows yet. > > Do you want to look into the best way of packaging up a plugin or task or > something that we can distribute? > > > Cheers, > Robert > > > Fausto Lelli wrote: > On 12/1/06, Robert Egglestone wrote: > > > > Regardless of how it's exposed, if it's written in Ruby will allow us to > make better packaging decisions than were possible previously. For example, > having the routing information means we don't need FileServlet. > > Yep. On the other side java has the zip-stream support out of the box. > I already have a java routine that packages a directory tree in a zip, > modifing it to make a war file should be trivial. I don't know about Ruby, > does one have to install the ruby-zip gem as an extra step ? > > > > I guess we have to support at least a standalone war, a shared war (no > JRuby or gems inside the war), and a normal Rails webapp on disk. The extra > gems required for a standalone war mean a bit more work is required. > > not sure about terminology here. with standalone war do you mean with > WEB-INF/lib/jruby.jar,emma.jar, ecc and shared war without these jars ? > One other thing one could do is producing a context.xml file to put under > the conf directory of tomcat to launch the webapp anywhere in the > filesystem. > At least for tomcat. > > > > One area I'm not sure about is the rb.ast compilation. Should we aim to do > this to all packaged Ruby files? Currently Rails loads slowly, will this > significantly speed it up? > > I'll shamelessly say that I don't know what the rb.ast compilation is. > Anyway slowliness of rails startup is problem #1 for testing. anything > that copes with that would be fine. I've just finished setting up jetty to > do some testing faster, but rails startup is still a pain. > > > > I'm also not sure about how to distribute the builder. I'd like to be able > to install a gem and a new generator becomes available or a new Rake task > shows up. However I don't know how to do this, or if it's possible. We could > install a Rake task lib from a gem, but I suspect only the Rails tasks and > those in webapp/lib/tasks are included by default. > > Yes, i did take a look about the generator, and noticed that the real > scripts are > buried deep inside the rails gem distribution. Of course, "make war" > will never make part > of a "standard" rails distribution. wait, maybe a plugin is the way to go ? > > Cheers, > Fausto > > > > Cheers, > Robert > > > > Fausto Lelli wrote: > Hi Robert, > > Although I'm totally swamped at work and a total newbie in these fields, > I'd like to help. What do you think of Charles proposal of having a > generator ? > If that should be the case I think the hardest part is understanding where > to put on the new stuff, rather than creating the script itself. > > The script should zip all the rails-webapp directory itself > and add the WEB-INF dir filled with the web.xml and the > lib/rails-integration.jar, > the only parameter to be passed in being the location of the jruby_home, > and optionally putting all jruby jars into the lib directory. > > Is it correct ? > Cheers, > Fausto > > On 11/30/06, Robert Egglestone wrote: > > > Building the war file will most likely take the form of a Rake task, > however as far as I know no-one has had a look at doing this yet. > I'll have a go at it this weekend. > > Cheers, > Robert > > > > > Ashish Sahni wrote: > Thats great ! For a ruby newbie like can you clarify ... > > Currently the ruby dependencies seem to be > 1. JRuby runtime interpreter > 2. Rails framework libraries > 3. Rails-integration glue code > 4. RoR application code. > > Is the goal of the complete-ruby to have all of these dependencies > bundled as one ? > Also, how are we envisioning the ruby developers to use this facility to > go from > have a RoR app to a war file in one-magical-command ? > > Thanks > Ashish > > Charles Oliver Nutter wrote: > > > Ashish Sahni wrote: > > > > Hi Folks, > > I guess one of the (obvious) goals of the rails-integration project would be > to come up with a simple way via which a standard RoR app can be bundled > as a WAR file. > > Would rake file be the candidate here ? Also, when is > rails-integration-snapshot > going to make it as a separate binary downloadable ? > Any other thoughts on the matter ? > > > I'm obviously super interested in Rails-in-a-WAR, since suddenly Rails > gets all the deployment benefit of a classic Java web application. And I > believe it's possible; I already have an ant target that creates a > complete Ruby interpreter in a single jar; the next step of stuffing > Rails and a Rails app in there doesn't seem far away... > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > From ola.bini at ki.se Sat Dec 2 11:39:41 2006 From: ola.bini at ki.se (Ola Bini) Date: Sat, 02 Dec 2006 17:39:41 +0100 Subject: [Jruby-extras-devel] Sandbox in JRuby is here! Message-ID: <4571AC4D.9030002@ki.se> I just released 0.0.1 of the gem javasand on RubyForge. Together with the JRuby branch at svn://svn.codehaus.org/jruby/branches/sandbox this will allow anyone to try out sandbox in JRuby. At the moment it's a bit rough, but it works well enough to run sandbox_server (provided you run it with -rubygems flag). More information can be found at my blog: http://ola-bini.blogspot.com/2006/12/freaky-freaky-sandbox-has-come-to-jruby.html I haven't changed anything in the ruby-scripts from Sandbox, except for the use of Thread#value which we don't have yet. Timeout's on Thread#join doesn't work either, but that should be fairly easy. Regards -- Ola Bini (http://ola-bini.blogspot.com) JvYAML, RbYAML, JRuby and Jatha contributor System Developer, Karolinska Institutet (http://www.ki.se) OLogix Consulting (http://www.ologix.com) "Yields falsehood when quined" yields falsehood when quined. From robert at cs.auckland.ac.nz Sat Dec 2 18:00:10 2006 From: robert at cs.auckland.ac.nz (Robert Egglestone) Date: Sun, 03 Dec 2006 12:00:10 +1300 Subject: [Jruby-extras-devel] WAR'ing a RoR app In-Reply-To: References: <456E1EA4.9010102@sun.com> <456E60C5.7010505@sun.com> <456F28F1.7070408@sun.com> <456F3D8E.50408@cs.auckland.ac.nz> <4570AF84.1050800@cs.auckland.ac.nz> <4570CA0E.7020406@cs.auckland.ac.nz> Message-ID: <4572057A.3060508@cs.auckland.ac.nz> That's great, thanks. That repository url and "create_war" are good. Cheers, Robert Fausto Lelli wrote: > Hi all, > > I've set up a plugin that calls the rake script you've made but need to > find a place in the svn to put it. > This is somewhat relevant because users will need the install the plugin > with a repository url like > ./script/plugin install \ > svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war > or something. > > I've also testing the rake task under windows but I have this (very natural) > problem: > rake aborted! > couldn't find HOME environment -- expanding `~/.m2/repository' > C:/Workspace32/rails-integration/samples/helloworld-rake/rakefile:10 > I'll submit a patch soon. > > Oh, accidentally I rechristianized the task from "war" to "create_war" > (as the name > of the plugin), can we eventually keep this ? > > Cheers, > Fausto > > On 12/2/06, Robert Egglestone wrote: > >> I'm thinking of a standalone war being one that includes all jars and gems >> that are required to run it, so that it has no external dependencies. >> Shared wars are something I'm still a bit fuzzy on what's best to include. >> It could be no libraries, or just the Java libraries, or perhaps a subset of >> them. >> >> I've got a packaging script together in Ruby now, it's currently sitting >> included in the helloworld-rake as a Rake task. I haven't tried it on >> Windows yet. >> >> Do you want to look into the best way of packaging up a plugin or task or >> something that we can distribute? >> >> >> Cheers, >> Robert >> >> >> Fausto Lelli wrote: >> On 12/1/06, Robert Egglestone wrote: >> >> >> >> Regardless of how it's exposed, if it's written in Ruby will allow us to >> make better packaging decisions than were possible previously. For example, >> having the routing information means we don't need FileServlet. >> >> Yep. On the other side java has the zip-stream support out of the box. >> I already have a java routine that packages a directory tree in a zip, >> modifing it to make a war file should be trivial. I don't know about Ruby, >> does one have to install the ruby-zip gem as an extra step ? >> >> >> >> I guess we have to support at least a standalone war, a shared war (no >> JRuby or gems inside the war), and a normal Rails webapp on disk. The extra >> gems required for a standalone war mean a bit more work is required. >> >> not sure about terminology here. with standalone war do you mean with >> WEB-INF/lib/jruby.jar,emma.jar, ecc and shared war without these jars ? >> One other thing one could do is producing a context.xml file to put under >> the conf directory of tomcat to launch the webapp anywhere in the >> filesystem. >> At least for tomcat. >> >> >> >> One area I'm not sure about is the rb.ast compilation. Should we aim to do >> this to all packaged Ruby files? Currently Rails loads slowly, will this >> significantly speed it up? >> >> I'll shamelessly say that I don't know what the rb.ast compilation is. >> Anyway slowliness of rails startup is problem #1 for testing. anything >> that copes with that would be fine. I've just finished setting up jetty to >> do some testing faster, but rails startup is still a pain. >> >> >> >> I'm also not sure about how to distribute the builder. I'd like to be able >> to install a gem and a new generator becomes available or a new Rake task >> shows up. However I don't know how to do this, or if it's possible. We could >> install a Rake task lib from a gem, but I suspect only the Rails tasks and >> those in webapp/lib/tasks are included by default. >> >> Yes, i did take a look about the generator, and noticed that the real >> scripts are >> buried deep inside the rails gem distribution. Of course, "make war" >> will never make part >> of a "standard" rails distribution. wait, maybe a plugin is the way to go ? >> >> Cheers, >> Fausto >> >> >> >> Cheers, >> Robert >> >> >> >> Fausto Lelli wrote: >> Hi Robert, >> >> Although I'm totally swamped at work and a total newbie in these fields, >> I'd like to help. What do you think of Charles proposal of having a >> generator ? >> If that should be the case I think the hardest part is understanding where >> to put on the new stuff, rather than creating the script itself. >> >> The script should zip all the rails-webapp directory itself >> and add the WEB-INF dir filled with the web.xml and the >> lib/rails-integration.jar, >> the only parameter to be passed in being the location of the jruby_home, >> and optionally putting all jruby jars into the lib directory. >> >> Is it correct ? >> Cheers, >> Fausto >> >> On 11/30/06, Robert Egglestone wrote: >> >> >> Building the war file will most likely take the form of a Rake task, >> however as far as I know no-one has had a look at doing this yet. >> I'll have a go at it this weekend. >> >> Cheers, >> Robert >> >> >> >> >> Ashish Sahni wrote: >> Thats great ! For a ruby newbie like can you clarify ... >> >> Currently the ruby dependencies seem to be >> 1. JRuby runtime interpreter >> 2. Rails framework libraries >> 3. Rails-integration glue code >> 4. RoR application code. >> >> Is the goal of the complete-ruby to have all of these dependencies >> bundled as one ? >> Also, how are we envisioning the ruby developers to use this facility to >> go from >> have a RoR app to a war file in one-magical-command ? >> >> Thanks >> Ashish >> >> Charles Oliver Nutter wrote: >> >> >> Ashish Sahni wrote: >> >> >> >> Hi Folks, >> >> I guess one of the (obvious) goals of the rails-integration project would be >> to come up with a simple way via which a standard RoR app can be bundled >> as a WAR file. >> >> Would rake file be the candidate here ? Also, when is >> rails-integration-snapshot >> going to make it as a separate binary downloadable ? >> Any other thoughts on the matter ? >> >> >> I'm obviously super interested in Rails-in-a-WAR, since suddenly Rails >> gets all the deployment benefit of a classic Java web application. And I >> believe it's possible; I already have an ant target that creates a >> complete Ruby interpreter in a single jar; the next step of stuffing >> Rails and a Rails app in there doesn't seem far away... >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/jruby-extras-devel/attachments/20061203/fa4935bd/attachment.html From fausto.lelli at gmail.com Sun Dec 3 07:43:38 2006 From: fausto.lelli at gmail.com (Fausto Lelli) Date: Sun, 3 Dec 2006 13:43:38 +0100 Subject: [Jruby-extras-devel] WAR'ing a RoR app In-Reply-To: <4572057A.3060508@cs.auckland.ac.nz> References: <456E1EA4.9010102@sun.com> <456E60C5.7010505@sun.com> <456F28F1.7070408@sun.com> <456F3D8E.50408@cs.auckland.ac.nz> <4570AF84.1050800@cs.auckland.ac.nz> <4570CA0E.7020406@cs.auckland.ac.nz> <4572057A.3060508@cs.auckland.ac.nz> Message-ID: Hi, i committed the plugin as indicated in the previous post (rails-integrations/plugins/create_war), but i'm afraid that installing the plugin from url won't work because there is not direct http access to the svn repository (only through svnView). So, to install the plugin, just copy the create_war dir from svn into the vendor/plugins/ dir of the rails app and you should be able to launch the rake create_war task. Along with it, I made some fixes relate to windows environment: 1) *ugly* hack for MAVEN_LOCAL_REPOSITORY not being present (-- you may want to review this for good --) 2) webapp name fished in from$webapp_name/vendor/plugins/creator_war/task 3) staging for windows is "tmp\\war" instead of "tmp/war" I tested standalone mode, and needed to add manually the following jars in the WEB-INF/lib directory of the generated war: bsf.war,commons-logging.1.0.4.jar,commons-logging-api.jar, emma.jar,emma_ant.jar,jvyaml.jar,plaincharset.jar. Maybe one could consider using the jruby-complete.jar for including jruby as a whole (http://headius.blogspot.com/2006/11/advanced-rails-deployment-with-jruby.html) Apart from that, the packaging for war in windows seems to be ok. Cheers, Fausto On 12/3/06, Robert Egglestone wrote: > > That's great, thanks. > That repository url and "create_war" are good. > > Cheers, Robert > > > Fausto Lelli wrote: > Hi all, > > I've set up a plugin that calls the rake script you've made but need to > find a place in the svn to put it. > This is somewhat relevant because users will need the install the plugin > with a repository url like > ./script/plugin install \ > svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war > or something. > > I've also testing the rake task under windows but I have this (very natural) > problem: > rake aborted! > couldn't find HOME environment -- expanding `~/.m2/repository' > C:/Workspace32/rails-integration/samples/helloworld-rake/rakefile:10 > I'll submit a patch soon. > > Oh, accidentally I rechristianized the task from "war" to "create_war" > (as the name > of the plugin), can we eventually keep this ? > > Cheers, > Fausto > > On 12/2/06, Robert Egglestone wrote: > > > I'm thinking of a standalone war being one that includes all jars and gems > that are required to run it, so that it has no external dependencies. > Shared wars are something I'm still a bit fuzzy on what's best to include. > It could be no libraries, or just the Java libraries, or perhaps a subset of > them. > > I've got a packaging script together in Ruby now, it's currently sitting > included in the helloworld-rake as a Rake task. I haven't tried it on > Windows yet. > > Do you want to look into the best way of packaging up a plugin or task or > something that we can distribute? > > > Cheers, > Robert > > > Fausto Lelli wrote: > On 12/1/06, Robert Egglestone wrote: > > > > Regardless of how it's exposed, if it's written in Ruby will allow us to > make better packaging decisions than were possible previously. For example, > having the routing information means we don't need FileServlet. > > Yep. On the other side java has the zip-stream support out of the box. > I already have a java routine that packages a directory tree in a zip, > modifing it to make a war file should be trivial. I don't know about Ruby, > does one have to install the ruby-zip gem as an extra step ? > > > > I guess we have to support at least a standalone war, a shared war (no > JRuby or gems inside the war), and a normal Rails webapp on disk. The extra > gems required for a standalone war mean a bit more work is required. > > not sure about terminology here. with standalone war do you mean with > WEB-INF/lib/jruby.jar,emma.jar, ecc and shared war without these jars ? > One other thing one could do is producing a context.xml file to put under > the conf directory of tomcat to launch the webapp anywhere in the > filesystem. > At least for tomcat. > > > > One area I'm not sure about is the rb.ast compilation. Should we aim to do > this to all packaged Ruby files? Currently Rails loads slowly, will this > significantly speed it up? > > I'll shamelessly say that I don't know what the rb.ast compilation is. > Anyway slowliness of rails startup is problem #1 for testing. anything > that copes with that would be fine. I've just finished setting up jetty to > do some testing faster, but rails startup is still a pain. > > > > I'm also not sure about how to distribute the builder. I'd like to be able > to install a gem and a new generator becomes available or a new Rake task > shows up. However I don't know how to do this, or if it's possible. We could > install a Rake task lib from a gem, but I suspect only the Rails tasks and > those in webapp/lib/tasks are included by default. > > Yes, i did take a look about the generator, and noticed that the real > scripts are > buried deep inside the rails gem distribution. Of course, "make war" > will never make part > of a "standard" rails distribution. wait, maybe a plugin is the way to go ? > > Cheers, > Fausto > > > > Cheers, > Robert > > > > Fausto Lelli wrote: > Hi Robert, > > Although I'm totally swamped at work and a total newbie in these fields, > I'd like to help. What do you think of Charles proposal of having a > generator ? > If that should be the case I think the hardest part is understanding where > to put on the new stuff, rather than creating the script itself. > > The script should zip all the rails-webapp directory itself > and add the WEB-INF dir filled with the web.xml and the > lib/rails-integration.jar, > the only parameter to be passed in being the location of the jruby_home, > and optionally putting all jruby jars into the lib directory. > > Is it correct ? > Cheers, > Fausto > > On 11/30/06, Robert Egglestone wrote: > > > Building the war file will most likely take the form of a Rake task, > however as far as I know no-one has had a look at doing this yet. > I'll have a go at it this weekend. > > Cheers, > Robert > > > > > Ashish Sahni wrote: > Thats great ! For a ruby newbie like can you clarify ... > > Currently the ruby dependencies seem to be > 1. JRuby runtime interpreter > 2. Rails framework libraries > 3. Rails-integration glue code > 4. RoR application code. > > Is the goal of the complete-ruby to have all of these dependencies > bundled as one ? > Also, how are we envisioning the ruby developers to use this facility to > go from > have a RoR app to a war file in one-magical-command ? > > Thanks > Ashish > > Charles Oliver Nutter wrote: > > > Ashish Sahni wrote: > > > > Hi Folks, > > I guess one of the (obvious) goals of the rails-integration project would be > to come up with a simple way via which a standard RoR app can be bundled > as a WAR file. > > Would rake file be the candidate here ? Also, when is > rails-integration-snapshot > going to make it as a separate binary downloadable ? > Any other thoughts on the matter ? > > > I'm obviously super interested in Rails-in-a-WAR, since suddenly Rails > gets all the deployment benefit of a classic Java web application. And I > believe it's possible; I already have an ant target that creates a > complete Ruby interpreter in a single jar; the next step of stuffing > Rails and a Rails app in there doesn't seem far away... > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > From robert at cs.auckland.ac.nz Sun Dec 3 16:43:21 2006 From: robert at cs.auckland.ac.nz (Robert Egglestone) Date: Mon, 04 Dec 2006 10:43:21 +1300 Subject: [Jruby-extras-devel] WAR'ing a RoR app In-Reply-To: References: <456E1EA4.9010102@sun.com> <456E60C5.7010505@sun.com> <456F28F1.7070408@sun.com> <456F3D8E.50408@cs.auckland.ac.nz> <4570AF84.1050800@cs.auckland.ac.nz> <4570CA0E.7020406@cs.auckland.ac.nz> <4572057A.3060508@cs.auckland.ac.nz> Message-ID: <457344F9.4030409@cs.auckland.ac.nz> Install seems good with the anonymous svn url: script/plugin install svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war I've merged in some changes from the two tasks files. I've renamed the second bit of the tasks to "create_war:standalone" and "create_war:shared, to remove the double-create. There's also a default "create_war" now, which goes to standalone. jruby-complete.jar will be great, especially since it includes the standard libraries. However, I'm a bit hesitant to include commons-logging, because of the classloader problems it can cause. I think the suggested approach is to include commons-logging-adapters.jar, but this assumes that the web server includes the api classes. Cheers, Robert Fausto Lelli wrote: > Hi, i committed the plugin as indicated in the previous post > (rails-integrations/plugins/create_war), > but i'm afraid that installing the plugin from url won't work because > there is not direct http access to the svn repository (only through svnView). > > So, to install the plugin, just copy the create_war dir from svn > into the vendor/plugins/ dir of the rails app and > you should be able to launch the rake create_war task. > > Along with it, I made some fixes relate to windows environment: > 1) *ugly* hack for MAVEN_LOCAL_REPOSITORY not being present > (-- you may want to review this for good --) > 2) webapp name fished in from$webapp_name/vendor/plugins/creator_war/task > 3) staging for windows is "tmp\\war" instead of "tmp/war" > > I tested standalone mode, and needed to add manually the following jars > in the WEB-INF/lib directory of the generated war: > bsf.war,commons-logging.1.0.4.jar,commons-logging-api.jar, > emma.jar,emma_ant.jar,jvyaml.jar,plaincharset.jar. > Maybe one could consider using the jruby-complete.jar for > including jruby as a whole > (http://headius.blogspot.com/2006/11/advanced-rails-deployment-with-jruby.html) > > Apart from that, the packaging for war in windows seems to be ok. > > Cheers, > Fausto > > > > On 12/3/06, Robert Egglestone wrote: > >> That's great, thanks. >> That repository url and "create_war" are good. >> >> Cheers, Robert >> >> >> Fausto Lelli wrote: >> Hi all, >> >> I've set up a plugin that calls the rake script you've made but need to >> find a place in the svn to put it. >> This is somewhat relevant because users will need the install the plugin >> with a repository url like >> ./script/plugin install \ >> svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war >> or something. >> >> I've also testing the rake task under windows but I have this (very natural) >> problem: >> rake aborted! >> couldn't find HOME environment -- expanding `~/.m2/repository' >> C:/Workspace32/rails-integration/samples/helloworld-rake/rakefile:10 >> I'll submit a patch soon. >> >> Oh, accidentally I rechristianized the task from "war" to "create_war" >> (as the name >> of the plugin), can we eventually keep this ? >> >> Cheers, >> Fausto >> >> On 12/2/06, Robert Egglestone wrote: >> >> >> I'm thinking of a standalone war being one that includes all jars and gems >> that are required to run it, so that it has no external dependencies. >> Shared wars are something I'm still a bit fuzzy on what's best to include. >> It could be no libraries, or just the Java libraries, or perhaps a subset of >> them. >> >> I've got a packaging script together in Ruby now, it's currently sitting >> included in the helloworld-rake as a Rake task. I haven't tried it on >> Windows yet. >> >> Do you want to look into the best way of packaging up a plugin or task or >> something that we can distribute? >> >> >> Cheers, >> Robert >> >> >> Fausto Lelli wrote: >> On 12/1/06, Robert Egglestone wrote: >> >> >> >> Regardless of how it's exposed, if it's written in Ruby will allow us to >> make better packaging decisions than were possible previously. For example, >> having the routing information means we don't need FileServlet. >> >> Yep. On the other side java has the zip-stream support out of the box. >> I already have a java routine that packages a directory tree in a zip, >> modifing it to make a war file should be trivial. I don't know about Ruby, >> does one have to install the ruby-zip gem as an extra step ? >> >> >> >> I guess we have to support at least a standalone war, a shared war (no >> JRuby or gems inside the war), and a normal Rails webapp on disk. The extra >> gems required for a standalone war mean a bit more work is required. >> >> not sure about terminology here. with standalone war do you mean with >> WEB-INF/lib/jruby.jar,emma.jar, ecc and shared war without these jars ? >> One other thing one could do is producing a context.xml file to put under >> the conf directory of tomcat to launch the webapp anywhere in the >> filesystem. >> At least for tomcat. >> >> >> >> One area I'm not sure about is the rb.ast compilation. Should we aim to do >> this to all packaged Ruby files? Currently Rails loads slowly, will this >> significantly speed it up? >> >> I'll shamelessly say that I don't know what the rb.ast compilation is. >> Anyway slowliness of rails startup is problem #1 for testing. anything >> that copes with that would be fine. I've just finished setting up jetty to >> do some testing faster, but rails startup is still a pain. >> >> >> >> I'm also not sure about how to distribute the builder. I'd like to be able >> to install a gem and a new generator becomes available or a new Rake task >> shows up. However I don't know how to do this, or if it's possible. We could >> install a Rake task lib from a gem, but I suspect only the Rails tasks and >> those in webapp/lib/tasks are included by default. >> >> Yes, i did take a look about the generator, and noticed that the real >> scripts are >> buried deep inside the rails gem distribution. Of course, "make war" >> will never make part >> of a "standard" rails distribution. wait, maybe a plugin is the way to go ? >> >> Cheers, >> Fausto >> >> >> >> Cheers, >> Robert >> >> >> >> Fausto Lelli wrote: >> Hi Robert, >> >> Although I'm totally swamped at work and a total newbie in these fields, >> I'd like to help. What do you think of Charles proposal of having a >> generator ? >> If that should be the case I think the hardest part is understanding where >> to put on the new stuff, rather than creating the script itself. >> >> The script should zip all the rails-webapp directory itself >> and add the WEB-INF dir filled with the web.xml and the >> lib/rails-integration.jar, >> the only parameter to be passed in being the location of the jruby_home, >> and optionally putting all jruby jars into the lib directory. >> >> Is it correct ? >> Cheers, >> Fausto >> >> On 11/30/06, Robert Egglestone wrote: >> >> >> Building the war file will most likely take the form of a Rake task, >> however as far as I know no-one has had a look at doing this yet. >> I'll have a go at it this weekend. >> >> Cheers, >> Robert >> >> >> >> >> Ashish Sahni wrote: >> Thats great ! For a ruby newbie like can you clarify ... >> >> Currently the ruby dependencies seem to be >> 1. JRuby runtime interpreter >> 2. Rails framework libraries >> 3. Rails-integration glue code >> 4. RoR application code. >> >> Is the goal of the complete-ruby to have all of these dependencies >> bundled as one ? >> Also, how are we envisioning the ruby developers to use this facility to >> go from >> have a RoR app to a war file in one-magical-command ? >> >> Thanks >> Ashish >> >> Charles Oliver Nutter wrote: >> >> >> Ashish Sahni wrote: >> >> >> >> Hi Folks, >> >> I guess one of the (obvious) goals of the rails-integration project would be >> to come up with a simple way via which a standard RoR app can be bundled >> as a WAR file. >> >> Would rake file be the candidate here ? Also, when is >> rails-integration-snapshot >> going to make it as a separate binary downloadable ? >> Any other thoughts on the matter ? >> >> >> I'm obviously super interested in Rails-in-a-WAR, since suddenly Rails >> gets all the deployment benefit of a classic Java web application. And I >> believe it's possible; I already have an ant target that creates a >> complete Ruby interpreter in a single jar; the next step of stuffing >> Rails and a Rails app in there doesn't seem far away... >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/jruby-extras-devel/attachments/20061204/36a88d20/attachment.html From fausto.lelli at gmail.com Mon Dec 4 16:57:36 2006 From: fausto.lelli at gmail.com (Fausto Lelli) Date: Mon, 4 Dec 2006 22:57:36 +0100 Subject: [Jruby-extras-devel] WAR'ing a RoR app In-Reply-To: <457344F9.4030409@cs.auckland.ac.nz> References: <456E1EA4.9010102@sun.com> <456F3D8E.50408@cs.auckland.ac.nz> <4570AF84.1050800@cs.auckland.ac.nz> <4570CA0E.7020406@cs.auckland.ac.nz> <4572057A.3060508@cs.auckland.ac.nz> <457344F9.4030409@cs.auckland.ac.nz> Message-ID: Hi Robert, > I've merged in some changes from the two tasks files. It seems that the zipped path (tmp/war instead of tmp\\war) has resurfaced. As far as I can understand, File.join is making its job fine because the platform is indeed java, and doing tmp/war in java is correct. But when one calls "system" and passes the directory as a parameter to windows shell, the paths must be set according to the underlaying OS. that's why i was using java.lang.System.getProperty("os.name") Can I suggest to keep the lib/create_war.rb and move there all the code there, leaving only the rake task declaration in the create_war_tasks.rake? (I can, I just did ) the lib should be automatically included in the loadpath, so the .rake should just need to require the file (and it's more "best practice" friendly) > svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war true! I googled a bit and it results that plugin can be automatically versioned using svn. I'll document myself better... > However, I'm a bit hesitant to include commons-logging, because of the > classloader problems it can cause. I think the suggested approach is to I'm sorry commons-logging isn't even included in the standart jruby distribution, so i guess we can just rule it out. P.S: I'm a little overwhelmed by Charles appraisal in his blog today. Even though it is true that this a "community" effort, this work is surely a child of yours. Hear you soon, Fausto On 12/3/06, Robert Egglestone wrote: > > Install seems good with the anonymous svn url: > script/plugin install > svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war > > I've merged in some changes from the two tasks files. > > I've renamed the second bit of the tasks to "create_war:standalone" and > "create_war:shared, to remove the double-create. There's also a default > "create_war" now, which goes to standalone. > > jruby-complete.jar will be great, especially since it includes the standard > libraries. > > However, I'm a bit hesitant to include commons-logging, because of the > classloader problems it can cause. I think the suggested approach is to > include commons-logging-adapters.jar, but this assumes that the web server > includes the api classes. > > > Cheers, > Robert > > Fausto Lelli wrote: > Hi, i committed the plugin as indicated in the previous post > (rails-integrations/plugins/create_war), > but i'm afraid that installing the plugin from url won't work because > there is not direct http access to the svn repository (only through > svnView). > > So, to install the plugin, just copy the create_war dir from svn > into the vendor/plugins/ dir of the rails app and > you should be able to launch the rake create_war task. > > Along with it, I made some fixes relate to windows environment: > 1) *ugly* hack for MAVEN_LOCAL_REPOSITORY not being present > (-- you may want to review this for good --) > 2) webapp name fished in > from$webapp_name/vendor/plugins/creator_war/task > 3) staging for windows is "tmp\\war" instead of "tmp/war" > > I tested standalone mode, and needed to add manually the following jars > in the WEB-INF/lib directory of the generated war: > bsf.war,commons-logging.1.0.4.jar,commons-logging-api.jar, > emma.jar,emma_ant.jar,jvyaml.jar,plaincharset.jar. > Maybe one could consider using the jruby-complete.jar for > including jruby as a whole > (http://headius.blogspot.com/2006/11/advanced-rails-deployment-with-jruby.html) > > Apart from that, the packaging for war in windows seems to be ok. > > Cheers, > Fausto > > > > On 12/3/06, Robert Egglestone wrote: > > > That's great, thanks. > That repository url and "create_war" are good. > > Cheers, Robert > > > Fausto Lelli wrote: > Hi all, > > I've set up a plugin that calls the rake script you've made but need to > find a place in the svn to put it. > This is somewhat relevant because users will need the install the plugin > with a repository url like > ./script/plugin install \ > svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war > or something. > > I've also testing the rake task under windows but I have this (very natural) > problem: > rake aborted! > couldn't find HOME environment -- expanding `~/.m2/repository' > C:/Workspace32/rails-integration/samples/helloworld-rake/rakefile:10 > I'll submit a patch soon. > > Oh, accidentally I rechristianized the task from "war" to "create_war" > (as the name > of the plugin), can we eventually keep this ? > > Cheers, > Fausto > > On 12/2/06, Robert Egglestone wrote: > > > I'm thinking of a standalone war being one that includes all jars and gems > that are required to run it, so that it has no external dependencies. > Shared wars are something I'm still a bit fuzzy on what's best to include. > It could be no libraries, or just the Java libraries, or perhaps a subset of > them. > > I've got a packaging script together in Ruby now, it's currently sitting > included in the helloworld-rake as a Rake task. I haven't tried it on > Windows yet. > > Do you want to look into the best way of packaging up a plugin or task or > something that we can distribute? > > > Cheers, > Robert > > > Fausto Lelli wrote: > On 12/1/06, Robert Egglestone wrote: > > > > Regardless of how it's exposed, if it's written in Ruby will allow us to > make better packaging decisions than were possible previously. For example, > having the routing information means we don't need FileServlet. > > Yep. On the other side java has the zip-stream support out of the box. > I already have a java routine that packages a directory tree in a zip, > modifing it to make a war file should be trivial. I don't know about Ruby, > does one have to install the ruby-zip gem as an extra step ? > > > > I guess we have to support at least a standalone war, a shared war (no > JRuby or gems inside the war), and a normal Rails webapp on disk. The extra > gems required for a standalone war mean a bit more work is required. > > not sure about terminology here. with standalone war do you mean with > WEB-INF/lib/jruby.jar,emma.jar, ecc and shared war without these jars ? > One other thing one could do is producing a context.xml file to put under > the conf directory of tomcat to launch the webapp anywhere in the > filesystem. > At least for tomcat. > > > > One area I'm not sure about is the rb.ast compilation. Should we aim to do > this to all packaged Ruby files? Currently Rails loads slowly, will this > significantly speed it up? > > I'll shamelessly say that I don't know what the rb.ast compilation is. > Anyway slowliness of rails startup is problem #1 for testing. anything > that copes with that would be fine. I've just finished setting up jetty to > do some testing faster, but rails startup is still a pain. > > > > I'm also not sure about how to distribute the builder. I'd like to be able > to install a gem and a new generator becomes available or a new Rake task > shows up. However I don't know how to do this, or if it's possible. We could > install a Rake task lib from a gem, but I suspect only the Rails tasks and > those in webapp/lib/tasks are included by default. > > Yes, i did take a look about the generator, and noticed that the real > scripts are > buried deep inside the rails gem distribution. Of course, "make war" > will never make part > of a "standard" rails distribution. wait, maybe a plugin is the way to go ? > > Cheers, > Fausto > > > > Cheers, > Robert > > > > Fausto Lelli wrote: > Hi Robert, > > Although I'm totally swamped at work and a total newbie in these fields, > I'd like to help. What do you think of Charles proposal of having a > generator ? > If that should be the case I think the hardest part is understanding where > to put on the new stuff, rather than creating the script itself. > > The script should zip all the rails-webapp directory itself > and add the WEB-INF dir filled with the web.xml and the > lib/rails-integration.jar, > the only parameter to be passed in being the location of the jruby_home, > and optionally putting all jruby jars into the lib directory. > > Is it correct ? > Cheers, > Fausto > > On 11/30/06, Robert Egglestone wrote: > > > Building the war file will most likely take the form of a Rake task, > however as far as I know no-one has had a look at doing this yet. > I'll have a go at it this weekend. > > Cheers, > Robert > > > > > Ashish Sahni wrote: > Thats great ! For a ruby newbie like can you clarify ... > > Currently the ruby dependencies seem to be > 1. JRuby runtime interpreter > 2. Rails framework libraries > 3. Rails-integration glue code > 4. RoR application code. > > Is the goal of the complete-ruby to have all of these dependencies > bundled as one ? > Also, how are we envisioning the ruby developers to use this facility to > go from > have a RoR app to a war file in one-magical-command ? > > Thanks > Ashish > > Charles Oliver Nutter wrote: > > > Ashish Sahni wrote: > > > > Hi Folks, > > I guess one of the (obvious) goals of the rails-integration project would be > to come up with a simple way via which a standard RoR app can be bundled > as a WAR file. > > Would rake file be the candidate here ? Also, when is > rails-integration-snapshot > going to make it as a separate binary downloadable ? > Any other thoughts on the matter ? > > > I'm obviously super interested in Rails-in-a-WAR, since suddenly Rails > gets all the deployment benefit of a classic Java web application. And I > believe it's possible; I already have an ant target that creates a > complete Ruby interpreter in a single jar; the next step of stuffing > Rails and a Rails app in there doesn't seem far away... > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > From Ashish.Sahni at Sun.COM Mon Dec 4 17:11:35 2006 From: Ashish.Sahni at Sun.COM (Ashish Sahni) Date: Mon, 04 Dec 2006 14:11:35 -0800 Subject: [Jruby-extras-devel] RailsServlet - MT-safe ? Message-ID: <45749D17.6040108@sun.com> Hi there, //Excerpt from RailsServlet.java protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // long startTime = System.currentTimeMillis(); Object[] args = { request, response }; JavaEmbedUtils.invokeMethod(runtime, dispatcher, "dispatch", args, void.class); // log("Invocation time: " + (System.currentTimeMillis() - startTime) + "ms"); } By looking at this code it would appear that RailsServlet is not multi-thread safe since 1. I had heard that the rails framework itself is not mt-safe and/or 2. All requests are handled by the same runtime(jruby-interpreter) instance Or am I mistaken and the runtime and rails libraries are capable of handling multiple concurrent requests ? Thanks Ashish From robert at cs.auckland.ac.nz Mon Dec 4 17:25:43 2006 From: robert at cs.auckland.ac.nz (Robert Egglestone) Date: Tue, 05 Dec 2006 11:25:43 +1300 Subject: [Jruby-extras-devel] WAR'ing a RoR app In-Reply-To: References: <456E1EA4.9010102@sun.com> <456F3D8E.50408@cs.auckland.ac.nz> <4570AF84.1050800@cs.auckland.ac.nz> <4570CA0E.7020406@cs.auckland.ac.nz> <4572057A.3060508@cs.auckland.ac.nz> <457344F9.4030409@cs.auckland.ac.nz> Message-ID: <4574A067.1030506@cs.auckland.ac.nz> Hmm, I'm not sure if I should be worried that File.join isn't generating paths compatible with the underlying OS. Moving everything to a library is a good idea. Fausto Lelli wrote: > Hi Robert, > > >> I've merged in some changes from the two tasks files. >> > It seems that the zipped path (tmp/war instead of tmp\\war) has resurfaced. > As far as I can understand, File.join is making its job fine because > the platform > is indeed java, and doing tmp/war in java is correct. But when one > calls "system" and > passes the directory as a parameter to windows shell, the paths must be set > according to the underlaying OS. that's why i was using > java.lang.System.getProperty("os.name") > > Can I suggest to keep the lib/create_war.rb and move there all the code > there, leaving only the rake task declaration in the create_war_tasks.rake? > (I can, I just did ) the lib should be automatically included in the > loadpath, so > the .rake should just need to require the file (and it's more "best > practice" friendly) > > >> svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war >> > true! I googled a bit and it results that plugin can be automatically versioned > using svn. I'll document myself better... > > >> However, I'm a bit hesitant to include commons-logging, because of the >> classloader problems it can cause. I think the suggested approach is to >> > I'm sorry commons-logging isn't even included in the standart jruby > distribution, > so i guess we can just rule it out. > > P.S: I'm a little overwhelmed by Charles appraisal in his blog today. > Even though > it is true that this a "community" effort, this work is surely a child of yours. > > Hear you soon, > Fausto > > On 12/3/06, Robert Egglestone wrote: > >> Install seems good with the anonymous svn url: >> script/plugin install >> svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war >> >> I've merged in some changes from the two tasks files. >> >> I've renamed the second bit of the tasks to "create_war:standalone" and >> "create_war:shared, to remove the double-create. There's also a default >> "create_war" now, which goes to standalone. >> >> jruby-complete.jar will be great, especially since it includes the standard >> libraries. >> >> However, I'm a bit hesitant to include commons-logging, because of the >> classloader problems it can cause. I think the suggested approach is to >> include commons-logging-adapters.jar, but this assumes that the web server >> includes the api classes. >> >> >> Cheers, >> Robert >> >> Fausto Lelli wrote: >> Hi, i committed the plugin as indicated in the previous post >> (rails-integrations/plugins/create_war), >> but i'm afraid that installing the plugin from url won't work because >> there is not direct http access to the svn repository (only through >> svnView). >> >> So, to install the plugin, just copy the create_war dir from svn >> into the vendor/plugins/ dir of the rails app and >> you should be able to launch the rake create_war task. >> >> Along with it, I made some fixes relate to windows environment: >> 1) *ugly* hack for MAVEN_LOCAL_REPOSITORY not being present >> (-- you may want to review this for good --) >> 2) webapp name fished in >> from$webapp_name/vendor/plugins/creator_war/task >> 3) staging for windows is "tmp\\war" instead of "tmp/war" >> >> I tested standalone mode, and needed to add manually the following jars >> in the WEB-INF/lib directory of the generated war: >> bsf.war,commons-logging.1.0.4.jar,commons-logging-api.jar, >> emma.jar,emma_ant.jar,jvyaml.jar,plaincharset.jar. >> Maybe one could consider using the jruby-complete.jar for >> including jruby as a whole >> (http://headius.blogspot.com/2006/11/advanced-rails-deployment-with-jruby.html) >> >> Apart from that, the packaging for war in windows seems to be ok. >> >> Cheers, >> Fausto >> >> >> >> On 12/3/06, Robert Egglestone wrote: >> >> >> That's great, thanks. >> That repository url and "create_war" are good. >> >> Cheers, Robert >> >> >> Fausto Lelli wrote: >> Hi all, >> >> I've set up a plugin that calls the rake script you've made but need to >> find a place in the svn to put it. >> This is somewhat relevant because users will need the install the plugin >> with a repository url like >> ./script/plugin install \ >> svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war >> or something. >> >> I've also testing the rake task under windows but I have this (very natural) >> problem: >> rake aborted! >> couldn't find HOME environment -- expanding `~/.m2/repository' >> C:/Workspace32/rails-integration/samples/helloworld-rake/rakefile:10 >> I'll submit a patch soon. >> >> Oh, accidentally I rechristianized the task from "war" to "create_war" >> (as the name >> of the plugin), can we eventually keep this ? >> >> Cheers, >> Fausto >> >> On 12/2/06, Robert Egglestone wrote: >> >> >> I'm thinking of a standalone war being one that includes all jars and gems >> that are required to run it, so that it has no external dependencies. >> Shared wars are something I'm still a bit fuzzy on what's best to include. >> It could be no libraries, or just the Java libraries, or perhaps a subset of >> them. >> >> I've got a packaging script together in Ruby now, it's currently sitting >> included in the helloworld-rake as a Rake task. I haven't tried it on >> Windows yet. >> >> Do you want to look into the best way of packaging up a plugin or task or >> something that we can distribute? >> >> >> Cheers, >> Robert >> >> >> Fausto Lelli wrote: >> On 12/1/06, Robert Egglestone wrote: >> >> >> >> Regardless of how it's exposed, if it's written in Ruby will allow us to >> make better packaging decisions than were possible previously. For example, >> having the routing information means we don't need FileServlet. >> >> Yep. On the other side java has the zip-stream support out of the box. >> I already have a java routine that packages a directory tree in a zip, >> modifing it to make a war file should be trivial. I don't know about Ruby, >> does one have to install the ruby-zip gem as an extra step ? >> >> >> >> I guess we have to support at least a standalone war, a shared war (no >> JRuby or gems inside the war), and a normal Rails webapp on disk. The extra >> gems required for a standalone war mean a bit more work is required. >> >> not sure about terminology here. with standalone war do you mean with >> WEB-INF/lib/jruby.jar,emma.jar, ecc and shared war without these jars ? >> One other thing one could do is producing a context.xml file to put under >> the conf directory of tomcat to launch the webapp anywhere in the >> filesystem. >> At least for tomcat. >> >> >> >> One area I'm not sure about is the rb.ast compilation. Should we aim to do >> this to all packaged Ruby files? Currently Rails loads slowly, will this >> significantly speed it up? >> >> I'll shamelessly say that I don't know what the rb.ast compilation is. >> Anyway slowliness of rails startup is problem #1 for testing. anything >> that copes with that would be fine. I've just finished setting up jetty to >> do some testing faster, but rails startup is still a pain. >> >> >> >> I'm also not sure about how to distribute the builder. I'd like to be able >> to install a gem and a new generator becomes available or a new Rake task >> shows up. However I don't know how to do this, or if it's possible. We could >> install a Rake task lib from a gem, but I suspect only the Rails tasks and >> those in webapp/lib/tasks are included by default. >> >> Yes, i did take a look about the generator, and noticed that the real >> scripts are >> buried deep inside the rails gem distribution. Of course, "make war" >> will never make part >> of a "standard" rails distribution. wait, maybe a plugin is the way to go ? >> >> Cheers, >> Fausto >> >> >> >> Cheers, >> Robert >> >> >> >> Fausto Lelli wrote: >> Hi Robert, >> >> Although I'm totally swamped at work and a total newbie in these fields, >> I'd like to help. What do you think of Charles proposal of having a >> generator ? >> If that should be the case I think the hardest part is understanding where >> to put on the new stuff, rather than creating the script itself. >> >> The script should zip all the rails-webapp directory itself >> and add the WEB-INF dir filled with the web.xml and the >> lib/rails-integration.jar, >> the only parameter to be passed in being the location of the jruby_home, >> and optionally putting all jruby jars into the lib directory. >> >> Is it correct ? >> Cheers, >> Fausto >> >> On 11/30/06, Robert Egglestone wrote: >> >> >> Building the war file will most likely take the form of a Rake task, >> however as far as I know no-one has had a look at doing this yet. >> I'll have a go at it this weekend. >> >> Cheers, >> Robert >> >> >> >> >> Ashish Sahni wrote: >> Thats great ! For a ruby newbie like can you clarify ... >> >> Currently the ruby dependencies seem to be >> 1. JRuby runtime interpreter >> 2. Rails framework libraries >> 3. Rails-integration glue code >> 4. RoR application code. >> >> Is the goal of the complete-ruby to have all of these dependencies >> bundled as one ? >> Also, how are we envisioning the ruby developers to use this facility to >> go from >> have a RoR app to a war file in one-magical-command ? >> >> Thanks >> Ashish >> >> Charles Oliver Nutter wrote: >> >> >> Ashish Sahni wrote: >> >> >> >> Hi Folks, >> >> I guess one of the (obvious) goals of the rails-integration project would be >> to come up with a simple way via which a standard RoR app can be bundled >> as a WAR file. >> >> Would rake file be the candidate here ? Also, when is >> rails-integration-snapshot >> going to make it as a separate binary downloadable ? >> Any other thoughts on the matter ? >> >> >> I'm obviously super interested in Rails-in-a-WAR, since suddenly Rails >> gets all the deployment benefit of a classic Java web application. And I >> believe it's possible; I already have an ant target that creates a >> complete Ruby interpreter in a single jar; the next step of stuffing >> Rails and a Rails app in there doesn't seem far away... >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/jruby-extras-devel/attachments/20061205/a744f39f/attachment-0001.html From robert at cs.auckland.ac.nz Mon Dec 4 17:42:07 2006 From: robert at cs.auckland.ac.nz (Robert Egglestone) Date: Tue, 05 Dec 2006 11:42:07 +1300 Subject: [Jruby-extras-devel] RailsServlet - MT-safe ? In-Reply-To: <45749D17.6040108@sun.com> References: <45749D17.6040108@sun.com> Message-ID: <4574A43F.1000307@cs.auckland.ac.nz> You're right, that code assumes that both JRuby and rails are mt-safe. I'll add a pool of runtimes to address this, although the Rails load time is likely to become a pain. Cheers, Robert Ashish Sahni wrote: > Hi there, > > //Excerpt from RailsServlet.java > > protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { > // long startTime = System.currentTimeMillis(); > Object[] args = { request, response }; > JavaEmbedUtils.invokeMethod(runtime, dispatcher, "dispatch", args, void.class); > // log("Invocation time: " + (System.currentTimeMillis() - startTime) + "ms"); > } > > By looking at this code it would appear that RailsServlet is not multi-thread safe > since > 1. I had heard that the rails framework itself is not mt-safe > and/or > 2. All requests are handled by the same runtime(jruby-interpreter) instance > > Or am I mistaken and the runtime and rails libraries are capable > of handling multiple concurrent requests ? > > Thanks > Ashish > > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > From fausto.lelli at gmail.com Mon Dec 4 18:25:04 2006 From: fausto.lelli at gmail.com (Fausto Lelli) Date: Tue, 5 Dec 2006 00:25:04 +0100 Subject: [Jruby-extras-devel] WAR'ing a RoR app In-Reply-To: <4574A067.1030506@cs.auckland.ac.nz> References: <456E1EA4.9010102@sun.com> <4570AF84.1050800@cs.auckland.ac.nz> <4570CA0E.7020406@cs.auckland.ac.nz> <4572057A.3060508@cs.auckland.ac.nz> <457344F9.4030409@cs.auckland.ac.nz> <4574A067.1030506@cs.auckland.ac.nz> Message-ID: > Hmm, I'm not sure if I should be worried that File.join isn't generating i've tested, on windwos the command is "jar -C tmp/war ." which results in a jar containint the directory tmp/war/%yourapp% instead jar -C tmp\\war . packages correctly. On 12/4/06, Robert Egglestone wrote: > > Hmm, I'm not sure if I should be worried that File.join isn't generating > paths compatible with the underlying OS. > Moving everything to a library is a good idea. > > > > Fausto Lelli wrote: > Hi Robert, > > > > I've merged in some changes from the two tasks files. > > It seems that the zipped path (tmp/war instead of tmp\\war) has resurfaced. > As far as I can understand, File.join is making its job fine because > the platform > is indeed java, and doing tmp/war in java is correct. But when one > calls "system" and > passes the directory as a parameter to windows shell, the paths must be set > according to the underlaying OS. that's why i was using > java.lang.System.getProperty("os.name") > > Can I suggest to keep the lib/create_war.rb and move there all the code > there, leaving only the rake task declaration in the create_war_tasks.rake? > (I can, I just did ) the lib should be automatically included in the > loadpath, so > the .rake should just need to require the file (and it's more "best > practice" friendly) > > > > svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war > > true! I googled a bit and it results that plugin can be automatically > versioned > using svn. I'll document myself better... > > > > However, I'm a bit hesitant to include commons-logging, because of the > classloader problems it can cause. I think the suggested approach is to > > I'm sorry commons-logging isn't even included in the standart jruby > distribution, > so i guess we can just rule it out. > > P.S: I'm a little overwhelmed by Charles appraisal in his blog today. > Even though > it is true that this a "community" effort, this work is surely a child of > yours. > > Hear you soon, > Fausto > > On 12/3/06, Robert Egglestone wrote: > > > Install seems good with the anonymous svn url: > script/plugin install > svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war > > I've merged in some changes from the two tasks files. > > I've renamed the second bit of the tasks to "create_war:standalone" and > "create_war:shared, to remove the double-create. There's also a default > "create_war" now, which goes to standalone. > > jruby-complete.jar will be great, especially since it includes the standard > libraries. > > However, I'm a bit hesitant to include commons-logging, because of the > classloader problems it can cause. I think the suggested approach is to > include commons-logging-adapters.jar, but this assumes that the web server > includes the api classes. > > > Cheers, > Robert > > Fausto Lelli wrote: > Hi, i committed the plugin as indicated in the previous post > (rails-integrations/plugins/create_war), > but i'm afraid that installing the plugin from url won't work because > there is not direct http access to the svn repository (only through > svnView). > > So, to install the plugin, just copy the create_war dir from svn > into the vendor/plugins/ dir of the rails app and > you should be able to launch the rake create_war task. > > Along with it, I made some fixes relate to windows environment: > 1) *ugly* hack for MAVEN_LOCAL_REPOSITORY not being present > (-- you may want to review this for good --) > 2) webapp name fished in > from$webapp_name/vendor/plugins/creator_war/task > 3) staging for windows is "tmp\\war" instead of "tmp/war" > > I tested standalone mode, and needed to add manually the following jars > in the WEB-INF/lib directory of the generated war: > bsf.war,commons-logging.1.0.4.jar,commons-logging-api.jar, > emma.jar,emma_ant.jar,jvyaml.jar,plaincharset.jar. > Maybe one could consider using the jruby-complete.jar for > including jruby as a whole > (http://headius.blogspot.com/2006/11/advanced-rails-deployment-with-jruby.html) > > Apart from that, the packaging for war in windows seems to be ok. > > Cheers, > Fausto > > > > On 12/3/06, Robert Egglestone wrote: > > > That's great, thanks. > That repository url and "create_war" are good. > > Cheers, Robert > > > Fausto Lelli wrote: > Hi all, > > I've set up a plugin that calls the rake script you've made but need to > find a place in the svn to put it. > This is somewhat relevant because users will need the install the plugin > with a repository url like > ./script/plugin install \ > svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war > or something. > > I've also testing the rake task under windows but I have this (very natural) > problem: > rake aborted! > couldn't find HOME environment -- expanding `~/.m2/repository' > C:/Workspace32/rails-integration/samples/helloworld-rake/rakefile:10 > I'll submit a patch soon. > > Oh, accidentally I rechristianized the task from "war" to "create_war" > (as the name > of the plugin), can we eventually keep this ? > > Cheers, > Fausto > > On 12/2/06, Robert Egglestone wrote: > > > I'm thinking of a standalone war being one that includes all jars and gems > that are required to run it, so that it has no external dependencies. > Shared wars are something I'm still a bit fuzzy on what's best to include. > It could be no libraries, or just the Java libraries, or perhaps a subset of > them. > > I've got a packaging script together in Ruby now, it's currently sitting > included in the helloworld-rake as a Rake task. I haven't tried it on > Windows yet. > > Do you want to look into the best way of packaging up a plugin or task or > something that we can distribute? > > > Cheers, > Robert > > > Fausto Lelli wrote: > On 12/1/06, Robert Egglestone wrote: > > > > Regardless of how it's exposed, if it's written in Ruby will allow us to > make better packaging decisions than were possible previously. For example, > having the routing information means we don't need FileServlet. > > Yep. On the other side java has the zip-stream support out of the box. > I already have a java routine that packages a directory tree in a zip, > modifing it to make a war file should be trivial. I don't know about Ruby, > does one have to install the ruby-zip gem as an extra step ? > > > > I guess we have to support at least a standalone war, a shared war (no > JRuby or gems inside the war), and a normal Rails webapp on disk. The extra > gems required for a standalone war mean a bit more work is required. > > not sure about terminology here. with standalone war do you mean with > WEB-INF/lib/jruby.jar,emma.jar, ecc and shared war without these jars ? > One other thing one could do is producing a context.xml file to put under > the conf directory of tomcat to launch the webapp anywhere in the > filesystem. > At least for tomcat. > > > > One area I'm not sure about is the rb.ast compilation. Should we aim to do > this to all packaged Ruby files? Currently Rails loads slowly, will this > significantly speed it up? > > I'll shamelessly say that I don't know what the rb.ast compilation is. > Anyway slowliness of rails startup is problem #1 for testing. anything > that copes with that would be fine. I've just finished setting up jetty to > do some testing faster, but rails startup is still a pain. > > > > I'm also not sure about how to distribute the builder. I'd like to be able > to install a gem and a new generator becomes available or a new Rake task > shows up. However I don't know how to do this, or if it's possible. We could > install a Rake task lib from a gem, but I suspect only the Rails tasks and > those in webapp/lib/tasks are included by default. > > Yes, i did take a look about the generator, and noticed that the real > scripts are > buried deep inside the rails gem distribution. Of course, "make war" > will never make part > of a "standard" rails distribution. wait, maybe a plugin is the way to go ? > > Cheers, > Fausto > > > > Cheers, > Robert > > > > Fausto Lelli wrote: > Hi Robert, > > Although I'm totally swamped at work and a total newbie in these fields, > I'd like to help. What do you think of Charles proposal of having a > generator ? > If that should be the case I think the hardest part is understanding where > to put on the new stuff, rather than creating the script itself. > > The script should zip all the rails-webapp directory itself > and add the WEB-INF dir filled with the web.xml and the > lib/rails-integration.jar, > the only parameter to be passed in being the location of the jruby_home, > and optionally putting all jruby jars into the lib directory. > > Is it correct ? > Cheers, > Fausto > > On 11/30/06, Robert Egglestone wrote: > > > Building the war file will most likely take the form of a Rake task, > however as far as I know no-one has had a look at doing this yet. > I'll have a go at it this weekend. > > Cheers, > Robert > > > > > Ashish Sahni wrote: > Thats great ! For a ruby newbie like can you clarify ... > > Currently the ruby dependencies seem to be > 1. JRuby runtime interpreter > 2. Rails framework libraries > 3. Rails-integration glue code > 4. RoR application code. > > Is the goal of the complete-ruby to have all of these dependencies > bundled as one ? > Also, how are we envisioning the ruby developers to use this facility to > go from > have a RoR app to a war file in one-magical-command ? > > Thanks > Ashish > > Charles Oliver Nutter wrote: > > > Ashish Sahni wrote: > > > > Hi Folks, > > I guess one of the (obvious) goals of the rails-integration project would be > to come up with a simple way via which a standard RoR app can be bundled > as a WAR file. > > Would rake file be the candidate here ? Also, when is > rails-integration-snapshot > going to make it as a separate binary downloadable ? > Any other thoughts on the matter ? > > > I'm obviously super interested in Rails-in-a-WAR, since suddenly Rails > gets all the deployment benefit of a classic Java web application. And I > believe it's possible; I already have an ant target that creates a > complete Ruby interpreter in a single jar; the next step of stuffing > Rails and a Rails app in there doesn't seem far away... > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > From robert at cs.auckland.ac.nz Mon Dec 4 18:50:40 2006 From: robert at cs.auckland.ac.nz (Robert Egglestone) Date: Tue, 05 Dec 2006 12:50:40 +1300 Subject: [Jruby-extras-devel] RailsServlet - MT-safe ? In-Reply-To: <4574A43F.1000307@cs.auckland.ac.nz> References: <45749D17.6040108@sun.com> <4574A43F.1000307@cs.auckland.ac.nz> Message-ID: <4574B450.8020707@cs.auckland.ac.nz> I've checked in a change that uses commons-pool to handle each concurrent request in a separate runtime. Robert Egglestone wrote: > You're right, that code assumes that both JRuby and rails are mt-safe. > I'll add a pool of runtimes to address this, although the Rails load > time is likely to become a pain. > > Cheers, > Robert > > > Ashish Sahni wrote: > >> Hi there, >> >> //Excerpt from RailsServlet.java >> >> protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { >> // long startTime = System.currentTimeMillis(); >> Object[] args = { request, response }; >> JavaEmbedUtils.invokeMethod(runtime, dispatcher, "dispatch", args, void.class); >> // log("Invocation time: " + (System.currentTimeMillis() - startTime) + "ms"); >> } >> >> By looking at this code it would appear that RailsServlet is not multi-thread safe >> since >> 1. I had heard that the rails framework itself is not mt-safe >> and/or >> 2. All requests are handled by the same runtime(jruby-interpreter) instance >> >> Or am I mistaken and the runtime and rails libraries are capable >> of handling multiple concurrent requests ? >> >> Thanks >> Ashish >> >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/jruby-extras-devel/attachments/20061205/5afa2175/attachment.html From Keefe.Hayes at sas.com Tue Dec 5 08:27:54 2006 From: Keefe.Hayes at sas.com (Keefe Hayes) Date: Tue, 5 Dec 2006 08:27:54 -0500 Subject: [Jruby-extras-devel] DB2 JDBC interprets IDs as strings Message-ID: Regarding the interpretation of ids as strings in show/edit actions, I see that the id is read from the web page as a string. def show @photo = Photo.find(params[:id]) end and gets passed up through the find methods into sanitize() and quote() as a String. No metadata is consulted. If I change the method to this it works def show @photo = Photo.find(params[:id].to_i) end I looked at some of the other database adapter quote methods and I am not sure why they work unless DB2 is just particularly picky about using a numeric string as a search value for an integer type, i.e. this works for other databases but not DB2: Select * from where id = '1'; From Keefe.Hayes at sas.com Tue Dec 5 08:52:12 2006 From: Keefe.Hayes at sas.com (Keefe Hayes) Date: Tue, 5 Dec 2006 08:52:12 -0500 Subject: [Jruby-extras-devel] DB2 TIMESTAMP has scale Message-ID: The DB2 TIMESTAMP data type can have a scale for fractional seconds of up to 6. From the "Scale of SQL data types" for DB2: SQL_TYPE_TIMESTAMP The number of digits to the right of the decimal point in the "yyyy-mm-dd hh:mm:ss[fff[fff]]" format. For example, if the TIMESTAMP data type uses the "yyyy-mm-dd hh:mm:ss.fff" format, the scale is 3. The maximum for fractional seconds is 6 digits. A timestamp column created like this with a migration: add_column "photos", "created_at", :datetime created a TIMESTAMP(26) column, which has a scale of 6. When rendered, the convert_jdbc_type_to_ruby method in jdbc_adapter.rb interprets the data as a float: def convert_jdbc_type_to_ruby(row, type, scale, resultset) if scale != 0 decimal = resultset.getString(row) decimal.to_f else case type ... end end end So that the created_at date looks like this: 2006.0 And when the value is used as a DB2 type it fails due to mismatch. This works better: if scale != 0 && type != Jdbc::Types::TIMESTAMP From nicksieger at gmail.com Tue Dec 5 09:02:54 2006 From: nicksieger at gmail.com (Nick Sieger) Date: Tue, 5 Dec 2006 08:02:54 -0600 Subject: [Jruby-extras-devel] DB2 JDBC interprets IDs as strings In-Reply-To: References: Message-ID: On 12/5/06, Keefe Hayes wrote: > > Regarding the interpretation of ids as strings in show/edit actions, I see > that the id is read from the web page as a string. > > def show > @photo = Photo.find(params[:id]) > end > > and gets passed up through the find methods into sanitize() and quote() as > a String. No metadata is consulted. If I change the method to this it works > > def show > @photo = Photo.find(params[:id].to_i) > end > > I looked at some of the other database adapter quote methods and I am not > sure why they work unless DB2 is just particularly picky about using a > numeric string as a search value for an integer type, i.e. this works for > other databases but not DB2: > > Select * from
where id = '1'; Do you have the ability to try C Ruby with the native DB2 driver [1]? Perhaps you could compare the behavior. I wouldn't be surprised if it was a JDBC adapter bug. Have you looked at the ActiveRecord-JDBC source yet to see if anything stands out? /Nick [1] http://wiki.rubyonrails.com/rails/pages/IBM+DB2 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/jruby-extras-devel/attachments/20061205/70999e9b/attachment.html From nicksieger at gmail.com Tue Dec 5 09:06:56 2006 From: nicksieger at gmail.com (Nick Sieger) Date: Tue, 5 Dec 2006 08:06:56 -0600 Subject: [Jruby-extras-devel] DB2 TIMESTAMP has scale In-Reply-To: References: Message-ID: On 12/5/06, Keefe Hayes wrote: > > The DB2 TIMESTAMP data type can have a scale for fractional seconds of up > to 6. > So that the created_at date looks like this: > > 2006.0 > > And when the value is used as a DB2 type it fails due to mismatch. This > works better: > > if scale != 0 && type != Jdbc::Types::TIMESTAMP Thanks for catching this. I've checked the change into SVN (rev 172), if you want to pull it from there. /Nick -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/jruby-extras-devel/attachments/20061205/67ffc181/attachment.html From Keefe.Hayes at sas.com Wed Dec 6 12:30:34 2006 From: Keefe.Hayes at sas.com (Keefe Hayes) Date: Wed, 6 Dec 2006 12:30:34 -0500 Subject: [Jruby-extras-devel] DB2 JDBC interprets IDs as strings Message-ID: This syntax does not work with DB2 if id is a numeric type: select * from
where id ='1'; DB2 will not coerce the types to match. The DB2 on Rails ibm_db2_adapter.rb code rewrites the ActiveRecord::Base find_one, find_some, and other methods to "Override the default method to avoid quoting numeric variables". Each method checks if this is a DB2 connection, and if so queries the data base to determine the type of the primary key. I am a novice with Ruby. Can anyone suggest how I would determine the connection type and request the column type information from within the find_one method? Thanks From Ashish.Sahni at Sun.COM Wed Dec 6 14:17:02 2006 From: Ashish.Sahni at Sun.COM (Ashish Sahni) Date: Wed, 06 Dec 2006 11:17:02 -0800 Subject: [Jruby-extras-devel] RailsServlet - MT-safe ? In-Reply-To: <4574B450.8020707@cs.auckland.ac.nz> References: <45749D17.6040108@sun.com> <4574A43F.1000307@cs.auckland.ac.nz> <4574B450.8020707@cs.auckland.ac.nz> Message-ID: <4577172E.5070307@sun.com> Thanks ! Could you please add the commons-pool dependency in build.xml for those of us ant ? :) -Ashish Robert Egglestone wrote: > I've checked in a change that uses commons-pool to handle each > concurrent request in a separate runtime. > > > Robert Egglestone wrote: > >>You're right, that code assumes that both JRuby and rails are mt-safe. >>I'll add a pool of runtimes to address this, although the Rails load >>time is likely to become a pain. >> >>Cheers, >>Robert >> >> >>Ashish Sahni wrote: >> >> >>>Hi there, >>> >>>//Excerpt from RailsServlet.java >>> >>> protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { >>> // long startTime = System.currentTimeMillis(); >>> Object[] args = { request, response }; >>> JavaEmbedUtils.invokeMethod(runtime, dispatcher, "dispatch", args, void.class); >>> // log("Invocation time: " + (System.currentTimeMillis() - startTime) + "ms"); >>> } >>> >>>By looking at this code it would appear that RailsServlet is not multi-thread safe >>>since >>>1. I had heard that the rails framework itself is not mt-safe >>>and/or >>>2. All requests are handled by the same runtime(jruby-interpreter) instance >>> >>>Or am I mistaken and the runtime and rails libraries are capable >>>of handling multiple concurrent requests ? >>> >>>Thanks >>>Ashish >>> >>> >>> >>> >>>_______________________________________________ >>>Jruby-extras-devel mailing list >>>Jruby-extras-devel at rubyforge.org >>>http://rubyforge.org/mailman/listinfo/jruby-extras-devel >>> >>> >>> >>_______________________________________________ >>Jruby-extras-devel mailing list >>Jruby-extras-devel at rubyforge.org >>http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >------------------------------------------------------------------------ > >_______________________________________________ >Jruby-extras-devel mailing list >Jruby-extras-devel at rubyforge.org >http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > From steven_parkes at esseff.org Wed Dec 6 16:31:25 2006 From: steven_parkes at esseff.org (Steven Parkes) Date: Wed, 6 Dec 2006 13:31:25 -0800 Subject: [Jruby-extras-devel] AR-JDBC and decimal columns Message-ID: <392521EA2692A2418DF48C331E61E32506A9BD@professorville.windows.esseff.org> context: jruby trunk, rails trunk, AR-JDBC 0.2.2 but the code looks the same in trunk It looks like AR-JDBC is getting a little messed up on decimal columns. When inserting data, the fractional part is being dropped in the generated SQL. I've traced it back as far as columns in jdbc_adapter.rb. This generates a type name that doesn't have the precision. Without it, the code that generates the sql casts the provide float down to an integer. Given the way the string is generated in jdbc_adapter.rb, I'm not sure the best way to approach this. From nicksieger at gmail.com Wed Dec 6 17:25:22 2006 From: nicksieger at gmail.com (Nick Sieger) Date: Wed, 6 Dec 2006 16:25:22 -0600 Subject: [Jruby-extras-devel] AR-JDBC and decimal columns In-Reply-To: <392521EA2692A2418DF48C331E61E32506A9BD@professorville.windows.esseff.org> References: <392521EA2692A2418DF48C331E61E32506A9BD@professorville.windows.esseff.org> Message-ID: On 12/6/06, Steven Parkes wrote: > > context: jruby trunk, rails trunk, AR-JDBC 0.2.2 but the code looks the > same in trunk > > It looks like AR-JDBC is getting a little messed up on decimal columns. > When inserting data, the fractional part is being dropped in the > generated SQL. > > I've traced it back as far as columns in jdbc_adapter.rb. > > This generates a type name that doesn't have the precision. Without it, > the code that generates the sql casts the provide float down to an > integer. > > Given the way the string is generated in jdbc_adapter.rb, I'm not sure > the best way to approach this. Maybe one of these tracker issues is similar to yours? http://rubyforge.org/tracker/?atid=7857&group_id=2014&func=browse If not, could you please file a new ticket along with a simple snippet/test that reproduces the problem. Thanks, /Nick -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/jruby-extras-devel/attachments/20061206/0a2637ea/attachment.html From steven_parkes at esseff.org Wed Dec 6 17:49:50 2006 From: steven_parkes at esseff.org (Steven Parkes) Date: Wed, 6 Dec 2006 14:49:50 -0800 Subject: [Jruby-extras-devel] AR-JDBC and decimal columns Message-ID: <392521EA2692A2418DF48C331E61E32506A9BE@professorville.windows.esseff.org> Yeah, http://rubyforge.org/tracker/?func=detail&atid=7857&aid=7120&group_id=20 14 is mine. I've updated it. In the interim, I'm interested in suggestions for fixing it / working around it. I've looked at mapping all decimal columns to decimal. Derby, at least, won't complain that ruby doesn't get rid of the fractional part. ________________________________ From: jruby-extras-devel-bounces at rubyforge.org [mailto:jruby-extras-devel-bounces at rubyforge.org] On Behalf Of Nick Sieger Sent: Wednesday, December 06, 2006 2:25 PM To: jruby-extras-devel at rubyforge.org Subject: Re: [Jruby-extras-devel] AR-JDBC and decimal columns On 12/6/06, Steven Parkes wrote: context: jruby trunk, rails trunk, AR-JDBC 0.2.2 but the code looks the same in trunk It looks like AR-JDBC is getting a little messed up on decimal columns. When inserting data, the fractional part is being dropped in the generated SQL. I've traced it back as far as columns in jdbc_adapter.rb. This generates a type name that doesn't have the precision. Without it, the code that generates the sql casts the provide float down to an integer. Given the way the string is generated in jdbc_adapter.rb, I'm not sure the best way to approach this. Maybe one of these tracker issues is similar to yours? http://rubyforge.org/tracker/?atid=7857&group_id=2014&func=browse If not, could you please file a new ticket along with a simple snippet/test that reproduces the problem. Thanks, /Nick From robert at cs.auckland.ac.nz Wed Dec 6 22:42:52 2006 From: robert at cs.auckland.ac.nz (Robert Egglestone) Date: Thu, 07 Dec 2006 16:42:52 +1300 Subject: [Jruby-extras-devel] WAR'ing a RoR app In-Reply-To: References: <456E1EA4.9010102@sun.com> <4570AF84.1050800@cs.auckland.ac.nz> <4570CA0E.7020406@cs.auckland.ac.nz> <4572057A.3060508@cs.auckland.ac.nz> <457344F9.4030409@cs.auckland.ac.nz> <4574A067.1030506@cs.auckland.ac.nz> Message-ID: <45778DBC.7000609@cs.auckland.ac.nz> Apologies for the number of times I've broken this. I've tested it using on Windows as well now (using both Ruby and JRuby), so I hope it's good this time. I've moved out all the content into a separate library as you suggested. I've introduced a separate class to hold all the configuration information that was previously scattered around the place. After adding some task descriptions I noticed that the other Rake tasks had a convention of "object:action", so I've changed the task names to fit in with this - war:standalone:create and war:shared:create. However we've also got aliases for all the other names we've used. Cheers, Robert Fausto Lelli wrote: >> Hmm, I'm not sure if I should be worried that File.join isn't generating >> > i've tested, on windwos the command is > "jar -C tmp/war ." which results in a jar containint the directory > tmp/war/%yourapp% > instead jar -C tmp\\war . packages correctly. > > On 12/4/06, Robert Egglestone wrote: > >> Hmm, I'm not sure if I should be worried that File.join isn't generating >> paths compatible with the underlying OS. >> Moving everything to a library is a good idea. >> >> >> >> Fausto Lelli wrote: >> Hi Robert, >> >> >> >> I've merged in some changes from the two tasks files. >> >> It seems that the zipped path (tmp/war instead of tmp\\war) has resurfaced. >> As far as I can understand, File.join is making its job fine because >> the platform >> is indeed java, and doing tmp/war in java is correct. But when one >> calls "system" and >> passes the directory as a parameter to windows shell, the paths must be set >> according to the underlaying OS. that's why i was using >> java.lang.System.getProperty("os.name") >> >> Can I suggest to keep the lib/create_war.rb and move there all the code >> there, leaving only the rake task declaration in the create_war_tasks.rake? >> (I can, I just did ) the lib should be automatically included in the >> loadpath, so >> the .rake should just need to require the file (and it's more "best >> practice" friendly) >> >> >> >> svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war >> >> true! I googled a bit and it results that plugin can be automatically >> versioned >> using svn. I'll document myself better... >> >> >> >> However, I'm a bit hesitant to include commons-logging, because of the >> classloader problems it can cause. I think the suggested approach is to >> >> I'm sorry commons-logging isn't even included in the standart jruby >> distribution, >> so i guess we can just rule it out. >> >> P.S: I'm a little overwhelmed by Charles appraisal in his blog today. >> Even though >> it is true that this a "community" effort, this work is surely a child of >> yours. >> >> Hear you soon, >> Fausto >> >> On 12/3/06, Robert Egglestone wrote: >> >> >> Install seems good with the anonymous svn url: >> script/plugin install >> svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war >> >> I've merged in some changes from the two tasks files. >> >> I've renamed the second bit of the tasks to "create_war:standalone" and >> "create_war:shared, to remove the double-create. There's also a default >> "create_war" now, which goes to standalone. >> >> jruby-complete.jar will be great, especially since it includes the standard >> libraries. >> >> However, I'm a bit hesitant to include commons-logging, because of the >> classloader problems it can cause. I think the suggested approach is to >> include commons-logging-adapters.jar, but this assumes that the web server >> includes the api classes. >> >> >> Cheers, >> Robert >> >> Fausto Lelli wrote: >> Hi, i committed the plugin as indicated in the previous post >> (rails-integrations/plugins/create_war), >> but i'm afraid that installing the plugin from url won't work because >> there is not direct http access to the svn repository (only through >> svnView). >> >> So, to install the plugin, just copy the create_war dir from svn >> into the vendor/plugins/ dir of the rails app and >> you should be able to launch the rake create_war task. >> >> Along with it, I made some fixes relate to windows environment: >> 1) *ugly* hack for MAVEN_LOCAL_REPOSITORY not being present >> (-- you may want to review this for good --) >> 2) webapp name fished in >> from$webapp_name/vendor/plugins/creator_war/task >> 3) staging for windows is "tmp\\war" instead of "tmp/war" >> >> I tested standalone mode, and needed to add manually the following jars >> in the WEB-INF/lib directory of the generated war: >> bsf.war,commons-logging.1.0.4.jar,commons-logging-api.jar, >> emma.jar,emma_ant.jar,jvyaml.jar,plaincharset.jar. >> Maybe one could consider using the jruby-complete.jar for >> including jruby as a whole >> (http://headius.blogspot.com/2006/11/advanced-rails-deployment-with-jruby.html) >> >> Apart from that, the packaging for war in windows seems to be ok. >> >> Cheers, >> Fausto >> >> >> >> On 12/3/06, Robert Egglestone wrote: >> >> >> That's great, thanks. >> That repository url and "create_war" are good. >> >> Cheers, Robert >> >> >> Fausto Lelli wrote: >> Hi all, >> >> I've set up a plugin that calls the rake script you've made but need to >> find a place in the svn to put it. >> This is somewhat relevant because users will need the install the plugin >> with a repository url like >> ./script/plugin install \ >> svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war >> or something. >> >> I've also testing the rake task under windows but I have this (very natural) >> problem: >> rake aborted! >> couldn't find HOME environment -- expanding `~/.m2/repository' >> C:/Workspace32/rails-integration/samples/helloworld-rake/rakefile:10 >> I'll submit a patch soon. >> >> Oh, accidentally I rechristianized the task from "war" to "create_war" >> (as the name >> of the plugin), can we eventually keep this ? >> >> Cheers, >> Fausto >> >> On 12/2/06, Robert Egglestone wrote: >> >> >> I'm thinking of a standalone war being one that includes all jars and gems >> that are required to run it, so that it has no external dependencies. >> Shared wars are something I'm still a bit fuzzy on what's best to include. >> It could be no libraries, or just the Java libraries, or perhaps a subset of >> them. >> >> I've got a packaging script together in Ruby now, it's currently sitting >> included in the helloworld-rake as a Rake task. I haven't tried it on >> Windows yet. >> >> Do you want to look into the best way of packaging up a plugin or task or >> something that we can distribute? >> >> >> Cheers, >> Robert >> >> >> Fausto Lelli wrote: >> On 12/1/06, Robert Egglestone wrote: >> >> >> >> Regardless of how it's exposed, if it's written in Ruby will allow us to >> make better packaging decisions than were possible previously. For example, >> having the routing information means we don't need FileServlet. >> >> Yep. On the other side java has the zip-stream support out of the box. >> I already have a java routine that packages a directory tree in a zip, >> modifing it to make a war file should be trivial. I don't know about Ruby, >> does one have to install the ruby-zip gem as an extra step ? >> >> >> >> I guess we have to support at least a standalone war, a shared war (no >> JRuby or gems inside the war), and a normal Rails webapp on disk. The extra >> gems required for a standalone war mean a bit more work is required. >> >> not sure about terminology here. with standalone war do you mean with >> WEB-INF/lib/jruby.jar,emma.jar, ecc and shared war without these jars ? >> One other thing one could do is producing a context.xml file to put under >> the conf directory of tomcat to launch the webapp anywhere in the >> filesystem. >> At least for tomcat. >> >> >> >> One area I'm not sure about is the rb.ast compilation. Should we aim to do >> this to all packaged Ruby files? Currently Rails loads slowly, will this >> significantly speed it up? >> >> I'll shamelessly say that I don't know what the rb.ast compilation is. >> Anyway slowliness of rails startup is problem #1 for testing. anything >> that copes with that would be fine. I've just finished setting up jetty to >> do some testing faster, but rails startup is still a pain. >> >> >> >> I'm also not sure about how to distribute the builder. I'd like to be able >> to install a gem and a new generator becomes available or a new Rake task >> shows up. However I don't know how to do this, or if it's possible. We could >> install a Rake task lib from a gem, but I suspect only the Rails tasks and >> those in webapp/lib/tasks are included by default. >> >> Yes, i did take a look about the generator, and noticed that the real >> scripts are >> buried deep inside the rails gem distribution. Of course, "make war" >> will never make part >> of a "standard" rails distribution. wait, maybe a plugin is the way to go ? >> >> Cheers, >> Fausto >> >> >> >> Cheers, >> Robert >> >> >> >> Fausto Lelli wrote: >> Hi Robert, >> >> Although I'm totally swamped at work and a total newbie in these fields, >> I'd like to help. What do you think of Charles proposal of having a >> generator ? >> If that should be the case I think the hardest part is understanding where >> to put on the new stuff, rather than creating the script itself. >> >> The script should zip all the rails-webapp directory itself >> and add the WEB-INF dir filled with the web.xml and the >> lib/rails-integration.jar, >> the only parameter to be passed in being the location of the jruby_home, >> and optionally putting all jruby jars into the lib directory. >> >> Is it correct ? >> Cheers, >> Fausto >> >> On 11/30/06, Robert Egglestone wrote: >> >> >> Building the war file will most likely take the form of a Rake task, >> however as far as I know no-one has had a look at doing this yet. >> I'll have a go at it this weekend. >> >> Cheers, >> Robert >> >> >> >> >> Ashish Sahni wrote: >> Thats great ! For a ruby newbie like can you clarify ... >> >> Currently the ruby dependencies seem to be >> 1. JRuby runtime interpreter >> 2. Rails framework libraries >> 3. Rails-integration glue code >> 4. RoR application code. >> >> Is the goal of the complete-ruby to have all of these dependencies >> bundled as one ? >> Also, how are we envisioning the ruby developers to use this facility to >> go from >> have a RoR app to a war file in one-magical-command ? >> >> Thanks >> Ashish >> >> Charles Oliver Nutter wrote: >> >> >> Ashish Sahni wrote: >> >> >> >> Hi Folks, >> >> I guess one of the (obvious) goals of the rails-integration project would be >> to come up with a simple way via which a standard RoR app can be bundled >> as a WAR file. >> >> Would rake file be the candidate here ? Also, when is >> rails-integration-snapshot >> going to make it as a separate binary downloadable ? >> Any other thoughts on the matter ? >> >> >> I'm obviously super interested in Rails-in-a-WAR, since suddenly Rails >> gets all the deployment benefit of a classic Java web application. And I >> believe it's possible; I already have an ant target that creates a >> complete Ruby interpreter in a single jar; the next step of stuffing >> Rails and a Rails app in there doesn't seem far away... >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> >> >> > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/jruby-extras-devel/attachments/20061207/73098fbb/attachment-0001.html From superchrisnelson at gmail.com Thu Dec 7 19:38:56 2006 From: superchrisnelson at gmail.com (Chris Nelson) Date: Thu, 7 Dec 2006 19:38:56 -0500 Subject: [Jruby-extras-devel] Added a bug for JRuby on Rails date issue In-Reply-To: <4570E08D.6050501@sun.com> References: <4570E08D.6050501@sun.com> Message-ID: Ok, done, jruby-338. Seems like the problem is somehow down in rational.rb which is called from date.today. I'll poke at it some more, but since I'm a relative Ruby newbie I'm not sure how much headway I'll make. I had the guy who wrote Rake also look at it a little (he works with me) and he wasn't able to find it either yet. --Chris On 12/1/06, Charles Oliver Nutter wrote: > Chris Nelson wrote: > > Guys, > > > > I added a bug in the Jruby-extras tracker for the problemn I and > > Ashish have been seeing with scaffolded apps and the Rails date > > picker. It's pretty easy to reproduce I think, but without a real > > good way to debug jruby scripts (if someone has an idea here i'm all > > ears!) I'm not sure how to go about looking into it more. > > > > Here is the link: > > http://rubyforge.org/tracker/?func=detail&aid=6906&group_id=2014&atid=7857 > > I'm guessing this is probably a JRuby issue...have you entered a bug in > the JRuby JIRA for this too? Of course having it narrowed down more > helps, but getting it in there guarantees we'll *eventually* fix it. > > -- > Charles Oliver Nutter, JRuby Core Developer > Blogging on Ruby and Java @ headius.blogspot.com > Help spec out Ruby today! @ www.headius.com/rubyspec > headius at headius.com -- charles.nutter at sun.com > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > From fausto.lelli at gmail.com Fri Dec 8 05:21:43 2006 From: fausto.lelli at gmail.com (Fausto Lelli) Date: Fri, 8 Dec 2006 11:21:43 +0100 Subject: [Jruby-extras-devel] WAR'ing a RoR app In-Reply-To: <45778DBC.7000609@cs.auckland.ac.nz> References: <456E1EA4.9010102@sun.com> <4570CA0E.7020406@cs.auckland.ac.nz> <4572057A.3060508@cs.auckland.ac.nz> <457344F9.4030409@cs.auckland.ac.nz> <4574A067.1030506@cs.auckland.ac.nz> <45778DBC.7000609@cs.auckland.ac.nz> Message-ID: perfect, maybe the jvyaml.jar is also to be included in the WEB-INF/lib in standalone mode Cheers F. On 12/7/06, Robert Egglestone wrote: > > Apologies for the number of times I've broken this. I've tested it using on > Windows as well now (using both Ruby and JRuby), so I hope it's good this > time. > I've moved out all the content into a separate library as you suggested. > I've introduced a separate class to hold all the configuration information > that was previously scattered around the place. > > After adding some task descriptions I noticed that the other Rake tasks had > a convention of "object:action", so I've changed the task names to fit in > with this - war:standalone:create and war:shared:create. However we've also > got aliases for all the other names we've used. > > > Cheers, > Robert > > > Fausto Lelli wrote: > > Hmm, I'm not sure if I should be worried that File.join isn't generating > > i've tested, on windwos the command is > "jar -C tmp/war ." which results in a jar containint the directory > tmp/war/%yourapp% > instead jar -C tmp\\war . packages correctly. > > On 12/4/06, Robert Egglestone wrote: > > > Hmm, I'm not sure if I should be worried that File.join isn't generating > paths compatible with the underlying OS. > Moving everything to a library is a good idea. > > > > Fausto Lelli wrote: > Hi Robert, > > > > I've merged in some changes from the two tasks files. > > It seems that the zipped path (tmp/war instead of tmp\\war) has resurfaced. > As far as I can understand, File.join is making its job fine because > the platform > is indeed java, and doing tmp/war in java is correct. But when one > calls "system" and > passes the directory as a parameter to windows shell, the paths must be set > according to the underlaying OS. that's why i was using > java.lang.System.getProperty("os.name") > > Can I suggest to keep the lib/create_war.rb and move there all the code > there, leaving only the rake task declaration in the create_war_tasks.rake? > (I can, I just did ) the lib should be automatically included in the > loadpath, so > the .rake should just need to require the file (and it's more "best > practice" friendly) > > > > svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war > > true! I googled a bit and it results that plugin can be automatically > versioned > using svn. I'll document myself better... > > > > However, I'm a bit hesitant to include commons-logging, because of the > classloader problems it can cause. I think the suggested approach is to > > I'm sorry commons-logging isn't even included in the standart jruby > distribution, > so i guess we can just rule it out. > > P.S: I'm a little overwhelmed by Charles appraisal in his blog today. > Even though > it is true that this a "community" effort, this work is surely a child of > yours. > > Hear you soon, > Fausto > > On 12/3/06, Robert Egglestone wrote: > > > Install seems good with the anonymous svn url: > script/plugin install > svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war > > I've merged in some changes from the two tasks files. > > I've renamed the second bit of the tasks to "create_war:standalone" and > "create_war:shared, to remove the double-create. There's also a default > "create_war" now, which goes to standalone. > > jruby-complete.jar will be great, especially since it includes the standard > libraries. > > However, I'm a bit hesitant to include commons-logging, because of the > classloader problems it can cause. I think the suggested approach is to > include commons-logging-adapters.jar, but this assumes that the web server > includes the api classes. > > > Cheers, > Robert > > Fausto Lelli wrote: > Hi, i committed the plugin as indicated in the previous post > (rails-integrations/plugins/create_war), > but i'm afraid that installing the plugin from url won't work because > there is not direct http access to the svn repository (only through > svnView). > > So, to install the plugin, just copy the create_war dir from svn > into the vendor/plugins/ dir of the rails app and > you should be able to launch the rake create_war task. > > Along with it, I made some fixes relate to windows environment: > 1) *ugly* hack for MAVEN_LOCAL_REPOSITORY not being present > (-- you may want to review this for good --) > 2) webapp name fished in > from$webapp_name/vendor/plugins/creator_war/task > 3) staging for windows is "tmp\\war" instead of "tmp/war" > > I tested standalone mode, and needed to add manually the following jars > in the WEB-INF/lib directory of the generated war: > bsf.war,commons-logging.1.0.4.jar,commons-logging-api.jar, > emma.jar,emma_ant.jar,jvyaml.jar,plaincharset.jar. > Maybe one could consider using the jruby-complete.jar for > including jruby as a whole > (http://headius.blogspot.com/2006/11/advanced-rails-deployment-with-jruby.html) > > Apart from that, the packaging for war in windows seems to be ok. > > Cheers, > Fausto > > > > On 12/3/06, Robert Egglestone wrote: > > > That's great, thanks. > That repository url and "create_war" are good. > > Cheers, Robert > > > Fausto Lelli wrote: > Hi all, > > I've set up a plugin that calls the rake script you've made but need to > find a place in the svn to put it. > This is somewhat relevant because users will need the install the plugin > with a repository url like > ./script/plugin install \ > svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war > or something. > > I've also testing the rake task under windows but I have this (very natural) > problem: > rake aborted! > couldn't find HOME environment -- expanding `~/.m2/repository' > C:/Workspace32/rails-integration/samples/helloworld-rake/rakefile:10 > I'll submit a patch soon. > > Oh, accidentally I rechristianized the task from "war" to "create_war" > (as the name > of the plugin), can we eventually keep this ? > > Cheers, > Fausto > > On 12/2/06, Robert Egglestone wrote: > > > I'm thinking of a standalone war being one that includes all jars and gems > that are required to run it, so that it has no external dependencies. > Shared wars are something I'm still a bit fuzzy on what's best to include. > It could be no libraries, or just the Java libraries, or perhaps a subset of > them. > > I've got a packaging script together in Ruby now, it's currently sitting > included in the helloworld-rake as a Rake task. I haven't tried it on > Windows yet. > > Do you want to look into the best way of packaging up a plugin or task or > something that we can distribute? > > > Cheers, > Robert > > > Fausto Lelli wrote: > On 12/1/06, Robert Egglestone wrote: > > > > Regardless of how it's exposed, if it's written in Ruby will allow us to > make better packaging decisions than were possible previously. For example, > having the routing information means we don't need FileServlet. > > Yep. On the other side java has the zip-stream support out of the box. > I already have a java routine that packages a directory tree in a zip, > modifing it to make a war file should be trivial. I don't know about Ruby, > does one have to install the ruby-zip gem as an extra step ? > > > > I guess we have to support at least a standalone war, a shared war (no > JRuby or gems inside the war), and a normal Rails webapp on disk. The extra > gems required for a standalone war mean a bit more work is required. > > not sure about terminology here. with standalone war do you mean with > WEB-INF/lib/jruby.jar,emma.jar, ecc and shared war without these jars ? > One other thing one could do is producing a context.xml file to put under > the conf directory of tomcat to launch the webapp anywhere in the > filesystem. > At least for tomcat. > > > > One area I'm not sure about is the rb.ast compilation. Should we aim to do > this to all packaged Ruby files? Currently Rails loads slowly, will this > significantly speed it up? > > I'll shamelessly say that I don't know what the rb.ast compilation is. > Anyway slowliness of rails startup is problem #1 for testing. anything > that copes with that would be fine. I've just finished setting up jetty to > do some testing faster, but rails startup is still a pain. > > > > I'm also not sure about how to distribute the builder. I'd like to be able > to install a gem and a new generator becomes available or a new Rake task > shows up. However I don't know how to do this, or if it's possible. We could > install a Rake task lib from a gem, but I suspect only the Rails tasks and > those in webapp/lib/tasks are included by default. > > Yes, i did take a look about the generator, and noticed that the real > scripts are > buried deep inside the rails gem distribution. Of course, "make war" > will never make part > of a "standard" rails distribution. wait, maybe a plugin is the way to go ? > > Cheers, > Fausto > > > > Cheers, > Robert > > > > Fausto Lelli wrote: > Hi Robert, > > Although I'm totally swamped at work and a total newbie in these fields, > I'd like to help. What do you think of Charles proposal of having a > generator ? > If that should be the case I think the hardest part is understanding where > to put on the new stuff, rather than creating the script itself. > > The script should zip all the rails-webapp directory itself > and add the WEB-INF dir filled with the web.xml and the > lib/rails-integration.jar, > the only parameter to be passed in being the location of the jruby_home, > and optionally putting all jruby jars into the lib directory. > > Is it correct ? > Cheers, > Fausto > > On 11/30/06, Robert Egglestone wrote: > > > Building the war file will most likely take the form of a Rake task, > however as far as I know no-one has had a look at doing this yet. > I'll have a go at it this weekend. > > Cheers, > Robert > > > > > Ashish Sahni wrote: > Thats great ! For a ruby newbie like can you clarify ... > > Currently the ruby dependencies seem to be > 1. JRuby runtime interpreter > 2. Rails framework libraries > 3. Rails-integration glue code > 4. RoR application code. > > Is the goal of the complete-ruby to have all of these dependencies > bundled as one ? > Also, how are we envisioning the ruby developers to use this facility to > go from > have a RoR app to a war file in one-magical-command ? > > Thanks > Ashish > > Charles Oliver Nutter wrote: > > > Ashish Sahni wrote: > > > > Hi Folks, > > I guess one of the (obvious) goals of the rails-integration project would be > to come up with a simple way via which a standard RoR app can be bundled > as a WAR file. > > Would rake file be the candidate here ? Also, when is > rails-integration-snapshot > going to make it as a separate binary downloadable ? > Any other thoughts on the matter ? > > > I'm obviously super interested in Rails-in-a-WAR, since suddenly Rails > gets all the deployment benefit of a classic Java web application. And I > believe it's possible; I already have an ant target that creates a > complete Ruby interpreter in a single jar; the next step of stuffing > Rails and a Rails app in there doesn't seem far away... > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > > From charles.nutter at sun.com Fri Dec 8 07:05:42 2006 From: charles.nutter at sun.com (Charles Oliver Nutter) Date: Fri, 08 Dec 2006 13:05:42 +0100 Subject: [Jruby-extras-devel] DB2 JDBC interprets IDs as strings In-Reply-To: References: Message-ID: <45795516.4040006@sun.com> Keefe Hayes wrote: > This syntax does not work with DB2 if id is a numeric type: > > select * from
where id ='1'; > > DB2 will not coerce the types to match. The DB2 on Rails ibm_db2_adapter.rb code rewrites the ActiveRecord::Base find_one, find_some, and other methods to "Override the default method to avoid quoting numeric variables". Each method checks if this is a DB2 connection, and if so queries the data base to determine the type of the primary key. > > I am a novice with Ruby. Can anyone suggest how I would determine the connection type and request the column type information from within the find_one method? > Thanks Someone help out here :) I'm busy getting 0.9.2 out, but this seems like something we should be able to do just like the Rails adapter does. I'm not expert enough with the AR-JDBC code though. -- Charles Oliver Nutter, JRuby Core Developer Blogging on Ruby and Java @ headius.blogspot.com Help spec out Ruby today! @ www.headius.com/rubyspec headius at headius.com -- charles.nutter at sun.com From charles.nutter at sun.com Fri Dec 8 07:08:17 2006 From: charles.nutter at sun.com (Charles Oliver Nutter) Date: Fri, 08 Dec 2006 13:08:17 +0100 Subject: [Jruby-extras-devel] RailsServlet - MT-safe ? In-Reply-To: <4574A43F.1000307@cs.auckland.ac.nz> References: <45749D17.6040108@sun.com> <4574A43F.1000307@cs.auckland.ac.nz> Message-ID: <457955B1.9010009@sun.com> Robert Egglestone wrote: > You're right, that code assumes that both JRuby and rails are mt-safe. > I'll add a pool of runtimes to address this, although the Rails load > time is likely to become a pain. Also of note: - TAKAI Naoto's GlassFish-JRubyOnRails module does this same thing, as have most previous attempts to handle multiple Rails requests at the same time. However... - This is broken if you use a session store that doesn't work across runtimes, like memory_store. Since most of the marshalling-based session stores are still a bit broken in JRuby, we usually use memory_store, which doesn't work with multiple runtimes. Don't get me wrong, multiple runtimes is the right way to do it, but there's one other piece needed that we don't have yet: A session store that uses Servlet session. That would allow all requests to work about the same across runtimes. -- Charles Oliver Nutter, JRuby Core Developer Blogging on Ruby and Java @ headius.blogspot.com Help spec out Ruby today! @ www.headius.com/rubyspec headius at headius.com -- charles.nutter at sun.com From nicksieger at gmail.com Fri Dec 8 12:08:44 2006 From: nicksieger at gmail.com (Nick Sieger) Date: Fri, 8 Dec 2006 11:08:44 -0600 Subject: [Jruby-extras-devel] DB2 JDBC interprets IDs as strings In-Reply-To: <45795516.4040006@sun.com> References: <45795516.4040006@sun.com> Message-ID: On 12/8/06, Charles Oliver Nutter wrote: > > Keefe Hayes wrote: > > This syntax does not work with DB2 if id is a numeric type: > > > > select * from
where id ='1'; > > > > DB2 will not coerce the types to match. The DB2 on Rails > ibm_db2_adapter.rb code rewrites the ActiveRecord::Base find_one, find_some, > and other methods to "Override the default method to avoid quoting numeric > variables". Each method checks if this is a DB2 connection, and if so > queries the data base to determine the type of the primary key. > > > > I am a novice with Ruby. Can anyone suggest how I would determine the > connection type and request the column type information from within the > find_one method? > > Thanks > > Someone help out here :) I'm busy getting 0.9.2 out, but this seems like > something we should be able to do just like the Rails adapter does. I'm > not expert enough with the AR-JDBC code though. I can help look into it, but if it's anything significant it'll have to wait until this weekend. It's tricky because I don't have access to a DB2 database, and IBM is making it difficult by putting the DB2 on Rails code behind an account firewall. The ActiveRecord abstract adapter seems to do the right thing with quoting, see [1]. It's possible we could override this in the jdbc_adapter to tweak the behavior, or inject quoting metadata for the various JDBC drivers. For some reason is the AR column type not getting properly set to :integer under JDBC DB2? /Nick [1]: http://dev.rubyonrails.org/browser/tags/rel_1-1-6/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb#L8 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/jruby-extras-devel/attachments/20061208/3c5ee30a/attachment-0001.html From robert at cs.auckland.ac.nz Fri Dec 8 23:18:58 2006 From: robert at cs.auckland.ac.nz (Robert Egglestone) Date: Sat, 09 Dec 2006 17:18:58 +1300 Subject: [Jruby-extras-devel] RailsServlet - MT-safe ? In-Reply-To: <457955B1.9010009@sun.com> References: <45749D17.6040108@sun.com> <4574A43F.1000307@cs.auckland.ac.nz> <457955B1.9010009@sun.com> Message-ID: <457A3932.7010605@cs.auckland.ac.nz> Rails-integration directly implements a session object backed by a Servlet session, I think this ends up being used instead of the configured session store. This would be better provided as a store, although it should still work as-is. Charles Oliver Nutter wrote: > Robert Egglestone wrote: > >> You're right, that code assumes that both JRuby and rails are mt-safe. >> I'll add a pool of runtimes to address this, although the Rails load >> time is likely to become a pain. >> > > Also of note: > > - TAKAI Naoto's GlassFish-JRubyOnRails module does this same thing, as > have most previous attempts to handle multiple Rails requests at the > same time. However... > - This is broken if you use a session store that doesn't work across > runtimes, like memory_store. Since most of the marshalling-based session > stores are still a bit broken in JRuby, we usually use memory_store, > which doesn't work with multiple runtimes. > > Don't get me wrong, multiple runtimes is the right way to do it, but > there's one other piece needed that we don't have yet: A session store > that uses Servlet session. That would allow all requests to work about > the same across runtimes. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/jruby-extras-devel/attachments/20061209/88fe4384/attachment.html From nicksieger at gmail.com Sun Dec 10 21:13:42 2006 From: nicksieger at gmail.com (Nick Sieger) Date: Sun, 10 Dec 2006 20:13:42 -0600 Subject: [Jruby-extras-devel] Fwd: DB2 JDBC adapter quoting numbers In-Reply-To: References: Message-ID: Thanks for the update, Keefe. Sending this to the list so others can chew on it as well. /Nick ---------- Forwarded message ---------- From: Keefe Hayes Date: Dec 8, 2006 3:32 PM Subject: DB2 JDBC adapter quoting numbers To: nicksieger at gmail.com Nick, Sorry to send email. I cannot figure out how to respond to posts in the JDBC developer list. I also wanted to send you an attachment. I have made some good progress on the integer quoting issue. The number is coming in straight from the template as a string. A method like this: Class.find(params[:id]) sends id in as a String object. The Base find method does not check the column type. In testing against mysql, select * from x where id = '1' works fine. However, DB2 does not allow the number to be quoted. This must be the first data base that Rails works with that cares. If you download the DB2 on Rails from Alphaworks ( http://www.alphaworks.ibm.com/tech/db2onrails), you can see some comments in the ibm_db2_adapter.rb in connection_adapters. I copied this code into jdbc_adapter.rb and tailored it up. I have attached my version of jdbc_adapter.rb for you to look at. The ActiveRecord::Base methods that get overridden are find_one, find_some, replace_bind_variables, replace_named_bind_variables. A couple of helpers are added in there as well. My rewrites of find_one and find_some are pretty different from IBM's code, but the other routines I have not dug into very much. I do not know what kind of copyright issue there would be with using theirs. I will keep looking at issues with DB2. I can now list timestamp fields, and retrieve rows by ID. I am now having a problem with updating a timestamp field. I will look at this next. If you can suggest a place to look that would be helpful. Thanks for your help, Keefe <> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/jruby-extras-devel/attachments/20061210/ac210f18/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: jdbc_adapter.rb Type: application/octet-stream Size: 23591 bytes Desc: not available Url : http://rubyforge.org/pipermail/jruby-extras-devel/attachments/20061210/ac210f18/attachment-0001.obj From werner.schuster at gmail.com Wed Dec 13 08:35:22 2006 From: werner.schuster at gmail.com (Werner Schuster (murphee)) Date: Wed, 13 Dec 2006 14:35:22 +0100 Subject: [Jruby-extras-devel] Problem with jruby-extras-commits list? Message-ID: <4580019A.7090400@gmail.com> I committed some stuff to the jruby-extras project yesterday, and for every commit I got a "Undelivered Mail Returned To Sender" to my rubyforge email account, saying this; -------------------------------------------------- I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below. For further assistance, please send mail to postmaster. If you do so, please include this problem report. You can delete your own text from the attached returned message. The mail system : unknown user: "jruby-extras-commits" -------------------------------------------------- Rest snipped. Has anyone else seen this? murphee -- Blog @ http://jroller.com/page/murphee Maintainer of EclipseShell @ http://eclipse-shell.sourceforge.net/ From Keefe.Hayes at sas.com Wed Dec 13 09:30:38 2006 From: Keefe.Hayes at sas.com (Keefe Hayes) Date: Wed, 13 Dec 2006 09:30:38 -0500 Subject: [Jruby-extras-devel] JRuby 0.9.2 and ActiveRecord-JDBC 0.2.2 runs Rails App on z/OS with DB2 Message-ID: With an update to jdbc_adapter.rb, and the latest JRuby 0.9.2, I can run a small Ruby on Rails application on z/OS against DB2. This is pretty impressive. To handle an issue with DB2 (that one cannot use quoted numeric data in queries), I added the following ActiveRecord::Base methods to active_record/connection_adapters/jdbc_adapter.rb: find_one, find_some, replace_bind_variables, replace_named_find_variables. Installation of JRuby, Rails, and ActiveRecord-JDBC was fairly straightforward, with only a few magic incantations necessary. A ROR application starts up reasonably well and is acceptably responsive. Explorations continue. From nicksieger at gmail.com Wed Dec 13 10:10:47 2006 From: nicksieger at gmail.com (Nick Sieger) Date: Wed, 13 Dec 2006 09:10:47 -0600 Subject: [Jruby-extras-devel] JRuby 0.9.2 and ActiveRecord-JDBC 0.2.2 runs Rails App on z/OS with DB2 In-Reply-To: References: Message-ID: On 12/13/06, Keefe Hayes wrote: > > With an update to jdbc_adapter.rb, and the latest JRuby 0.9.2, I can run a > small Ruby on Rails application on z/OS against DB2. This is pretty > impressive. That's great! Installation of JRuby, Rails, and ActiveRecord-JDBC was fairly > straightforward, with only a few magic incantations necessary. Sure. Are those incantations any different from the usual ones you see in a getting-started-with-JRuby-and-Rails tutorial? If so it would be helpful to know what they are so we can hopefully knock them down (or have you mentioned them in past emails? I'll check my archive). Explorations continue. Thanks for being willing to explore and helping the community effort move things forward. Cheers, /Nick -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/jruby-extras-devel/attachments/20061213/7e12160e/attachment.html From peter at oaktop.com Mon Dec 18 00:25:37 2006 From: peter at oaktop.com (Peter K Chan) Date: Mon, 18 Dec 2006 00:25:37 -0500 Subject: [Jruby-extras-devel] ActiveRecord::JDBC HSQLDB Adapter does not properly quote string Message-ID: Hello, I have a failure using AR::JDBC and the HSQLDB adapter with persisting strings with backward slashes. # Failure code (conceptual) path = 'c:\\folder path\\' f = Folder.new f.path = path puts f.path # prints out c:\folder path\ f.save f.reload puts f.path # prints out c:\\folder path\\ Basically, the default quote_string() implementation quotes both single quote (') and backward slashes (\), even though HSQLDB only needs the single quote to be quoted. A one line patch is attached (jdbc_hsqldb.rb:54). Also, I noticed that the code for binary string is also using quote_string (line 52). I don't know whether the quoting does any harm if unpacking is involved. Perhaps a knowledgeable person can look at it and see if that line needs to be changed too. Thanks, Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: hsqldb_improper_string_quoting.patch Type: application/octet-stream Size: 94 bytes Desc: hsqldb_improper_string_quoting.patch Url : http://rubyforge.org/pipermail/jruby-extras-devel/attachments/20061218/b68322ce/attachment.obj From charles.nutter at sun.com Wed Dec 27 23:44:53 2006 From: charles.nutter at sun.com (Charles Oliver Nutter) Date: Wed, 27 Dec 2006 22:44:53 -0600 Subject: [Jruby-extras-devel] Pleasantly surprised at rails-integration Message-ID: <45934BC5.10806@sun.com> This evening I started thinking about the Grizzly support for running Rails, and it occurred to me that there must be a better way than calling Rails own dispatcher directly. Specifically, it seemed wasted overhead to use Ruby's CGI library to process requests and responses when the container would do that for you. As I started to look into what would be required to implement a more direct request and response model, I thought I'd see if the rails-integration code does that. Naturally, it has beaten me to the punch. I'm no rails expert, so tell me how close I am on this... rails-integration provides servlet-based implementations of ActionController::AbstractRequest based on HttpServletRequest and HttpServletResponse. It maps all calls through as appropriate and avoids re-parsing or re-handling request and response headers. By doing this it also skips a large portion of the request processing that normally slows down Rails. Am I on the right track here? This is really great stuff guys, and has potential to beat even servers like Mongrel in performance (since we're relying on tried-and-true Java servers to handle all the HTTP nonsense, rather than Ruby's CGI library). So what's the status today? I have not been able to get a WAR'ed up Rails app working...is there a walkthrough somewhere on how to do it? (it should be in the JRuby wiki somewhere, methinks). Get me going on this stuff and I'll buy y'all a beer some day. Oh, and I'll start using it and making contribution to the code. -- Charles Oliver Nutter, JRuby Core Developer Blogging on Ruby and Java @ headius.blogspot.com Help spec out Ruby today! @ www.headius.com/rubyspec headius at headius.com -- charles.nutter at sun.com From fausto.lelli at gmail.com Thu Dec 28 02:16:18 2006 From: fausto.lelli at gmail.com (Fausto Lelli) Date: Thu, 28 Dec 2006 08:16:18 +0100 Subject: [Jruby-extras-devel] Pleasantly surprised at rails-integration In-Reply-To: <45934BC5.10806@sun.com> References: <45934BC5.10806@sun.com> Message-ID: Hi, I did tested getting a war in standalone mode (that means with all of jruby packaged up in the WEB-INF lib directory, but please referer to preceding discussion to the thread RoR in War ) ad worked for me 1) install plugin: script/plugin install svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war 2) rake war:standalone:create 3) I had to manually add jvyaml.jar to the generated WEB-INF/lib directory but I don't know if it is a problem with my config or else it has since been fixed. As for the implementation, I think it is as you described before, maybe Robert can confirm for sure. One thing that worries me a little bit now is multiple rails runtime instances (pooled), which slows startup a lot. But since this is all meant for production deployment, this could be a no-problem. Cheers, Fausto. On 12/28/06, Charles Oliver Nutter wrote: > This evening I started thinking about the Grizzly support for running > Rails, and it occurred to me that there must be a better way than > calling Rails own dispatcher directly. Specifically, it seemed wasted > overhead to use Ruby's CGI library to process requests and responses > when the container would do that for you. > > As I started to look into what would be required to implement a more > direct request and response model, I thought I'd see if the > rails-integration code does that. Naturally, it has beaten me to the punch. > > I'm no rails expert, so tell me how close I am on this... > > rails-integration provides servlet-based implementations of > ActionController::AbstractRequest based on HttpServletRequest and > HttpServletResponse. It maps all calls through as appropriate and avoids > re-parsing or re-handling request and response headers. By doing this it > also skips a large portion of the request processing that normally slows > down Rails. > > Am I on the right track here? > > This is really great stuff guys, and has potential to beat even servers > like Mongrel in performance (since we're relying on tried-and-true Java > servers to handle all the HTTP nonsense, rather than Ruby's CGI library). > > So what's the status today? I have not been able to get a WAR'ed up > Rails app working...is there a walkthrough somewhere on how to do it? > (it should be in the JRuby wiki somewhere, methinks). > > Get me going on this stuff and I'll buy y'all a beer some day. Oh, and > I'll start using it and making contribution to the code. > > -- > Charles Oliver Nutter, JRuby Core Developer > Blogging on Ruby and Java @ headius.blogspot.com > Help spec out Ruby today! @ www.headius.com/rubyspec > headius at headius.com -- charles.nutter at sun.com > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > From charles.nutter at sun.com Thu Dec 28 03:13:03 2006 From: charles.nutter at sun.com (Charles Oliver Nutter) Date: Thu, 28 Dec 2006 02:13:03 -0600 Subject: [Jruby-extras-devel] Pleasantly surprised at rails-integration In-Reply-To: References: <45934BC5.10806@sun.com> Message-ID: <45937C8F.6050201@sun.com> Fausto Lelli wrote: > Hi, > > I did tested getting a war in standalone mode (that means with all of > jruby packaged > up in the WEB-INF lib directory, but please referer to preceding discussion to > the thread RoR in War ) ad worked for me > > 1) install plugin: > script/plugin install > svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war > 2) rake war:standalone:create > 3) I had to manually add jvyaml.jar to the generated WEB-INF/lib > directory but I > don't know if it is a problem with my config or else it has since been fixed. > This is very helpful for me, thank you. I'll try playing with it over the next couple days, and document this and anything else I find on the JRuby wiki (headius.com/jrubywiki). > As for the implementation, I think it is as you described before, > maybe Robert can > confirm for sure. > > One thing that worries me a little bit now is multiple rails runtime > instances (pooled), > which slows startup a lot. But since this is all meant for production > deployment, this could be a no-problem. I've been doing some work on startup performance and committed a few fixes over the holidays. This will also improve as our overall performance increases, since much of the load time is spent actually executing all the source being read in. -- Charles Oliver Nutter, JRuby Core Developer Blogging on Ruby and Java @ headius.blogspot.com Help spec out Ruby today! @ www.headius.com/rubyspec headius at headius.com -- charles.nutter at sun.com From robert at cs.auckland.ac.nz Fri Dec 29 02:17:33 2006 From: robert at cs.auckland.ac.nz (Robert Egglestone) Date: Fri, 29 Dec 2006 20:17:33 +1300 Subject: [Jruby-extras-devel] Pleasantly surprised at rails-integration Message-ID: <20061229201733.n008anxo8q84k80k@webmail.cs.auckland.ac.nz> Hi, It is a pretty accurate description of the implementation. However, there are some places where Rails does other things with the processing, and so the work still needs to be done in Ruby (e.g. processing the request body). I'm also not thrilled about the multiple runtimes although more for memory requirements than startup time. If it was possible to do a copy-on-write fork of the runtime, then we could achieve a much better result, however I imagine that would be quite difficult. It may be time to start looking at a release. Once the code is released in an online repository, then everything should be automatically downloaded once the plugin is installed. Currently I think the only thing missing would be the Ruby standard libraries, which jruby-complete could eventually solve (although it may be nice to have a separate artifact for the standard libraries anyway). Cheers, Robert Quoting Fausto Lelli : > Hi, > > I did tested getting a war in standalone mode (that means with all of > jruby packaged > up in the WEB-INF lib directory, but please referer to preceding > discussion to > the thread RoR in War ) ad worked for me > > 1) install plugin: > script/plugin install > svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/create_war > 2) rake war:standalone:create > 3) I had to manually add jvyaml.jar to the generated WEB-INF/lib > directory but I > don't know if it is a problem with my config or else it has since been fixed. > > As for the implementation, I think it is as you described before, > maybe Robert can > confirm for sure. > > One thing that worries me a little bit now is multiple rails runtime > instances (pooled), > which slows startup a lot. But since this is all meant for production > deployment, this could be a no-problem. > > Cheers, > Fausto. > > > On 12/28/06, Charles Oliver Nutter wrote: >> This evening I started thinking about the Grizzly support for running >> Rails, and it occurred to me that there must be a better way than >> calling Rails own dispatcher directly. Specifically, it seemed wasted >> overhead to use Ruby's CGI library to process requests and responses >> when the container would do that for you. >> >> As I started to look into what would be required to implement a more >> direct request and response model, I thought I'd see if the >> rails-integration code does that. Naturally, it has beaten me to the punch. >> >> I'm no rails expert, so tell me how close I am on this... >> >> rails-integration provides servlet-based implementations of >> ActionController::AbstractRequest based on HttpServletRequest and >> HttpServletResponse. It maps all calls through as appropriate and avoids >> re-parsing or re-handling request and response headers. By doing this it >> also skips a large portion of the request processing that normally slows >> down Rails. >> >> Am I on the right track here? >> >> This is really great stuff guys, and has potential to beat even servers >> like Mongrel in performance (since we're relying on tried-and-true Java >> servers to handle all the HTTP nonsense, rather than Ruby's CGI library). >> >> So what's the status today? I have not been able to get a WAR'ed up >> Rails app working...is there a walkthrough somewhere on how to do it? >> (it should be in the JRuby wiki somewhere, methinks). >> >> Get me going on this stuff and I'll buy y'all a beer some day. Oh, and >> I'll start using it and making contribution to the code. >> >> -- >> Charles Oliver Nutter, JRuby Core Developer >> Blogging on Ruby and Java @ headius.blogspot.com >> Help spec out Ruby today! @ www.headius.com/rubyspec >> headius at headius.com -- charles.nutter at sun.com >> _______________________________________________ >> Jruby-extras-devel mailing list >> Jruby-extras-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/jruby-extras-devel >> > _______________________________________________ > Jruby-extras-devel mailing list > Jruby-extras-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > ----------------------------------------------------------------------- This mail sent through University of Auckland http://www.auckland.ac.nz ----- End forwarded message -----