Forum: JRuby running a Sinatra app as a Windows service

2d1b64aaf61046ad166db3009fa8c7dc?d=identicon&s=25 Charles Monteiro (Guest)
on 2013-11-17 03:39
(Received via mailing list)
Im mandated to deploy unfortunately on Windows . I was hoping to do it
on TorqueBox but on Windows Im encountering a number off issues , so I
think I will defer the TorqueBox deployment until I mature a bit its use
and especially its use on Windows.

Anyhow, my real immediate really urgent need is to deploy this as a
Windows service by Monday :)

So its a sinatra app which takes in http , does MQ puts, some file event
listening etc. Pretty straightforward. At the moment I think I will try
to use Warbler to create a runnable jar which I trust it can do , I have
built jars with it,  but then I need to figure out how to create a
windows service to wrap that war.

While developing I also used Trinidad.

I really cant take on app server learning curve now, I need a quick
solution to run the app and I will later figure out how to put in a more
scaleable context.

Any thoughts, ideas, feedback.

Greatly appreciated.

thanks

Charles
Caa2df9372ffa0a9e95b2bab1e8fea34?d=identicon&s=25 Karol Bucek (Guest)
on 2013-11-17 08:07
(Received via mailing list)
It should be pretty fast to setup the windows service with Trinidad's
trinidad_init_services gem, just : jruby -S gem install
trinidad_init_services

and than run : jruby -S trinidad_init_service it will work you throught
the
details about your app (e.g. where it's located on the FS) ...

Hope you get it working by Monday :)

K.
2d1b64aaf61046ad166db3009fa8c7dc?d=identicon&s=25 Charles Monteiro (Guest)
on 2013-11-17 17:37
(Received via mailing list)
excellent, thank you

Im using Warbler to pack up into war , hopefully it can take that
output. Ill go check that out now.


Charles
Caa2df9372ffa0a9e95b2bab1e8fea34?d=identicon&s=25 Karol Bucek (Guest)
on 2013-11-17 19:18
(Received via mailing list)
that might not be the best choice - there's no special support for
warbler
generated .war files ...

thus theoretically, since that .war is self packed with jruby, it should
start "another" jruby from within the jruby trindiad's running
... causing "virtual" true object-oriented recursion ending up opening a
black hole or bringing us world peace :) !

so it might be best for you to roll old school ... just put the rails
app
in the file-system as is.
974b3d592f78510db0227e528841ccb9?d=identicon&s=25 Robin McKay (robin2)
on 2013-11-17 20:39
This thread may be useful

https://www.ruby-forum.com/topic/4416022

...R
2d1b64aaf61046ad166db3009fa8c7dc?d=identicon&s=25 Charles Monteiro (Guest)
on 2013-11-18 00:50
(Received via mailing list)
Actually it was very useful and interesting. Namely it set me on trying
to ascertain whether I had a missing jar/wrong jar , it turns out that I
needed this:

bcprov-jdk15on-1.47.jar

which I found under
/Users/charles/.rvm/rubies/jruby-1.7.6/lib/ruby/shared

I tried Jbundler but i probably misunderstood how it works. We do need
something that pulls in all the dependent jars perhaps jbundler  perhaps
your findjars.rb. Development cant that different from prod. I fear that
RVM might be making it too dependent. Need to indeed work with multiple
per project copies of Jruby. Thats exactly what we do with Smalltalk
that way you can replicate easily anywhere.

Now Im hoping I dont have any other system decencies, now to test on my
Windows vmware image.

thanks for the help

Charles
2d1b64aaf61046ad166db3009fa8c7dc?d=identicon&s=25 Charles Monteiro (Guest)
on 2013-11-19 07:28
(Received via mailing list)
maybe Ill achieve world peace , lets hope.

policies that control me dont leave me that choice, supposedly you can
run the war under any Java app server, and I can service that.
or srvany the executable war



Charles
2c0c4cf3ccc8da22f7c3b9586ce1cd70?d=identicon&s=25 Christian MICHON (Guest)
on 2013-11-19 07:34
(Received via mailing list)
Warbler is not the way here unless you remove Trinidad.

Srvany is the right way, but keep in mind the service will not restart
if
your app crashes. At least if you get reboots due to Windows updates,
your
service will restart...
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.