org.jruby.rack.RackInitializationException when deploying on oc4j.

83 views
Skip to first unread message

Marcelo Murad

unread,
Oct 19, 2009, 5:16:57 PM10/19/09
to oracle-...@googlegroups.com
Hi all,

Does anybody already got the below error?

Gem was deployed with the war file.

rails-2.3.2
activerecord-oracle_enhanced-adapter-1.2.1

Regards,
Marcelo


org.jruby.rack.RackInitializationException: Please install the oracle_enhanced adapter: `gem install activerecord-oracle_enhanced-adapter` (LoadError)
        from /oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/gems/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:60:in `establish_connection'
        from /oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/gems/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection'
        from /oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/gems/gems/rails-2.3.2/lib/initializer.rb:417:in `initialize_database'
        from /oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/gems/gems/rails-2.3.2/lib/initializer.rb:141:in `process'
        from /oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/gems/gems/rails-2.3.2/lib/initializer.rb:113:in `run'
        from /oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/config/environment.rb:21
        from /oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/config/environment.rb:29:in `load'
        from /oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/lib/jruby-rack-0.9.3.jar!/jruby/rack/rails.rb:29:in `load_environment'
        from /oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/lib/jruby-rack-0.9.3.jar!/jruby/rack/rails.rb:152:in `new'
        from <script>:3
        from /oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/lib/jruby-rack-0.9.3.jar!/rack/builder.rb:22:in `instance_eval'
        from /oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/lib/jruby-rack-0.9.3.jar!/rack/builder.rb:22:in `initialize'
        from <script>:3

        at org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:154)
        at org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:53)
        at org.jruby.rack.PoolingRackApplicationFactory.getApplication(PoolingRackApplicationFactory.java:97)
        at org.jruby.rack.DefaultRackDispatcher.process(DefaultRackDispatcher.java:31)
        at org.jruby.rack.RackFilter.doFilter(RackFilter.java:51)
        at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:622)
        at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:369)
        at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0) ].server.http.HttpRequestHandler.handleNotFound(HttpRequestHandler.java:1035)
        at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:905)
        at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:447)
        at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:302)
        at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:190)
        at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
        at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
        at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
        at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
        at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
        at java.lang.Thread.run(Thread.java:595)
Caused by: org.jruby.exceptions.RaiseException
        at Kernel.raise(/oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/gems/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:76)
        at #<Class:01x134c8b>.establish_connection(/oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/gems/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:60)
        at #<Class:01x134c8b>.establish_connection(/oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/gems/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:55)
        at #<Class:01x134c8b>.establish_connection(/oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/gems/gems/rails-2.3.2/lib/initializer.rb:417)
        at Rails::Initializer.initialize_database(/oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/gems/gems/rails-2.3.2/lib/initializer.rb:141)
        at Rails::Initializer.process(/oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/gems/gems/rails-2.3.2/lib/initializer.rb:113)
        at #<Class:01x69a38f>.run(/oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/config/environment.rb:21)
        at (unknown).(unknown)(/oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/config/environment.rb:29)
        at Kernel.load(/oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/lib/jruby-rack-0.9.3.jar!/jruby/rack/rails.rb:29)
        at JRuby::Rack::RailsServletHelper.load_environment(/oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/lib/jruby-rack-0.9.3.jar!/jruby/rack/rails.rb:152)
        at #<Class:01x19a1d57>.new(<script>:3)
        at (unknown).(unknown)(/oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/lib/jruby-rack-0.9.3.jar!/rack/builder.rb:22)
        at Kernel.instance_eval(/oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/lib/jruby-rack-0.9.3.jar!/rack/builder.rb:22)
        at Kernel.instance_eval(/oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/lib/jruby-rack-0.9.3.jar!/rack/builder.rb:22)
        at Rack::Builder.initialize(<script>:3)
        at (unknown).(unknown)(:1)


--
Marcelo Murad
http://marcelomurad.com
Cel.: (55 21) 8819-5902

Raimonds Simanovskis

unread,
Oct 20, 2009, 3:57:03 AM10/20/09
to Oracle enhanced adapter for ActiveRecord
Have you included oracle_enhanced gem in environment.rb file like
this:
config.gem "activerecord-oracle_enhanced-adapter", :lib =>
"active_record/connection_adapters/oracle_enhanced_adapter"
?

Do you have ojdbc14.jar in class path?

And please try to use latest version 1.2.2 of oracle_enhanced adapter.

Raimonds
> /oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-IN F/lib/jruby-rack-0.9.3.jar!/jruby/rack/rails.rb:152:in
> `new'
>         from <script>:3
>         from
> /oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-IN F/lib/jruby-rack-0.9.3.jar!/rack/builder.rb:22:in
> `instance_eval'
>         from
> /oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appraisal/WEB-IN F/lib/jruby-rack-0.9.3.jar!/rack/builder.rb:22:in
> `initialize'
>         from <script>:3
>
>         at
> org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationF actory.java:154)
>         at
> org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackAppl icationFactory.java:53)
>         at
> org.jruby.rack.PoolingRackApplicationFactory.getApplication(PoolingRackAppl icationFactory.java:97)
>         at
> org.jruby.rack.DefaultRackDispatcher.process(DefaultRackDispatcher.java:31)
>         at org.jruby.rack.RackFilter.doFilter(RackFilter.java:51)
>         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0)
> ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java :622)
>         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0)
> ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispat cher.java:369)
>         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0)
> ].server.http.HttpRequestHandler.handleNotFound(HttpRequestHandler.java:103 5)
>         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0)
> ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:9 05)
>         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0)
> ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:447 )
>         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0)
> ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:302)
>         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0)
> ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:190)
>         at
> oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketRe adHandler.java:260)
>         at
> oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocket AcceptHandler.java:239)
>         at
> oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAccept Handler.java:34)
>         at
> oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(Server SocketAcceptHandler.java:880)
>         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0)
> ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePool edExecutor.java:303)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: org.jruby.exceptions.RaiseException
>         at
> Kernel.raise(/oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/app raisal/WEB-INF/gems/gems/activerecord-2.3.2/lib/active_record/connection_ad apters/abstract/connection_specification.rb:76)
>         at
> #<Class:01x134c8b>.establish_connection(/oracle/product/10.1.3/oc4j/j2ee/hr /applications/appraisal/appraisal/WEB-INF/gems/gems/activerecord-2.3.2/lib/ active_record/connection_adapters/abstract/connection_specification.rb:60)
>         at
> #<Class:01x134c8b>.establish_connection(/oracle/product/10.1.3/oc4j/j2ee/hr /applications/appraisal/appraisal/WEB-INF/gems/gems/activerecord-2.3.2/lib/ active_record/connection_adapters/abstract/connection_specification.rb:55)
>         at
> #<Class:01x134c8b>.establish_connection(/oracle/product/10.1.3/oc4j/j2ee/hr /applications/appraisal/appraisal/WEB-INF/gems/gems/rails-2.3.2/lib/initial izer.rb:417)
>         at
> Rails::Initializer.initialize_database(/oracle/product/10.1.3/oc4j/j2ee/hr/ applications/appraisal/appraisal/WEB-INF/gems/gems/rails-2.3.2/lib/initiali zer.rb:141)
>         at
> Rails::Initializer.process(/oracle/product/10.1.3/oc4j/j2ee/hr/applications /appraisal/appraisal/WEB-INF/gems/gems/rails-2.3.2/lib/initializer.rb:113)
>         at
> #<Class:01x69a38f>.run(/oracle/product/10.1.3/oc4j/j2ee/hr/applications/app raisal/appraisal/WEB-INF/config/environment.rb:21)
>         at
> (unknown).(unknown)(/oracle/product/10.1.3/oc4j/j2ee/hr/applications/apprai sal/appraisal/WEB-INF/config/environment.rb:29)
>         at
> Kernel.load(/oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal/appr aisal/WEB-INF/lib/jruby-rack-0.9.3.jar!/jruby/rack/rails.rb:29)
>         at
> JRuby::Rack::RailsServletHelper.load_environment(/oracle/product/10.1.3/oc4 j/j2ee/hr/applications/appraisal/appraisal/WEB-INF/lib/jruby-rack-0.9.3.jar !/jruby/rack/rails.rb:152)
>         at #<Class:01x19a1d57>.new(<script>:3)
>         at
> (unknown).(unknown)(/oracle/product/10.1.3/oc4j/j2ee/hr/applications/apprai sal/appraisal/WEB-INF/lib/jruby-rack-0.9.3.jar!/rack/builder.rb:22)
>         at
> Kernel.instance_eval(/oracle/product/10.1.3/oc4j/j2ee/hr/applications/appra isal/appraisal/WEB-INF/lib/jruby-rack-0.9.3.jar!/rack/builder.rb:22)
>         at
> Kernel.instance_eval(/oracle/product/10.1.3/oc4j/j2ee/hr/applications/appra isal/appraisal/WEB-INF/lib/jruby-rack-0.9.3.jar!/rack/builder.rb:22)
>         at Rack::Builder.initialize(<script>:3)
>         at (unknown).(unknown)(:1)
>
> --
> *Marcelo Murad *http://marcelomurad.com
> Cel.: (55 21) 8819-5902

