RingoJS on tomcat

201 views
Skip to first unread message

Tsirkin Evgeny

unread,
Oct 13, 2010, 7:34:18 AM10/13/10
to RingoJS
I guess this is a really newbie question,but...
Is it possible and how do I do the development and deploying on
tomcat?
I have already read this:
http://groups.google.com/group/ringojs/browse_thread/thread/57476d4bd3115dcd/58b02ecc84331ec3?lnk=gst&q=tomcat#58b02ecc84331ec3
But is there a way to develop on tomcat ?I mean ,web containers tend
to be different
and it is much better to already develop using the one your app is
going to be deployed
into.
Thanks
Evgeny

Oleg Podsechin

unread,
Oct 13, 2010, 12:11:43 PM10/13/10
to RingoJS
Yes, you should be able to just point Tomcat to your Ringo webapp
directory (i.e. the unzipped WAR, with WEB-INF dir, web.xml, all the
JARs etc.) & go from there. Alternatively if you're using default
Tomcat settings, copy the ringo webapp dir into tomcat/webapps.

In my experience developing using the embedded Jetty and deploying to
Tomcat hasn't caused too many problems though, apart from the ones
with httpclient.

Oleg

On Oct 13, 1:34 pm, Tsirkin Evgeny <tsir...@gmail.com> wrote:
> I guess this is a really newbie question,but...
> Is it possible and how do I do the development and deploying on
> tomcat?
> I have already read this:http://groups.google.com/group/ringojs/browse_thread/thread/57476d4bd...

Tsirkin Evgeny

unread,
Oct 13, 2010, 4:29:00 PM10/13/10
to rin...@googlegroups.com
That's a little off topic but does the debugger (ringo -d) works with web application?
Evgeny

--
You received this message because you are subscribed to the Google Groups "RingoJS" group.
To post to this group, send email to rin...@googlegroups.com.
To unsubscribe from this group, send email to ringojs+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ringojs?hl=en.


Oleg Podsechin

unread,
Oct 14, 2010, 10:31:58 AM10/14/10
to RingoJS
Yes, you should be able to set the "debug" parameter to "true" in
web.xml, like this:

<servlet>
<servlet-name>ringo</servlet-name>
<servlet-class>org.ringojs.jsgi.JsgiServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
<!-- other params go here -->
</init-param>
</servlet>

For a full list of parameters, take a look at:

http://github.com/ringo/ringojs/blob/master/src/org/ringojs/jsgi/JsgiServlet.java

Oleg

On Oct 13, 10:29 pm, Tsirkin Evgeny <tsir...@gmail.com> wrote:
> That's a little off topic but does the debugger (ringo -d) works with web
> application?
> Evgeny
>
> > ringojs+u...@googlegroups.com<ringojs%2Bunsu...@googlegroups.com >
> > .

Tsirkin Evgeny

unread,
Oct 14, 2010, 11:21:15 AM10/14/10
to rin...@googlegroups.com
Thanks!

To unsubscribe from this group, send email to ringojs+u...@googlegroups.com.

Hannes Wallnoefer

unread,
Oct 14, 2010, 11:25:17 AM10/14/10
to rin...@googlegroups.com
2010/10/13 Oleg Podsechin <oleg.po...@gmail.com>:

> Yes, you should be able to just point Tomcat to your Ringo webapp
> directory (i.e. the unzipped WAR, with WEB-INF dir, web.xml, all the
> JARs etc.) & go from there. Alternatively if you're using default
> Tomcat settings, copy the ringo webapp dir into tomcat/webapps.
>
> In my experience developing using the embedded Jetty and deploying to
> Tomcat hasn't caused too many problems though, apart from the ones
> with httpclient.

ringo/httpclient should be working in other servlet containers
provided you add the necessary jar files (jetty-client.jar and
probably a few others).

BTW, the ringo-admin package script would still be nice to have in ringo!
http://github.com/olegp/ringojs/commit/86fc80584683be4202c538119641ca672edf5499

Hannes

> Oleg
>
> On Oct 13, 1:34 pm, Tsirkin Evgeny <tsir...@gmail.com> wrote:
>> I guess this is a really newbie question,but...
>> Is it possible and how do I do the development and deploying on
>> tomcat?
>> I have already read this:http://groups.google.com/group/ringojs/browse_thread/thread/57476d4bd...
>> But is there a way to develop on tomcat ?I mean ,web containers tend
>> to be different
>> and it is much better to already develop using the one your app is
>> going to be deployed
>> into.
>> Thanks
>> Evgeny
>

Oleg Podsechin

unread,
Oct 14, 2010, 1:19:01 PM10/14/10
to RingoJS
Btw, to get it to run with the latest version of ringo, comment out
the line:

require('core/string');

Oleg

On Oct 14, 4:25 pm, Hannes Wallnoefer <han...@helma.at> wrote:
> 2010/10/13 Oleg Podsechin <oleg.podsec...@gmail.com>:
>
> > Yes, you should be able to just point Tomcat to your Ringo webapp
> > directory (i.e. the unzipped WAR, with WEB-INF dir, web.xml, all the
> > JARs etc.) & go from there. Alternatively if you're using default
> > Tomcat settings, copy the ringo webapp dir into tomcat/webapps.
>
> > In my experience developing using the embedded Jetty and deploying to
> > Tomcat hasn't caused too many problems though, apart from the ones
> > with httpclient.
>
> ringo/httpclient should be working in other servlet containers
> provided you add the necessary jar files (jetty-client.jar and
> probably a few others).
>
> BTW, the ringo-admin package script would still be nice to have in ringo!http://github.com/olegp/ringojs/commit/86fc80584683be4202c538119641ca...

