Forum: JRuby Rails 2.2 released, looking for user stories

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Charles Oliver N. (Guest)
on 2008-11-22 11:00
(Received via mailing list)
Rails 2.2 is now officially released (as 2.2.2) and we're really
interested in hearing anyone's migration stories. There's a good chance
your project would be widely promoted as examples of how much 2.2 has
improved its concurrency story.

1. Have you switched? If not, why not?

2. If it's working well for you, why? If not, why not?

And anything else you want to add.

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
AD (Guest)
on 2008-11-23 00:25
(Received via mailing list)
How does the new activerecord connection pooling work if you are using ,
say
DBCP on Tomcat  for connection pooling.  Should you use both or does the
ActiveRecords-JBDC plugin use the servlet container's JDBC pool ?  How
would
database.yml look ?

Thx
Adam

On Sat, Nov 22, 2008 at 4:00 AM, Charles Oliver N. <
Fabio K. (Guest)
on 2008-11-23 01:54
(Received via mailing list)
When using connections pools available through jndi, you don't need the
Rails 2.2 pool.
Just set the jndi name for the connection pool you want to use (that is
also
configured in your container), in the database.yml:

production:
  adapter: jdbcmysql
  # for jetty
  jndi: java:comp/env/jdbc/Pool
  # for tomcat
  # jndi: java:/comp/env/jdbc/Pool


And don't forget to set the jndi reference in you web.xml:

<resource-ref>
  <res-ref-name>jdbc/Pool</res-ref-name>
  <res-type>java​x.sql.DataSource<​/res-type>
  <res-auth>Cont​ainer</res-auth​>
</resource-ref>

Warbler already does it for you (generating the web.xml file with the
required lines):

Warbler::Config.new do |config|
  # ...
  config.webxml.jndi = 'jdbc/Pool'
end

The last thing is that you must be sure that connections are being
returned
to the pool, at the end of request processing. I believe jruby-rack
isn't
doing it automatically anymore in the last release (0.9.2), so you will
have
to add an after_filter to your application controller:

class ApplicationController < ActionController::Base
  after_filter :close_all_connections
  # ...

  private
  def close_all_connections()
    ActiveRecord::Base.clear_active_connections!
  end
end

Just one little tip: I've seen many times people having problems with
DBCP
and dead/timed-out connections. Try using something else (and better)
like
c3p0.

On Sat, Nov 22, 2008 at 8:25 PM, AD <removed_email_address@domain.invalid> 
wrote:

> removed_email_address@domain.invalid> wrote:
>> And anything else you want to add.
>
--
Fabio K.
http://www.fabiokung.com

Caelum - Ensino e Inovação
http://www.caelum.com.br
AD (Guest)
on 2008-11-23 02:06
(Received via mailing list)
Thanks Fabio.

Funny you mention it, I am indeed having issues with dead timed out
connection connecting to mysql (tons of those mySqlException , last
connection was seen 0 ms ago errors).

Are all the config parameters you mentioned for JNDI and are not needed
for
the Rails 2.2 pooling ?  I didnt realize there was so much to
configuring
JNDI under tomcat.  I am not sure what tomcat uses by default.

Appreciate the help.

Adam
Fabio K. (Guest)
on 2008-11-23 02:16
(Received via mailing list)
On Sat, Nov 22, 2008 at 10:05 PM, AD <removed_email_address@domain.invalid> 
wrote:

> Are all the config parameters you mentioned for JNDI and are not needed for
> the Rails 2.2 pooling ?


Right. For the rails 2.2 connection pool, you just have to set the max
size:

production:
  pool: 20
  adapter: jdbcmysql
  encoding: utf8
  database: mydb
  username: root
  password:
  host: localhost


--
Fabio K.
http://www.fabiokung.com

Caelum - Ensino e Inovação
http://www.caelum.com.br
steve_molitor (Guest)
on 2008-11-23 04:04
(Received via mailing list)
How do I configure warbler (or whatever) to spin up just one Ruby
interpreter?  Or just a few.  I'd like to see how much this improves
memory
consumption, the number of concurrent requests that can be handle by one
JVM
instance, make sure there aren't any lurking thread bugs in Rails or
dependent libraries, etc.

Thanks,

Steve


Charles Oliver N.-2 wrote:
> And anything else you want to add.
>
--
View this message in context:
http://www.nabble.com/Rails-2.2-released%2C-lookin...
Sent from the JRuby - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Jay McGaffigan (Guest)
on 2008-11-23 15:24
(Received via mailing list)
Steve, in the warble rb file there is a min and max runtime setting.
Just
set them to 1
Charles Oliver N. (Guest)
on 2008-11-23 20:27
(Received via mailing list)
Yeah, I believe Warbler has smarts in place that if you set min = max =
1 it figures you are doing Rails 2.2. Nick would be able to confirm.