Marcelo Murad

unread,
Oct 20, 2009, 7:04:58 AM10/20/09
to oracle-...@googlegroups.com
Hi,

Thanks for the instant reply!

environment.rb has the config.gem line and I updated to the latest version of oracle_enhanced adapter.

About ojdb14.jar, I tried to puts ENV["PATH"] but it returns empty. I puts ENV_JAVA['java.class.path'] and it returns oc4j.jar. I tried to force require '/oracle/product/10.1.2/infra/jdbc/lib/ojdbc14.jar' on oracle_enhanced_jdbc_connection.rb and still get the same error.

The error occurs right after I restart oc4j container.


--
Marcelo Murad
http://marcelomurad.com
Cel.: (55 21) 8819-5902

Marcelo Murad

unread,
Oct 20, 2009, 7:15:30 AM10/20/09
to oracle-...@googlegroups.com
I found another log that is giving me this.

/oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal2/appraisal/WEB-INF/gems/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack.rb:17 warning: already initialized constant VERSION
JRuby limited openssl loaded. gem install jruby-openssl for full support.
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
ERROR: ActiveRecord oracle_enhanced adapter could not load Oracle JDBC driver. Please install ojdbc14.jar library.

Thanks again,
Marcelo

Raimonds Simanovskis

unread,
Oct 20, 2009, 9:46:41 AM10/20/09
to Oracle enhanced adapter for ActiveRecord
Hmm, hard to tell what is the issue - I am not deploying using WAR
files by myself.

