Rails 2.2 released, looking for user stories

In JRuby you should be able to do:

include_class ‘LookupService’

Can you give this a try?

Ikai

On 11/25/08 8:45 AM, “Vlad GALU” [email protected] wrote:

Silly me! You were right, and it was just as easy as compiling the
com.maxmind.geoip.LookupService.new(“#{RAILS_ROOT}/db/GeoIP.dat”,
‘import’ and ‘require_package’, and they both failed.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On Tue, Nov 25, 2008 at 10:03 PM, Ikai L. [email protected] wrote:

In JRuby you should be able to do:

include_class ‘LookupService’

Can you give this a try?

Hi Ikai,
I tried and here’s what I got:
– cut here –
/home/dudu/work/jruby-1.1.5/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:159:in
`require’: cannot load Java class LookupService (NameError)
– and here –

Just migrated www.agilenetworks.ro (my pet project business) to JRuby

require ‘java’
end

http://xircles.codehaus.org/manage_email


~/.signature: no such file or directory


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Charles -

I checked out the jruby-rack source on github and although it’s not
much, here is what I was able to find:

The NullPointerException is being caused because of the last line in
this block of RackFilter.java:

public void doFilter(ServletRequest request, ServletResponse

response, FilterChain chain)
throws IOException, ServletException {
HttpServletRequest httpRequest = maybeAppendHtmlToPath(request);
HttpServletResponse httpResponse = (HttpServletResponse)
response;
ResponseStatusCapture capture = new
ResponseStatusCapture(httpResponse);
chain.doFilter(httpRequest, capture);
if (capture.isError()) {
httpResponse.reset();
request.setAttribute(RackDispatcher.DYNAMIC_REQS_ONLY,
Boolean.TRUE);
dispatcher.process((HttpServletRequest) request,
httpResponse);
}
}

I’m not sure why exactly it would throw a null pointer, but I noticed
that it got into that if-block, which means capture.isError() is
returning true. isError() returns true if status >= 400. I think the
request is getting a 400 inside of the filter chain, which is strange
since the only filter I see is the RackFilter itself. I also checked
my rails production.log, and it is blank. If I go to any of the other
static rails pages such ass 500.html and 404.html, those are brought
up correctly.

I also tested this on both port 80 and 443 and I am getting the same
error message.

Thoughts?
Jin

On Tue, Nov 25, 2008 at 12:54 PM, Charles Oliver N.
[email protected] wrote:

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)

   Goldspike
   java.lang.ClassCastException:
      at
      at
   org.jruby.webapp.util.CustomObjectPool.access$200(CustomObjectPool.java:15)

   miss is a
   chance your
       >

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Charles -

Ok, scratch that last post. I was looking at the wrong line of the
exception log. I think the null pointer is happening somewhere below,
but this code is way above my head and I’m not sure where to begin. It
is from DefaultRackDispatcher.java . How would I go about trying to
find out where the null pointer is thrown? Thank you -

public RackResponse call(final ServletRequest env) {
    Ruby runtime = getRuntime();
    IRubyObject servlet_env = JavaEmbedUtils.javaToRuby(runtime, 

env);
servlet_env.getMetaClass().defineMethod(“to_io”, new Callback()
{
public IRubyObject execute(IRubyObject recv, IRubyObject[]
args, Block block) {
try {
return new RubyIO(recv.getRuntime(),
env.getInputStream());
} catch (IOException ex) {
throw
RaiseException.createNativeRaiseException(recv.getRuntime(), ex);
}
}
public Arity getArity() {
return Arity.NO_ARGUMENTS;
}
});
IRubyObject response = __call(servlet_env);
return (RackResponse) JavaEmbedUtils.rubyToJava(runtime,
response, RackResponse.class);
}

On Tue, Nov 25, 2008 at 2:02 PM, Jin L. [email protected] wrote:

       throws IOException, ServletException {

}
I also tested this on both port 80 and 443 and I am getting the same

Jin L. wrote:

at org.jruby.rack.RackFilter.doFilter(RackFilter.java:51)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
On Tue, Nov 25, 2008 at 8:00 AM, Charles Oliver N. <[email protected] mailto:[email protected]> wrote:

   goldspike since it is the one creating the war file?)
   org.jruby.webapp.RailsFactory.logRubyException(RailsFactory.java:159)
   java.lang.String
   javax.servlet.ServletException: Could not load Rails. See the

   <mailto:[email protected]>>> wrote:
      <[email protected] <mailto:[email protected]>
       > concurrency story.
   ---------------------------------------------------------------------
      ~/.signature: no such file or directory

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Nick, Charles -

I found the problem. Not sure if you guys have seen this before.

So what I did was, I created an new blank rails 2.2.2 application and
starting slowly migrating things over one by one, and restarting tomcat
to
see if it would throw an NPE. Eventually, I got it to throw, but I
noticed
the error message got more verbose (I think somewhere in the middle I
either
updated my warbler installation or maybe the new rails structure has
better
support for tomcat logging? i dont know).

Anyway, the error message I got was related to json:

org.jruby.rack.RackInitializationException: no such file to load – json
from C:/Program Files/Apache Software Foundation/Tomcat
5.5/webapps/ROOT/WEB-INF/vendor/rails/activesupport/lib/active_support/dependencies.rb:133:in
require_dependency' from C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/ROOT/WEB-INF/config/../vendor/rails/railties/lib/initializer.rb:368:inload_application_classes’
from C:/Program Files/Apache Software Foundation/Tomcat
5.5/webapps/ROOT/WEB-INF/config/…/vendor/rails/railties/lib/initializer.rb:367:in
each' from C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/ROOT/WEB-INF/config/../vendor/rails/railties/lib/initializer.rb:367:inload_application_classes’
from C:/Program Files/Apache Software Foundation/Tomcat
5.5/webapps/ROOT/WEB-INF/config/…/vendor/rails/railties/lib/initializer.rb:365:in
`each’
–snip–

I have a couple classes where I use a json parser from the json-jruby
gem.
The error message seems like it can’t find the json package, so I
checked
out the WAR file and indeed, the gem is not there.

Now, the part I dont understand is, in my warble.rb file, I have this
line:

config.gems += [“activerecord-jdbc-adapter”, “jruby-openssl”,
“json-jruby”]

The activerecord gem came in as well as the openssl one, but not the
json-jruby gem. Since this error doesn’t happen when I script/server, I
know
rails is able to find it correctly, but for some reason warbler is
ignoring
it?

Any ideas? Thank you very much!
Jin

I’ve ran into this exact same problem when I upgraded to rails 2.2.2 on
JRuby. Uninstall json-jruby, and instead install json_pure. Also, don’t
forget to also change your config/warble.rb.

On Wed, 2008-11-26 at 09:30 -0800, Jin L. wrote:

from C:/Program Files/Apache Software Foundation/Tomcat

line:
Jin
errors
of the
> IRubyObject servlet_env =
> throw
JavaEmbedUtils.rubyToJava(runtime,
>>
>> HttpServletResponse httpResponse =
httpResponse);
is strange
>> error message.
>>>
>>>>
>>>> at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
>>>> at org.apache.tomcat.util.threads.ThreadPool
>>>> On Tue, Nov 25, 2008 at 8:00 AM, Charles Oliver N.
>>>>
>>>> Rails 2.2.2
from 100 megs to
>>>> at
$200(CustomObjectPool.java:15)
>>>> at
$PoolSizeManager.run(CustomObjectPool.java:193)
>>>> org.jruby.webapp.util.CustomObjectPool.access
>>>>
http://www.agilenetworks.ro (my
mailto:[email protected]
>>>> project
>>>> > And anything else you want to add.
>>>> >
>>>>
>>>> http://xircles.codehaus.org/manage_email
>>>
>

    ---------------------------------------------------------------------
    To unsubscribe from this list, please visit:
    
       http://xircles.codehaus.org/manage_email

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Julio -

Thanks for the heads up. Much appreciated. The change you suggested
worked. So I take it the rule is to use the pure ruby gems whenever
possible?

P.S Warbler is awesome.

Thanks again everyone,
Jin

On Wed, Nov 26, 2008 at 10:00 AM, Julio C. [email protected]
wrote:

starting slowly migrating things over one by one, and restarting
5.5/webapps/ROOT/WEB-INF/vendor/rails/activesupport/lib/active_support/dependencies.rb:133:in `require_dependency’
I have a couple classes where I use a json parser from the json-jruby
json-jruby gem. Since this error doesn’t happen when I script/server,
Jin, it looks like some error in the application is preventing
On Tue, Nov 25, 2008 at 4:54 PM, Jin L. [email protected]
trying to
> args, Block block) {
> return Arity.NO_ARGUMENTS;
>> Hi Charles -
ServletResponse
>> httpResponse.reset();
>> that it got into that if-block, which means
are brought
>> [email protected] wrote:
realize Goldspike wasn’t being maintained. It was working
org.jruby.rack.RackFilter.doFilter(RackFilter.java:51)
>>>> at
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
just joined this group a few weeks ago.
>>>> unlikely to still work correctly in a lot of cases. Is
>>>> Windows Server 2003
the problem is
>>>>
>>>> at
cannot be cast to
>>>> at
org.jruby.webapp.RailsFactory.makeObject(RailsFactory.java:139)
>>>>
>>>> mailto:[email protected] <mailto:[email protected]
>>>> JRuby G.IP implementation :slight_smile:
>>>> really
>>>> > 1. Have you switched? If not, why not?
---------------------------------------------------------------------
>>>> ~/.signature: no such file or directory
>>>>
>>>
> To unsubscribe from this list, please visit:


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Jin, it looks like some error in the application is preventing proper
initialization. The NullPointerException is a side-effect. Can you
look in your tomcat server logs and see if there are any other errors
above the NPE?

/Nick

On Tue, Nov 25, 2008 at 4:54 PM, Jin L. [email protected] wrote:

   IRubyObject servlet_env = JavaEmbedUtils.javaToRuby(runtime, env);
       public Arity getArity() {
   HttpServletResponse httpResponse = (HttpServletResponse) response;

I’m not sure why exactly it would throw a null pointer, but I noticed

Hi Charles,
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:895)
Why are you using GoldSpike? It’s really old at this point, and
Java 6 Update 10
Upon starting up Tomcat, memory steadily shoots from 100 megs to
org.jruby.webapp.RailsFactory.makeObject(RailsFactory.java:138)
org.jruby.webapp.RailsFactory.logRubyException(RailsFactory.java:159)
at

      Just migrated www.agilenetworks.ro
   wrote:
       > 1. Have you switched? If not, why not?
       >
            ---------------------------------------------------------------------

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Jin -

This is quite an endorsement of JRuby, and even though I am not the
recipient (I haven’t contributed an ounce to the JRuby project; I’m
not nearly smart enough), I thank you for writing it. I think it’s
important for the people who work so hard on this stuff to know that
there are many of us out there who greatly appreciate what they do.

For my part, I started doing Rails development about two years ago
after spending years doing web apps in Java (I still do some Java
work, too). I was not in control of most of the projects I worked on,
and they’re pretty much all deployed using MRI and either Mongrel or
Phusion Passenger (which, for its part, is an excellent alternative).
But I got very excited when I learned about the existence of JRuby,
and its ability to run Rails applications in mature containers such as
Tomcat, or GlassFish. I’m even more excited about GlassFish v3 and its
ability to natively deploy Rails applications with JRuby. I’ve been
advocating the use of JRuby and GlassFish to anyone who will listen,
and I firmly believe the future of Ruby and Rails lies in the hands of
the JVM, thanks to the hard work done by both the JRuby and GlassFish
communities.

As I’ve told others, the JVM has nearly two decades of research and
development poured into making things run really fast, and application
containers like Tomcat have forgotten more about scaling to high
levels of traffic than Mongrel will know any time soon (no slight on
Mongrel, but it is still young).

For projects I do control, especially my own personal projects, I
won’t run them any other way besides JRuby and GlassFish or Tomcat. So
thanks to everyone for making it possible for me to do that. I owe a
large part of whatever success I may see to those of you who give me
these tools to build upon.

-Bill K.

On 29 Nov, 2008, at 12:23 PM, Jin L. wrote:

universities. One of the universities I worked for started a small
site at the same time would force us to restart), and for whatever
machine, I knew jruby would hold great promise. I came back a week
rails as an unproven framework, and in the end they decided to cancel
amazing things, but I’ve noticed that in my line of work (where IT
have to agree, jruby is the stuff of intranets and “enterprise”
applications, and while you guys may not hear much about our stories,
they do exist and we( myself and the other programmers I’ve met along
the way that I’ve introduced jruby on rails to) are extremely grateful
for this project. You guys have a ton of more programming expertise
than I do but if I can do anything (testing, perhaps something easy)
or even a monetary donation, I would be more than happy to oblige.

Once again, thank you for this project,
Jin L.


Bill K.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi again,

I just realized that I totally hijacked this thread to debug my switch
to rails 2.2.2 rather than actually post about the topic.

I’ve been meaning to post something on my blog about my last 6 months
with jruby, but really quick here is my story:

I am a freelance programmer in the San Diego, CA area, and throughout
my last 5 years I have been doing work for local businesses and
universities. One of the universities I worked for started a small
project using RoR (per my suggestion to use RoR as the new ‘fast and
productive’ framework). I was contracted originally to create a
backend process (written in Java) to connect to their legacy system,
while the front end (rails) was to be written by their employees.

We ended up with an environment that worked, but it was complex and
extremely slow and frustrating to our users. Since they were an all
Windows shop, we had Apache + Tomcat (for the backend process) and 10
Mongrel threads (for rails). I don’t know why but we always had issues
with Mongrel going down under the slightest load (5 users hitting the
site at the same time would force us to restart), and for whatever
reason, the native ruby build for Windows threw the most random errors
(sometimes it would say NoMethodError on strftime, even though that
object was a date).

At this time, management was growing extremely impatient with the
application, scolded the employees and I for taking up a ‘buggy early
adopter language with no support’, and contracted another freelance
programmer to port the front end to another platform. Around this same
time jruby 1.1.1 came out and was gaining a lot of steam. I decided to
check it out and when I saw how great it worked on my local Windows
machine, I knew jruby would hold great promise. I came back a week
later with a proposal to use jruby in their environment, removing the
need for Mongrel, native ruby, and allowing us to consolidate into
just Apache + Tomcat.

Fast forward a couple months (during the jruby upgrade they also
wanted a few changes to the business rules), and after the first
production rollout, the response we got was amazing. We heard things
like “my computer at home took 5 minutes to load the search results
page but now it only takes a couple seconds” and other similar
compliments. Management was very pleased as well, no longer thought of
rails as an unproven framework, and in the end they decided to cancel
the port and continue jruby on rails development. In our internal
tests, we were seeing an average of 50 req/s, which was incredible
compared to our prior setup.

Since then, I have also turned several other clients who used rails +
windows to jruby, with similar success and praise. I am extremely
thankful for this project, it has really defined me as a contract
programmer in these last few months, and I am finding a lot of success
that I did not have before. I always hear about these new shiny
upcoming startups who have a ton of IT expertise and freedom to do
amazing things, but I’ve noticed that in my line of work (where IT
departments are small and user tech-knowledge may not be up to par),
you don’t have that kind of flexibility and people expect the
“computer stuff” to just work. I now consider jruby the de-facto
standard for deploying rails apps in a Windows environment, and look
forward to all the future great strides this project makes.

The last thing I want to mention is that some day, I would like to
give back to this community that has given so much to me. I read this
post the other day
http://syntatic.wordpress.com/2008/11/25/the-closet-jrubyists/ and I
have to agree, jruby is the stuff of intranets and “enterprise”
applications, and while you guys may not hear much about our stories,
they do exist and we( myself and the other programmers I’ve met along
the way that I’ve introduced jruby on rails to) are extremely grateful
for this project. You guys have a ton of more programming expertise
than I do but if I can do anything (testing, perhaps something easy)
or even a monetary donation, I would be more than happy to oblige.

Once again, thank you for this project,
Jin L.

On Thu, Nov 27, 2008 at 8:14 AM, Jin L. [email protected] wrote:

So what I did was, I created an new blank rails 2.2.2 application and
from C:/Program Files/Apache Software Foundation/Tomcat

The activerecord gem came in as well as the openssl one, but not the
wrote:

    > is from DefaultRackDispatcher.java . How would I go about
    IRubyObject[]
    >            public Arity getArity() {
    wrote:
    >>    public void doFilter(ServletRequest request,
    >>        if (capture.isError()) {
    I noticed
    >> static rails pages such ass 500.html and 404.html, those
    >> On Tue, Nov 25, 2008 at 12:54 PM, Charles Oliver N.
    >>>> Thanks for your reply and information. Sorry, I did not
    >>>>    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    >>>>    at
    insight you can provide. And apologies for the ignorance, I
    point, and
    >>>>
    >>>>        I package to war and deploy to my server (Perhaps
    >>>>        some of the error messages I am seeing:
     org.jruby.webapp.RailsFactory.makeObject(RailsFactory.java:138)
    >>>>        org.jruby.RubyNameError$RubyNameErrorMessage
     org.jruby.webapp.util.CustomObjectPool.addObjectInternal(CustomObjectPool.java:111)
    >>>>
    >>>>
    <[email protected]
    >>>>        miss is a
    2.2.2) and we're
    >>>>            >
    >>>>
    >>>>           --
    >>>>
    >>>
    ---------------------------------------------------------------------
       http://xircles.codehaus.org/manage_email

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Charles,

You can most certainly reprint it, but also I will blog it by the end
of this weekend. I am working on both my contractor website + blog to
promote jruby in the San Diego area.

I will update you w/ a link when its ready. Thanks,

Jin

On Sat, Nov 29, 2008 at 3:56 PM, Charles Oliver N.
[email protected] wrote:

At this time, management was growing extremely impatient with the
Fast forward a couple months (during the jruby upgrade they also
Since then, I have also turned several other clients who used rails +
forward to all the future great strides this project makes.
than I do but if I can do anything (testing, perhaps something easy)

Thanks for the heads up. Much appreciated. The change you suggested

I’ve ran into this exact same problem when I upgraded to rails 2.2.2 on

starting slowly migrating things over one by one, and restarting

from C:/Program Files/Apache Software Foundation/Tomcat
gem. The error message seems like it can’t find the json package, so I
I know rails is able to find it correctly, but for some reason warbler
proper
wrote:
> find out where the null pointer is thrown? Thank you -
> try {
> }
>>
>> response, FilterChain chain)
>>
capture.isError() is
>> up correctly.
>>>
pretty well for me up until this rails release.
org.jruby.rack.RackFilter.doFilter(RackFilter.java:51)

   >>>>    at

org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
insight you can provide. And apologies for the ignorance, I
point, and
>>>>
>>>> I package to war and deploy to my server (Perhaps
>>>> some of the error messages I am seeing:
>>>>
$PoolSizeManager.run(CustomObjectPool.java:193)
org.jruby.webapp.RailsFactory.makeObject(RailsFactory.java:138)
>>>> javax.servlet.ServletException: Could not load
>>>> org.jruby.webapp.util.CustomObjectPool.access
>>>>
http://www.agilenetworks.ro (my
mailto:[email protected]
>>>> project
>>>> > And anything else you want to add.
>>>> >



   > To unsubscribe from this list, please visit:
      http://xircles.codehaus.org/manage_email

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi All,
maybe not exactly rails story but:

Thank You JRuby team, You’re doing a great work.

Best greetings,
Pawe³ Wielgus.

Hi there,

Although I’ve only used JRuby modestly and not with Rails 2.2, I finally
got around to writing a blog post about my experience if anyone is
interested. JRuby is pretty awesome and I wish I had more excuses to use
it on a daily basis.

http://blog.darevay.com/2008/12/jruby-testify/

Keep up the good work,
Dave

Jin L. wrote:

universities. One of the universities I worked for started a small
site at the same time would force us to restart), and for whatever
machine, I knew jruby would hold great promise. I came back a week
rails as an unproven framework, and in the end they decided to cancel
amazing things, but I’ve noticed that in my line of work (where IT
have to agree, jruby is the stuff of intranets and “enterprise”


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Another great story :slight_smile: I hope you plan to blog about this or something.
Get the word out!

Bill K. wrote:

spending years doing web apps in Java (I still do some Java work, too).

build upon.

At this time, management was growing extremely impatient with the
Fast forward a couple months (during the jruby upgrade they also
Since then, I have also turned several other clients who used rails +
forward to all the future great strides this project makes.
than I do but if I can do anything (testing, perhaps something easy)


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email