Jay McGaffigan wrote:
>
>
>>
>>
>>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Fabio K. (Guest)
on 2008-11-24 18:11
(Received via mailing list)
I can confirm, as I've already used it. Just set min = max = 1 and
jruby-rack won't use the PoolableApplicationFactory (runtime pool).

On Sun, Nov 23, 2008 at 4:25 PM, Charles Oliver N. <
removed_email_address@domain.invalid> wrote:

>>
>> consumption, the number of concurrent requests that can be handle by one
>>
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>
>


--
Fabio K.
http://www.fabiokung.com

Caelum - Ensino e Inovação
http://www.caelum.com.br
Mike H. (Guest)
on 2008-11-24 18:21
(Received via mailing list)
We are currently figuring out if we can take a run at upgrading before
we ship 1.0 of TriSano in Jan. If we can't we'll do so after.

You can follow along here:

https://trisano.csinitiative.net/wiki/Rails222Upgrade

Once we do upgrade, we'll have some decent historical performance data
to compare it to that for us at least will be exciting.

Mike

Mike H.
Program Manager, Collaborative Software Initiative
removed_email_address@domain.invalid
http://www.csinitiative.com

>             2. If it's working well for you, why? If not, why not?
>
>
>
>
>
> --
> Fabio K.
> http://www.fabiokung.com
>
> Caelum - Ensino e Inovação
> http://www.caelum.com.br

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Chris A. (Guest)
on 2008-11-24 19:39
(Received via mailing list)
On Sat, Nov 22, 2008 at 9:00 AM, Charles Oliver N.
<removed_email_address@domain.invalid> wrote:
> Rails 2.2 is now officially released (as 2.2.2) and we're really interested
> in hearing anyone's migration stories. There's a good chance your project
> would be widely promoted as examples of how much 2.2 has improved its
> concurrency story.

I've been building an app with a message-queue component, running in
Glassfish. I've been able to run my messaging code as a Message-driven
Bean with Rails 2.1, but it's only with 2.2 that I can let messages be
handled in parallel. I need to do some proper measurements of the
speed improvement that gives, but it's the difference between easily
keeping up with the sender and not in my case.

I wrote a quick note of what I've got working here:

  http://nodnol.org/blog/chris/entry/a_jruby_rails_m...

I think there's an opportunity for some extra tools to support JRuby
MDBs more easily - while I've got this working, I've had to write some
Java, an XML config file and use an IDE to build the MDB. I hope to
get chance to try and make it more generic and closer to the Rails
webapp WAR deployment experience.

That said, I'm really happy with this upgrade, and the performance I'm
getting with JRuby!


Chris.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Vlad GALU (Guest)
on 2008-11-25 12:24
(Received via mailing list)
Just migrated www.agilenetworks.ro (my pet project business) to JRuby
1.1.5/Rails 2.2/Tomcat6. Seems to work :) The only thing I miss is a
JRuby G.IP implementation :)

On Sat, Nov 22, 2008 at 11:00 AM, Charles Oliver N.
<removed_email_address@domain.invalid> wrote:
>
> - Charlie
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   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
Jin L. (Guest)
on 2008-11-25 17:44
(Received via mailing list)
Hey there all -

So far I am not having good results. Here is my environment:

Windows Server 2003
Java 6 Update 10
Apache 2.2
Tomcat 5.5 (via ProxyPass)
Jruby 1.1.5
Rails 2.2.2
Goldspike

jruby script/server is working fine. This is happening only when I
package
to war and deploy to my server (Perhaps the problem is goldspike since
it is
the one creating the war file?)

Upon starting up Tomcat, memory steadily shoots from 100 megs to 700+
megs.
CPU activity at constant 100%. Tomcats hang on any URL. Feels like
something
is looping, but not sure. Here are some of the error messages I am
seeing:

java.lang.ClassCastException:
org.jruby.RubyNameError$RubyNameErrorMessage
cannot be cast to java.lang.String
    at
org.jruby.webapp.RailsFactory.logRubyException(RailsFactory.java:159)
    at org.jruby.webapp.RailsFactory.makeObject(RailsFactory.java:138)
    at
org.jruby.webapp.util.CustomObjectPool.addObjectInternal(CustomObjectPool.java:111)
    at
org.jruby.webapp.util.CustomObjectPool.access$200(CustomObjectPool.java:15)
    at