Try to debug oracle_enhanced_jdbc_connection.rb to find out in which
line exception is raised (maybe comment out rescue LoadError,
NameError to find out in which line what exception is raised).

I found that there is one guide which maybe can help you
http://wiki.oracle.com/page/JRuby+on+Rails:+Deploying+to+Oracle+Containers+for+Java+EE+%28OC4J%29

As far as I understand OC4J should already have ojdbc14.jar in
classpath (should be in ENV_JAVA['java.class.path']) and therefore
adapter should not try to require it. After that
java.sql.DriverManager.registerDriver
Java::oracle.jdbc.driver.OracleDriver.new
is called - probably it is failing.

Raimonds

On Oct 20, 2:15 pm, Marcelo Murad <marcelo.mu...@gmail.com> wrote:
> I found another log that is giving me this.
>
> /oracle/product/10.1.3/oc4j/j2ee/hr/applications/appraisal2/appraisal/WEB-I NF/gems/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack.rb :17
> warning: already initialized constant VERSION
> JRuby limited openssl loaded. gem install jruby-openssl for full support.http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
> ERROR: ActiveRecord oracle_enhanced adapter could not load Oracle JDBC
> driver. Please install ojdbc14.jar library.
>
> Thanks again,
> Marcelo
>
> On Tue, Oct 20, 2009 at 9:04 AM, Marcelo Murad <marcelo.mu...@gmail.com>wrote:
>
>
>
> > Hi,
>
> > Thanks for the instant reply!
>
> > environment.rb has the config.gem line and I updated to the latest version
> > of oracle_enhanced adapter.
>
> > About ojdb14.jar, I tried to puts ENV["PATH"] but it returns empty. I puts
> > ENV_JAVA['java.class.path'] and it returns oc4j.jar. I tried to force
> > require '/oracle/product/10.1.2/infra/jdbc/lib/ojdbc14.jar' on
> > oracle_enhanced_jdbc_connection.rb and still get the same error.
>
> > The error occurs right after I restart oc4j container.
>
> > --
> > *Marcelo Murad *

