Forum: JRuby Deployment Problem

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.
64084ae20fde88d19b1761a9b267167f?d=identicon&s=25 Josef Sauter (apokalipto)
on 2009-04-14 15:13
Hi Guys,

I am having quite a hard time deploying my app to glassfish v2.
I migrated my running app, from rails 2.0.2 to 2.3.0. i am using
netbeans, and i am using webrick in development, and everything works
fine.

I wanted to try a test production deployment, and i was using the
goldspike plugin to create the war file. that worked for me very good
with rails 2.0.2.

Right now, i used goldspike, and it creates the war file as before. I
deploy it with the autodeploy feature in glassfish, it deploys, but for
some reason when trying to access the app there is an error with active
record. I assume that maybe something with the adapter, since i had the
same problem in the past when using jdbcmysql.

The problem now is that rails 2.3 does not come with te ruby mysql, and
jRuby is not able to manage native extensions, so i have to use the
jdbcmysql adapter, which works fine in development with webrick.

After a while of trying diferent database setups passing the url,
driver, host, port parameters i still have no luck of making it work.

I then tried to use the warbler gem, which i have never been able to get
to work. After the creation of all app folders in tmp/war i get the
following error

....
mkdir -p tmp/war/WEB-INF
jar cf balmes165.war  -C tmp/war .
rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.split
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/repaired_system.rb:109:in
`find_runnable'

So, any sugestions on how can i deploy my app ?
I am using jruby 1.1.6, rails 2.3.2 glassfish v2

Thanks in advance
64084ae20fde88d19b1761a9b267167f?d=identicon&s=25 Josef Sauter (apokalipto)
on 2009-04-14 19:39
Hi guys, i solved it

Just to help those who may have the same problem.

It turns out that jar wasnt added to my path. so when i tried to warble
my app, the jruby implementation finished with an error, without
specifying, what the problem really was. I warble the app with my normal
ruby, got the error jar no recognized as comand, i added it to the path,
and warble the app.

The next problem was that i didant have configured config/warble.rb, to
load the the needed java libraries. I uncomented the line 22 in
warble.rb: config.java_libs += FileList["lib/java/*.war"]

And that was it

Cheers
Josef

Josef Sauter wrote:
> Hi Guys,
>
> I am having quite a hard time deploying my app to glassfish v2.
> I migrated my running app, from rails 2.0.2 to 2.3.0. i am using
> netbeans, and i am using webrick in development, and everything works
> fine.
>
> I wanted to try a test production deployment, and i was using the
> goldspike plugin to create the war file. that worked for me very good
> with rails 2.0.2.
>
> Right now, i used goldspike, and it creates the war file as before. I
> deploy it with the autodeploy feature in glassfish, it deploys, but for
> some reason when trying to access the app there is an error with active
> record. I assume that maybe something with the adapter, since i had the
> same problem in the past when using jdbcmysql.
>
> The problem now is that rails 2.3 does not come with te ruby mysql, and
> jRuby is not able to manage native extensions, so i have to use the
> jdbcmysql adapter, which works fine in development with webrick.
>
> After a while of trying diferent database setups passing the url,
> driver, host, port parameters i still have no luck of making it work.
>
> I then tried to use the warbler gem, which i have never been able to get
> to work. After the creation of all app folders in tmp/war i get the
> following error
>
> ....
> mkdir -p tmp/war/WEB-INF
> jar cf balmes165.war  -C tmp/war .
> rake aborted!
> You have a nil object when you didn't expect it!
> You might have expected an instance of Array.
> The error occurred while evaluating nil.split
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/repaired_system.rb:109:in
> `find_runnable'
>
> So, any sugestions on how can i deploy my app ?
> I am using jruby 1.1.6, rails 2.3.2 glassfish v2
>
> Thanks in advance
This topic is locked and can not be replied to.