org.jruby.webapp.util.CustomObjectPool$PoolSizeManager.run(CustomObjectPool.java:193)
java.lang.ClassCastException:
org.jruby.RubyNameError$RubyNameErrorMessage
cannot be cast to java.lang.String
    at
org.jruby.webapp.RailsFactory.logRubyException(RailsFactory.java:159)
    at org.jruby.webapp.RailsFactory.makeObject(RailsFactory.java:138)
    at
org.jruby.webapp.util.CustomObjectPool.addObjectInternal(CustomObjectPool.java:111)
    at
org.jruby.webapp.util.CustomObjectPool.access$200(CustomObjectPool.java:15)
    at
org.jruby.webapp.util.CustomObjectPool$PoolSizeManager.run(CustomObjectPool.java:193)
javax.servlet.ServletException: Could not load Rails. See the logs for
more
details.
    at org.jruby.webapp.RailsFactory.makeObject(RailsFactory.java:139)
    at
org.jruby.webapp.util.CustomObjectPool.addObjectInternal(CustomObjectPool.java:111)
    at
org.jruby.webapp.util.CustomObjectPool.access$200(CustomObjectPool.java:15)
    at
org.jruby.webapp.util.CustomObjectPool$PoolSizeManager.run(CustomObjectPool.java:193)


Any ideas?

Thanks,
Jin
Charles Oliver N. (Guest)
on 2008-11-25 17:59
(Received via mailing list)
Chris A. wrote:
>
> I think there's an opportunity for some extra tools to support JRuby
> MDBs more easily - while I've got this working, I've had to write some
> Java, an XML config file and use an IDE to build the MDB. I hope to
> get chance to try and make it more generic and closer to the Rails
> webapp WAR deployment experience.
>
> That said, I'm really happy with this upgrade, and the performance I'm
> getting with JRuby!

Cool, thanks for this Chris :) I hope we can keep improving things. And
I agree better "direct" support for MDB and other component types in
"pure Ruby" would be really nice. I know the GlassFish guys are planning
to look at that soon.

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Charles Oliver N. (Guest)
on 2008-11-25 18:01
(Received via mailing list)
Vlad GALU wrote:
> Just migrated www.agilenetworks.ro (my pet project business) to JRuby
> 1.1.5/Rails 2.2/Tomcat6. Seems to work :) The only thing I miss is a
> JRuby G.IP implementation :)

Glad to hear it's working :) And there's got to be dozens of geo IP
libraries for Java, which means you could just use them from JRuby too.

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Charles Oliver N. (Guest)
on 2008-11-25 18:02
(Received via mailing list)
Why are you using GoldSpike? It's really old at this point, and unlikely
to still work correctly in a lot of cases. Is there a reason you can't
use Warbler?

Jin L. wrote:
> Goldspike
> java.lang.ClassCastException:
> java.lang.ClassCastException:
> javax.servlet.ServletException: Could not load Rails. See the logs for
> Any ideas?
>     Just migrated www.agilenetworks.ro <http://www.agilenetworks.ro> (my
>      > would be widely promoted as examples of how much 2.2 has improved its
>      > ---------------------------------------------------------------------
>     ~/.signature: no such file or directory
>
>     ---------------------------------------------------------------------
>     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 L. (Guest)
on 2008-11-25 18:46
(Received via mailing list)
Hi Charles,

Thanks for your reply and information. Sorry, I did not realize
Goldspike
wasn't being maintained. It was working pretty well for me up until this
rails release.

I just gave warbler another shot (I tried it a few months back without
success) and here is the error message I get:

SEVERE: Exception caught
java.lang.NullPointerException
    at
org.jruby.rack.DefaultRackDispatcher.process(DefaultRackDispatcher.java:32)
    at org.jruby.rack.RackFilter.doFilter(RackFilter.java:51)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
    at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
    at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
    at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
    at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
    at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:895)
    at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
    at java.lang.Thread.run(Thread.java:619)

Would it help if I upgraded to tomcat 6 ? Thanks for any insight you can
provide. And apologies for the ignorance, I just joined this group a few
weeks ago.

Thanks,
Jin

On Tue, Nov 25, 2008 at 8:00 AM, Charles Oliver N. <
Vlad GALU (Guest)
on 2008-11-25 18:48
(Received via mailing list)
On Tue, Nov 25, 2008 at 6:00 PM, Charles Oliver N.
<removed_email_address@domain.invalid> wrote:
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>
>

Silly me! You were right, and it was just as easy as compiling the
Java implementation from MaxMind, and then using it in my application
controller:

-- cut here --
require 'java'
require 'maxmindgeoip.jar'
class ApplicationController < ActionController::Base
  def initialize
    super
    @@GEO ||=
com.maxmind.geoip.LookupService.new("#{RAILS_ROOT}/db/GeoIP.dat",

com.maxmind.geoip.LookupService::GEOIP_MEMORY_CACHE |

com.maxmind.geoip.LookupService::GEOIP_CHECK_CACHE)
  end
[...]
end
-- and here --

  BTW, how do I get rid of those ugly namespaces? I tried both
'import' and 'require_package', and they both failed.

--
~/.signature: no such file or directory

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Ikai L. (Guest)
on 2008-11-25 22:13
(Received via mailing list)
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" <removed_email_address@domain.invalid> 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
Charles Oliver N. (Guest)
on 2008-11-25 22:56
(Received via mailing list)
That's very strange...I don't have the code in front of me, but we'll
have to take a look and see why it's getting a NullPointerException
there. It's in the jruby-rack code.

Jin L. wrote:
> java.lang.NullPointerException
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
>     at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
> weeks ago.
>
>         Jruby 1.1.5
>         some of the error messages I am seeing:
>            at
>            at
> 
org.jruby.webapp.util.CustomObjectPool.addObjectInternal(CustomObjectPool.java:111)
>
>            pet project business) to JRuby
>            interested
>             >
>             >
>
>
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Charles Oliver N. (Guest)
on 2008-11-25 22:56
(Received via mailing list)
Vlad GALU wrote:
>>
> controller:
>
> com.maxmind.geoip.LookupService::GEOIP_CHECK_CACHE)
>   end
> [...]
> end
> -- and here --
>
>   BTW, how do I get rid of those ugly namespaces? I tried both
> 'import' and 'require_package', and they both failed.

Can you show what you tried? The following ought to work correctly:

class ApplicationController < ActionController::Base
   import com.maxmind.geoip.LookupService
...

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Vlad GALU (Guest)
on 2008-11-25 23:13
(Received via mailing list)
On Tue, Nov 25, 2008 at 10:03 PM, Ikai L. <removed_email_address@domain.invalid> 
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
Jin L. (Guest)
on 2008-11-26 00:03
(Received via mailing list)
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.
<removed_email_address@domain.invalid> 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
Jin L. (Guest)
on 2008-11-26 00:55
(Received via mailing list)
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. <removed_email_address@domain.invalid> 
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. 
<removed_email_address@domain.invalid <mailto:removed_email_address@domain.invalid>> 
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:removed_email_address@domain.invalid>>> wrote:
>>>           <removed_email_address@domain.invalid 
<mailto:removed_email_address@domain.invalid>
>>>            > 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 S. (Guest)
on 2008-11-26 03:15
(Received via mailing list)
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. <removed_email_address@domain.invalid> 
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 L. (Guest)
on 2008-11-26 19:31
(Received via mailing list)
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:in
`load_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:in
`load_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
Julio C. (Guest)
on 2008-11-26 20:04
(Received via mailing list)
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:removed_email_address@domain.invalid>
>         >>>>           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
Jin L. (Guest)
on 2008-11-27 18:15
(Received via mailing list)
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. 
<removed_email_address@domain.invalid>
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. <removed_email_address@domain.invalid>
>>         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
>>         >> <removed_email_address@domain.invalid> 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:removed_email_address@domain.invalid> 
<mailto:removed_email_address@domain.invalid
>>         >>>>           JRuby G.IP implementation :)
>>         >>>>        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 L. (Guest)
on 2008-11-29 19:24
(Received via mailing list)
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-close... 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. <removed_email_address@domain.invalid> 
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)
>>>         >>>>
>>>         >>>>
>>>         <removed_email_address@domain.invalid
>>>         >>>>        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
Bill K. (Guest)
on 2008-11-29 21:14
(Received via mailing list)
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
Charles Oliver N. (Guest)
on 2008-11-30 01:58
(Received via mailing list)
Another great story :) 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
Jin L. (Guest)
on 2008-12-02 12:10
(Received via mailing list)
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.
<removed_email_address@domain.invalid> 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:removed_email_address@domain.invalid>
>>>>>        >>>>           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
Paweł Wielgus (Guest)
on 2008-12-03 09:49
(Received via mailing list)
Hi All,
maybe not exactly rails story but:
http://poulwiel.blogspot.com/2008/12/my-jruby-succ...

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

Best greetings,
Pawe³ Wielgus.
Dave Ray (Guest)
on 2008-12-19 21:08
(Received via mailing list)
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
This topic is locked and can not be replied to.