Marcelo Murad

unread,
Oct 20, 2009, 4:43:12 PM10/20/09
to oracle-...@googlegroups.com
Raimonds,

Thanks for the reply.

I debugged oracle_enhanced_jdbc_connection.rb and find out that  ENV_JAVA['java.class.path'] =~ Regexp.new(ojdbc_jar) is false. ENV_JAVA['java.class.path'] is returning only oc4j.jar.

So when the script is executed it enters in the unless statement and gives me a error when it tries to ENV["PATH"].split(/[:;]/). ENV['PATH'] is nil.

I'm not a Oracle Application Server master, so I don't know why java.class.path is only returning me oc4j.jar. I will talk with DBA and try to figure it out.

For now, I just commented all the unless block and forced require ojdbc14.jar. I know that is a hack, but until we discover the real problem it is good.

Thanks a lot for your help!

Regards,
Marcelo Murad

manalang

unread,
Oct 21, 2009, 1:28:19 PM10/21/09
to Oracle enhanced adapter for ActiveRecord
Placing the ojdbc.jar inside your RAILS_ROOT/lib dir should work.
Warbler automatically places everything in RAILS_ROOT/lib inside the
WEB-INF/lib dir after it's war'd up.

Rich


On Oct 20, 1:43 pm, Marcelo Murad <marcelo.mu...@gmail.com> wrote:
> Raimonds,
>
> Thanks for the reply.
>
> I debugged oracle_enhanced_jdbc_connection.rb and find out that
> ENV_JAVA['java.class.path'] =~ Regexp.new(ojdbc_jar) is false.
> ENV_JAVA['java.class.path'] is returning only oc4j.jar.
>
> So when the script is executed it enters in the unless statement and gives
> me a error when it tries to ENV["PATH"].split(/[:;]/). ENV['PATH'] is nil.
>
> I'm not a Oracle Application Server master, so I don't know why
> java.class.path is only returning me oc4j.jar. I will talk with DBA and try
> to figure it out.
>
> For now, I just commented all the unless block and forced require
> ojdbc14.jar. I know that is a hack, but until we discover the real problem
> it is good.
>
> Thanks a lot for your help!
>
> Regards,
> Marcelo Murad
>
> On Tue, Oct 20, 2009 at 11:46 AM, Raimonds Simanovskis <
>
> raimonds.simanovs...@gmail.com> wrote:
>
> > Hmm, hard to tell what is the issue - I am not deploying using WAR
> > files by myself.
>
> > Try to debug oracle_enhanced_jdbc_connection.rb to find out in which
> > line exception is raised (maybe comment out rescue LoadError,
> > NameError to find out in which line what exception is raised).
>
> > I found that there is one guide which maybe can help you
>
> >http://wiki.oracle.com/page/JRuby+on+Rails:+Deploying+to+Oracle+Conta...
> ...
>
> read more »

Marcelo Murad

unread,
Oct 21, 2009, 2:47:11 PM10/21/09
to oracle-...@googlegroups.com
Like I said, the error is happening because ENV["PATH"] is returning nil so this ENV["PATH"].split(/[:;]/) is returning error.

