I’m having a bad time deploying a simple scaffold rails app to an OC4j
app
server. I don’t know why, i’m having very weird class cast exceptions
when
trying to access my rails app beside the “Welcome aboard” page.
There is the error:
10/11/17 12:32:00.689 jruby-rack-example: 10.1.3.5.0 Started
10/11/17 12:32:59.380 jruby-rack-example: Servlet error
java.lang.ClassCastException: org.jruby.rack.RackFilter$2
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0)
This OC4J is Servlet API 2.4. I’m using jruby-rack 0.9.6, as explained
at
this post (
)
I was wondering that it could be something related to Servlet Spec, but
i
could get it deployed correctly at Tomcat 5.5 which is also Servlet 2.4.
The only glitch i’ve found using tomcat is this, but i don’t know if
that
would make any difference.
/home/vitor/tools/apache-tomcat-5.5.31/webapps/jruby-rack-example/WEB-INF/gems/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack.rb:17
warning: already initialized constant VERSION
I’m using warble 0.9.14, but i’m replacing the original jars (which also
gave me a similar error) with jruby-rack-0.9.6.jar and
jruby-complete-1.3.1.jar.
I don’t know what more to try. I’ve done everything pretty much standard
so
far, and in tomcat it simply work.
I’m using warble 0.9.14, but i’m replacing the original jars (which also
gave me a similar error) with jruby-rack-0.9.6.jar and
jruby-complete-1.3.1.jar.
I don’t know what more to try. I’ve done everything pretty much standard so
far, and in tomcat it simply work.
I’m running out of ideas too. Couple more things to try:
Build jruby-rack from source – pull the 0.9.6 tag. Then if you want
you can try tweaking the source. I suspect the issue with RackFilter$2
is the “maybeAppendHtmlToPath” method. You could remove it and rebuild
a new jar.
Try the org.jruby.rack.RackServlet instead. You’d change your
web.xml to declare the servlet and its servlet-mapping, and remove the
filter and filter-mapping. But in this case you’ll probably want to
have a frontend to serve static assets. RackServlet can serve them but
it won’t be very performant.
I noticed that the problem only happens with the oc4j version 10.1.3.5 -
which is the latest version provided by oracle. When i deployed at
10.1.3.4
(which oracle doesn’t seems to provide a link to it), everything worked
as
expected.
I’m going to try your tips and i’ll post the results right away.
Thanks for your help and sorry for the late reply.