tschaub

unread,
Nov 1, 2010, 11:30:43 AM11/1/10
to RingoJS
I'm not having any luck running Ringo in debug mode on Tomcat. Can
anyone else confirm that this is working?

I'm using the latest Ringo from today (e667e47), Tomcat 5.5 (apache-
tomcat-5.5.29), and the results of `ringo-admin create -a foo` as a
webapp.

When I add the debug init-param to my web.xml, I get the trace below
in my logs. The same app works without the debug init-param.

Thanks for any tips.
Tim

Nov 1, 2010 9:20:02 AM org.apache.catalina.core.StandardContext
loadOnStartup
SEVERE: Servlet /foo threw load() exception
java.lang.RuntimeException: NOT SUPPORTED
at org.mozilla.javascript.Context.compileImpl(Context.java:2434)
at org.mozilla.javascript.Context.compileReader(Context.java:1328)
at
org.ringojs.engine.ReloadableScript.getSimpleScript(ReloadableScript.java:
152)
at
org.ringojs.engine.ReloadableScript.getScript(ReloadableScript.java:
118)
at org.ringojs.engine.ReloadableScript.evaluate(ReloadableScript.java:
216)
at org.ringojs.engine.RhinoEngine.evaluateScript(RhinoEngine.java:
476)
at org.ringojs.engine.RhinoEngine.<init>(RhinoEngine.java:116)
at org.ringojs.jsgi.JsgiServlet.init(JsgiServlet.java:95)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:
1139)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:
966)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3996)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:
4266)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:
760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:
740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:
544)
at
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:
980)
at
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:
943)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:
500)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1203)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:
319)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:
120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1022)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:
443)
at
org.apache.catalina.core.StandardService.start(StandardService.java:
448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:
700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Nov 1, 2010 9:20:02 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Nov 1, 2010 9:20:02 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Nov 1, 2010 9:20:02 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Nov 1, 2010 9:20:02 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Nov 1, 2010 9:20:30 AM org.apache.catalina.core.StandardWrapperValve
invoke
SEVERE: Allocate exception for servlet ringo
java.lang.RuntimeException: NOT SUPPORTED
at org.mozilla.javascript.Context.compileImpl(Context.java:2434)
at org.mozilla.javascript.Context.compileReader(Context.java:1328)
at
org.ringojs.engine.ReloadableScript.getSimpleScript(ReloadableScript.java:
152)
at
org.ringojs.engine.ReloadableScript.getScript(ReloadableScript.java:
118)
at org.ringojs.engine.ReloadableScript.evaluate(ReloadableScript.java:
216)
at org.ringojs.engine.RhinoEngine.evaluateScript(RhinoEngine.java:
476)
at org.ringojs.engine.RhinoEngine.<init>(RhinoEngine.java:116)
at org.ringojs.jsgi.JsgiServlet.init(JsgiServlet.java:95)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:
1139)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:
966)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3996)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:
4266)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:
760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:
740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:
544)
at
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:
980)
at
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:
943)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:
500)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1203)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:
319)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:
120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1022)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:
443)
at
org.apache.catalina.core.StandardService.start(StandardService.java:
448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:
700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)



On Oct 14, 8:31 am, Oleg Podsechin <oleg.podsec...@gmail.com> wrote:
> Yes, you should be able to set the "debug" parameter to "true" in
> web.xml, like this:
>
> <servlet>
> <servlet-name>ringo</servlet-name>
> <servlet-class>org.ringojs.jsgi.JsgiServlet</servlet-class>
> <init-param>
> <param-name>debug</param-name>
> <param-value>true</param-value>
> <!-- other params go here -->
> </init-param>
> </servlet>
>
> For a full list of parameters, take a look at:
>
> http://github.com/ringo/ringojs/blob/master/src/org/ringojs/jsgi/Jsgi...

Tim Schaub

unread,
Nov 1, 2010, 5:20:14 PM11/1/10
to rin...@googlegroups.com
On 11/1/10 9:30 AM, tschaub wrote:
> I'm not having any luck running Ringo in debug mode on Tomcat. Can
> anyone else confirm that this is working?
>

For the record, this works after
http://github.com/ringo/ringojs/commit/0e8d48b2d991c0966def8a6c5e931d6fcd1b5744

Thanks for the fix.

Tim

>>>> JARs etc.)& go from there. Alternatively if you're using default

James Cook

unread,
Nov 1, 2010, 11:44:23 PM11/1/10
to rin...@googlegroups.com
We deploy on Tomcat. I'm interested in knowing what this fix actually did.

-- jim

To unsubscribe from this group, send email to ringojs+u...@googlegroups.com.

Hannes Wallnoefer

unread,
Nov 2, 2010, 3:26:09 AM11/2/10
to rin...@googlegroups.com
2010/11/2 James Cook <jc...@tracermedia.com>:

> We deploy on Tomcat. I'm interested in knowing what this fix actually did.

The problem was that when you activated the debugger with JsgiServlet,
it didn't automatically set optimization level to -1 as it does with
the command line runner. The commit fixes this.

Hannes

Reply all
Reply to author
Forward
0 new messages