Thanks!


--
Marcelo Murad
http://marcelomurad.com
Cel.: (55 21) 8819-5902

Raimonds Simanovskis

unread,
Oct 22, 2009, 12:30:51 PM10/22/09
to Oracle enhanced adapter for ActiveRecord
OK, I will modify to code not to throw exception in ENV["PATH"] is
nil.
Also probably need to add check for ENV["Path"] as I remember that on
Windows machines sometimes you have environment variable Path and not
PATH.

Raimonds


On Oct 21, 9:47 pm, Marcelo Murad <marcelo.mu...@gmail.com> wrote:
> Like I said, the error is happening because ENV["PATH"] is returning nil so
> this ENV["PATH"].split(/[:;]/) is returning error.
>
> Thanks!
>
> --
> *Marcelo Murad *http://marcelomurad.com
> ...
>
> read more »

Raimonds Simanovskis

unread,
Oct 23, 2009, 8:56:54 AM10/23/09
to Oracle enhanced adapter for ActiveRecord
I did the fix and pushed it to github.
You can try to clone github.com/rsim/oracle-enhanced and install it
with "rake install_gem"

Raimonds

On Oct 22, 7:30 pm, Raimonds Simanovskis
> ...
>
> read more »

Telli Abbasian

unread,
Nov 13, 2009, 1:09:56 PM11/13/09
to Oracle enhanced adapter for ActiveRecord
I am getting the same error and not sure what the problem is. The PATH
is defined in the ENV and i still can't connect to the database. Do I
have to install Rails 2.0 and gem rails on the server? My deployment
war file is already bundled with the required libs?
Your help is greatly appreciated.


Install activerecord-jdbc-adapter

On Oct 23, 7:56 am, Raimonds Simanovskis
> ...
>
> read more »- Hide quoted text -
>
> - Show quoted text -

Raimonds Simanovskis

unread,
Nov 14, 2009, 5:44:15 PM11/14/09
to Oracle enhanced adapter for ActiveRecord
I didn't quite understand what error are you getting.

Please show exact stack trace so that it would be possible to see what
the error is.
And please specify which Rails and oracle_enhanced version are you
using.
(And also I am wondering why you mention activerecord-jdbc-adapter)

Raimonds
> ...
>
> read more »

Telli Abbasian

unread,
Nov 16, 2009, 11:53:39 AM11/16/09
to oracle-...@googlegroups.com
Hi Raumonds,
Here is the stack

09/11/06 12:34:29 Oracle Containers for J2EE 10g (10.1.3.4.0)  initialized
09/11/06 12:34:29 NOTIFICATION: oracle.dms.transtrace.enabled=true
09/11/06 12:35:02 Warning: JRuby home "/oracle/OracleAS10g/j2ee/devstd/applications/IRIS/IRIS/WEB-INF/lib/jruby-complete-1.3.1.jar!/META-INF/jruby.home" does not exist, using /tmp
The following jars are 'require'd in config/environment.rb:
/oracle/OracleAS10g/j2ee/devstd/applications/IRIS/IRIS/WEB-INF/lib/classes12dms.jar
/oracle/OracleAS10g/j2ee/devstd/applications/IRIS/IRIS/WEB-INF/lib/ojdbc14.jar
/oracle/OracleAS10g/j2ee/devstd/applications/IRIS/IRIS/WEB-INF/lib/ojdbc6.jar
/oracle/OracleAS10g/j2ee/devstd/applications/IRIS/IRIS/WEB-INF/lib/nls_charset12.jar
/oracle/OracleAS10g/j2ee/devstd/applications/IRIS/IRIS/WEB-INF/lib/jruby-complete-1.3.1.jar
/oracle/OracleAS10g/j2ee/devstd/applications/IRIS/IRIS/WEB-INF/lib/SSOBroker.jar
/oracle/OracleAS10g/j2ee/devstd/applications/IRIS/IRIS/WEB-INF/lib/jruby-core-1.3.1.jar
/oracle/OracleAS10g/j2ee/devstd/applications/IRIS/IRIS/WEB-INF/lib/jruby-stdlib-1.3.1.jar
/oracle/OracleAS10g/j2ee/devstd/applications/IRIS/IRIS/WEB-INF/lib/ojdbc5.jar
/oracle/OracleAS10g/j2ee/devstd/applications/IRIS/IRIS/WEB-INF/lib/classes12.jar
/oracle/OracleAS10g/j2ee/devstd/applications/IRIS/IRIS/WEB-INF/lib/jruby-rack-0.9.5.jar

JRuby limited openssl loaded. gem install jruby-openssl for full support.
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
ERROR: ActiveRecord oracle_enhanced adapter could not load Oracle JDBC driver. Please install ojdbc14.jar library.
ERROR: ActiveRecord oracle_enhanced adapter could not load Oracle JDBC driver. Please install ojdbc14.jar library.
 
The error is coming from
GEM lib (oracle_enhanced_dapter.rb )

This is where the error is coming from:

# Adds JRuby classloader to current thread classloader - as a result ojdbc14.jar should not be in $JRUBY_HOME/lib

java.lang.Thread.currentThread.setContextClassLoader(JRuby.runtime.jruby_class_loader)

ojdbc_jar = "ojdbc14.jar"

if ojdbc_jar_path = ENV["PATH"].split(/[:;]/).find{|d| File.exists?(File.join(d,ojdbc_jar))}

require File.join(ojdbc_jar_path,ojdbc_jar)

end
 
I asked the app server admin to setup the ENV 'PATH'. i no longer receive the active record error, but still can't connect to database, and no errorr in the logs. Not sure what to look for at this time. Your help is greatly appreciated.
I don't have the rails, or jruby installed on the server, but all requrired libs are bundled with the war file. I am able to deploy the same war on the stand aloe oc4j app server in my windows box and lauch the application without any problems.
 
this is the ENV
ORACLE_CONFIG_HOME ==> /oracle/OracleAS10g
XFILESEARCHPATH ==> /usr/dt/app-defaults/%L/Dt
LD_LIBRARY_PATH ==> /oracle/OracleAS10g/jdk/jre/lib/i386/server:/oracle/OracleAS10g/jdk/jre/lib/i386:/oracle/OracleAS10g/jdk/jre/../lib/i386:/oracle/OracleAS10g/opmn/lib:/oracle/OracleAS10g/lib
ORACLE_HOME ==> /oracle/OracleAS10g
NLS_LANG ==> AMERICAN_AMERICA.WE8MSWIN1252
NLSPATH ==> /usr/dt/lib/nls/msg/%L/%N.cat
X_LD_LIBRARY_PATH_64 ==> /oracle/OracleAS10g/lib
SHELL ==> /bin/bash
ORA_NLS33 ==> /oracle/OracleAS10g/ocommon/nls/admin/data
LANG ==> en_US.UTF-8
TMP ==> /tmp
GEM_PATH ==> /oracle/OracleAS10g/j2ee/devstd/applications/IRIS/IRIS/WEB-INF/gems
RAILS_ROOT ==> /oracle/OracleAS10g/j2ee/devstd/applications/IRIS/IRIS/WEB-INF
RAILS_ENV ==> st
PATH ==> /oracle/OracleAS10g/j2ee/devstd/applications/IRIS/IRIS/WEB-INF/lib/

Marcelo Murad

unread,
Nov 16, 2009, 12:10:47 PM11/16/09
to oracle-...@googlegroups.com
After you set PATH variable you don't get the ojdbc14.jar required message anymore right?

What is your jruby and rails versions? Are you using wable to generate war file? What gems did you include in the war?

Regards,


--
Marcelo Murad
http://marcelomurad.com
Cel.: (55 21) 8819-5902

Telli Abbasian

unread,
Nov 16, 2009, 4:20:21 PM11/16/09
to oracle-...@googlegroups.com
After you set PATH variable you don't get the ojdbc14.jar required message anymore right?
Yes, That is correct.
What is your jruby and rails versions? Jruby 1.3.1, rails 2.3.4
Are you using wable to generate war file? YES
 What gems did you include in the war?
Here is the list of GEMS
11/09/2009  03:57 PM    <DIR>          actionmailer-2.3.4
11/09/2009  03:57 PM    <DIR>          actionpack-2.3.4
11/09/2009  03:57 PM    <DIR>          activerecord-2.3.4
11/09/2009  03:58 PM    <DIR>          activerecord-jdbc-adapter-0.9.2
11/09/2009  03:58 PM    <DIR>          activerecord-oracle_enhanced-adapter-1.2.
1
11/09/2009  03:58 PM    <DIR>          activeresource-2.3.4
11/09/2009  03:57 PM    <DIR>          activesupport-2.3.4
11/09/2009  03:58 PM    <DIR>          archive-tar-minitar-0.5.2
11/09/2009  03:58 PM    <DIR>          color-1.4.0
11/09/2009  03:58 PM    <DIR>          haml-2.2.5
11/09/2009  03:58 PM    <DIR>          hoe-2.3.3
11/09/2009  03:58 PM    <DIR>          mislav-will_paginate-2.3.11
11/09/2009  03:58 PM    <DIR>          pdf-writer-1.1.8
11/09/2009  03:57 PM    <DIR>          rack-1.0.0
11/09/2009  03:57 PM    <DIR>          rails-2.3.4
11/09/2009  03:57 PM    <DIR>          rake-0.8.7
11/09/2009  03:58 PM    <DIR>          rubyforge-1.0.4
11/09/2009  03:58 PM    <DIR>          ryanb-acts-as-list-0.1.2
11/09/2009  03:58 PM    <DIR>          saturnflyer-acts_as_tree-1.2.3
11/09/2009  03:58 PM    <DIR>          searchlogic-2.3.5
11/09/2009  03:58 PM    <DIR>          transaction-simple-1.4.0

Raimonds Simanovskis

unread,
Nov 17, 2009, 4:44:02 AM11/17/09
to Oracle enhanced adapter for ActiveRecord
What happens when you try to access database?
What do you have in log file when you call ActiveRecord model methods?

Raimonds
> On Mon, Nov 16, 2009 at 12:10 PM, Marcelo Murad <marcelo.mu...@gmail.com>wrote:
>
>
>
> > After you set PATH variable you don't get the ojdbc14.jar required message
> > anymore right?
>
> > What is your jruby and rails versions? Are you using wable to generate war
> > file? What gems did you include in the war?
>
> > Regards,
>
> > --
>
> > *Marcelo Murad *
> >http://marcelomurad.com
> > Cel.: (55 21) 8819-5902
>
> >> /oracle/OracleAS10g/jdk/jre/lib/i386/server:/oracle/OracleAS10g/jdk/jre/lib /i386:/oracle/OracleAS10g/jdk/jre/../lib/i386:/oracle/OracleAS10g/opmn/lib: /oracle/OracleAS10g/lib
> >> ORACLE_HOME ==> /oracle/OracleAS10g
> >> NLS_LANG ==> AMERICAN_AMERICA.WE8MSWIN1252
> >> NLSPATH ==> /usr/dt/lib/nls/msg/%L/%N.cat
> >> X_LD_LIBRARY_PATH_64 ==> /oracle/OracleAS10g/lib
> >> SHELL ==> /bin/bash
> >> ORA_NLS33 ==> /oracle/OracleAS10g/ocommon/nls/admin/data
> >> LANG ==> en_US.UTF-8
> >> TMP ==> /tmp
> >> GEM_PATH ==>
> >> /oracle/OracleAS10g/j2ee/devstd/applications/IRIS/IRIS/WEB-INF/gems
> >> RAILS_ROOT ==>
> >> /oracle/OracleAS10g/j2ee/devstd/applications/IRIS/IRIS/WEB-INF
> >> RAILS_ENV ==> st
> >> *PATH ==>
> >> /oracle/OracleAS10g/j2ee/devstd/applications/IRIS/IRIS/WEB-INF/lib/*
>
> >>   On Sat, Nov 14, 2009 at 5:44 PM, Raimonds Simanovskis <
> ...
>
> read more »

Telli Abbasian

unread,
Nov 17, 2009, 9:08:20 AM11/17/09
to oracle-...@googlegroups.com
Nothing happens, no errors in the log

> ...
>
> read more »

--

You received this message because you are subscribed to the Google Groups "Oracle enhanced adapter for ActiveRecord" group.
To post to this group, send email to oracle-...@googlegroups.com.
To unsubscribe from this group, send email to oracle-enhanc...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/oracle-enhanced?hl=.



Raimonds Simanovskis

unread,
Nov 17, 2009, 11:36:21 AM11/17/09
to Oracle enhanced adapter for ActiveRecord
What means "nothing happens"?
What are you expecting to happen?

Are you calling some ActiveRecord method and you get wrong result? Or
what?
Please be more specific :)

Raimonds
> ...
>
> read more »

Telli Abbasian

unread,
Nov 17, 2009, 11:46:55 AM11/17/09
to oracle-...@googlegroups.com
I don't get connected to the database. The first thing i do, is to load the driver and get DB connection. I don't see any errors in the log, yet I am not connected in the database. i get a generic error messgae "Your application has errors"
Thanks,
Telli

> ...
>
> read more »

Marcelo Murad

unread,
Nov 17, 2009, 1:35:23 PM11/17/09
to oracle-...@googlegroups.com
Telli,

I could not get the latest version of jruby and rails to work with my oas (10.1.3). There is something about jruby and rack with oc4j that does not get along very well. I use jruby 1.3.0 and rails 2.2.2.

If you are not seeing any error messages in the application log file, try to look at opmn log.

Marcelo Murad

--~--~---------~--~----~------------~-------~--~----~

You received this message because you are subscribed to the Google Groups "Oracle enhanced adapter for ActiveRecord" group.
To post to this group, send email to oracle-...@googlegroups.com
To unsubscribe from this group, send email to oracle-enhanc...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/oracle-enhanced?hl=en
-~----------~----~----~----~------~----~------~--~---


Telli Abbasian

unread,
Nov 17, 2009, 1:58:41 PM11/17/09
to oracle-...@googlegroups.com
Did you install jruby and rails on your oas server? So are you saying, your issue was fixed by using jruby 1.3.0 and rails 2.2.2?
I can successfully deploy the war and launch the application on My development stand alone 10.1.3 oas, but not on the production server

Thanks,
Telli

--

You received this message because you are subscribed to the Google Groups "Oracle enhanced adapter for ActiveRecord" group.
To post to this group, send email to oracle-...@googlegroups.com.
To unsubscribe from this group, send email to oracle-enhanc...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/oracle-enhanced?hl=.

Marcelo Murad

unread,
Nov 17, 2009, 2:28:40 PM11/17/09
to oracle-...@googlegroups.com
Jruby and rails gems are just inside war file.

With the edge versions of rails and jruby I was getting a different error, I'm not quite sure what it was, but I think I was getting FAIL SAFE! on the opmn log.

Did you look at the opmn log for errors?

Marcelo Murad

Telli Abbasian

unread,
Nov 17, 2009, 2:31:40 PM11/17/09
to oracle-...@googlegroups.com
The log that i sent you was from the opmn logs.

Marcelo Murad

unread,
Nov 17, 2009, 3:02:45 PM11/17/09
to oracle-...@googlegroups.com
Are you able to create a new rails app and run it on production server? Have you tried to access the database with jdbc only?

Can you send your warble.rb and web.xml.erb files?

I'm getting without options here. The last thing I would do after the above is to downgrade rails and jruby versions and try again.



--
Marcelo Murad
http://marcelomurad.com
Cel.: (55 21) 8819-5902


Reply all
Reply to author
Forward
0 new messages