This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
There are two strange bugs with JRuby on Rails in Netbeans. 1. when I want to start testing with Run-> Test Project I get an error message: "Error opening script file: C:/Documents and Settings/xxx/My Documents/NetBeansProjects/RailsApplication3/Files/NetBeans (The system cannot find the path specified)" 2. when I try to run the test with test file or run file, it can't find the mysql driver. However, this error not always happens. It seems that when I create the project and use Glassfish and then switch to Webrick it happens, but if I use Webrick from the beginning it doesn't. Just to make it clear, Webrick works, starting up and working with the site is no problem, only testing doesn't work. RuntimeError: The driver encountered an error: cannot load Java class com.mysql.jdbc.Driver C:/Program Files/NetBeans 6.5 Beta/ruby2/jruby-1.1.3/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.8.2/lib/active_record/connection_adapters/jdbc_adapter.rb:313:in `initialize' C:/Program Files/NetBeans 6.5 Beta/ruby2/jruby-1.1.3/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.8.2/lib/active_record/connection_adapters/jdbc_adapter.rb:46:in `new' C:/Program Files/NetBeans 6.5 Beta/ruby2/jruby-1.1.3/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.8.2/lib/active_record/connection_adapters/jdbc_adapter.rb:46:in `jdbc_connection' C:/Program Files/NetBeans 6.5 Beta/ruby2/jruby-1.1.3/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:292:in `connection=' C:/Program Files/NetBeans 6.5 Beta/ruby2/jruby-1.1.3/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:260:in `retrieve_connection' C:/Program Files/NetBeans 6.5 Beta/ruby2/jruby-1.1.3/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in `connection' C:/Program Files/NetBeans 6.5 Beta/ruby2/jruby-1.1.3/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/fixtures.rb:503:in `create_fixtures' C:/Program Files/NetBeans 6.5 Beta/ruby2/jruby-1.1.3/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/fixtures.rb:963:in `load_fixtures' C:/Program Files/NetBeans 6.5 Beta/ruby2/jruby-1.1.3/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/fixtures.rb:929:in `setup_fixtures' C:/Program Files/NetBeans 6.5 Beta/ruby2/jruby-1.1.3/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:173:in `evaluate_method' C:/Program Files/NetBeans 6.5 Beta/ruby2/jruby-1.1.3/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:161:in `call' C:/Program Files/NetBeans 6.5 Beta/ruby2/jruby-1.1.3/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:90:in `run' C:/Program Files/NetBeans 6.5 Beta/ruby2/jruby-1.1.3/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:90:in `each' C:/Program Files/NetBeans 6.5 Beta/ruby2/jruby-1.1.3/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:90:in `run' C:/Program Files/NetBeans 6.5 Beta/ruby2/jruby-1.1.3/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:272:in `run_callbacks' C:/Program Files/NetBeans 6.5 Beta/ruby2/jruby-1.1.3/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/testing/setup_and_teardown.rb:31:in `run_with_callbacks' C:/Program Files/NetBeans 6.5 Beta/ruby2/jruby-1.1.3/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run' C:/Program Files/NetBeans 6.5 Beta/ruby2/jruby-1.1.3/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each' C:/Program Files/NetBeans 6.5 Beta/ruby2/jruby-1.1.3/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run' C:/Program Files/NetBeans 6.5 Beta/ruby2/jruby-1.1.3/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in `run_suite'
The first problem you're encountering seems like issue 143941, which is fixed in dev builds (if you'd like to try it, please see http://wiki.netbeans.org/RubyInstallation#section-RubyInstallation-HowDoIGetTheContinuousBuilds for instructions). I'll have a look at the other issue.
Seems that javac.classpath specifed in project.properties does not get passed to GF. When you choose to use JDBC, the Rails project wizard automatically creates an entry to project.properties for the target driver jar file, e.g.: javac.classpath=${file.reference.mysql-connector-java-5.1.6-bin.jar} In RailsServerManager, it looks like the classPath variable is not used when starting GF (in the glassfishEnsureRunning method). Peter, could you check this please?
Yes, I know about this. One workaround is to (manually) copy the JDBC driver into the JRuby lib folder (of the JRuby distribution selected for the project, such as the one that comes with NetBeans) I've been mulling & poking around for the GlassFish specific solution for a while now. [glassfish_root]/lib didn't work when I checked it out (might have been a GF bug). I've just discovered this past weekend that [glassfish_domain]/lib may work, and if true, we can wrap this up.
Driver jar is not required when adapter is set to "jdbc[dbtype]' in database.yml -- and in fact, gets in the way for GlassFish, I don't know why yet. Driver jar is being added because NetBeans is still generating the old "adapter:jdbc" format (isn't that a bug? It doesn't seem to work, even for MySQL, why are we still using it? Has anyone ever made it work?) If you update database.yml to use the first format, i.e. adapter: jdbcpostgresql # or correct for your db encoding: utf8 database: [database name] username: [username] password: [password] host: localhost port: 5432 # or correct for your db install the correct gem for above (activerecord-jdbcpostgresql-adapter for the above) and make sure that the JDBC driver jar *IS NOT* in the library list on the Project Properties > Java page, then things appear to work -- this works because the driver jar is included with the aforementioned gem. It will work *WITH* the specified if you run in DEBUG mode or run against the V3 GEM. I'm still investigating why the presence of the jar seems to screw things up in RUN mode. I thought we ignored it.
> Driver jar is being added because NetBeans is still generating the old "adapter:jdbc" format (isn't that a bug? There is issue 138316 for bundling jdbc<dbms> adapters with the IDE. We need to find out how to make them use the MySQL and PostgreSQL drivers already bundled with the IDE so that the distribution wouldn't have two copies of the drivers. I'll speak to Nick Sieger about that, but likely the issue needs to be addressed post 6.5. > It > doesn't seem to work, even for MySQL, why are we still using it? Has anyone ever made it work?) I haven't experienced any problems with the generic 'jdbc' adapter; works fine for me both with MySQL 5.0 and PostgreSQL 8.3.3, for example with the following IDE generated configuration: development: host: localhost adapter: jdbc driver: org.postgresql.Driver url: jdbc:postgresql://localhost:5432/<db_name> username: ... password: ... (With WEBrick/Mongrel). I've tried MySQL on Win/Linux and PostgreSQL on Linux.
It doesn't work on Solaris 10/PostgreSQL (my box). I asked Vivek to test against MySQL (I think this was on Ubuntu) and he was having the same problems (jar loading issues). Can you tell me the OS, DB, JDK, AppServer, and NetBeans versions that you used in which it does work and attach the project you used? Clearly I'm doing something different (possibly totally wrong). I've never had this working.
Created attachment 69252 [details] sample project
Attached is a project created with: Product Version: NetBeans IDE Dev (Build 080905) Java: 1.5.0_15; Java HotSpot(TM) 64-Bit Server VM 1.5.0_15-b04 System: Linux version 2.6.24-19-generic running on amd64; UTF-8; en_US (nb) it uses WEBrick,the built-in JRuby 1.1.4 and Rails 2.1.0. OS is Ubuntu 8.04 (64bit) and DB PostgreSQL 8.3.3.
This issue ended up a casualty of my unexpected absence in mid September. I'll consider it for a patch release I guess. I don't see it being resolved for release, way too late.
Assigned engineer: please correct the tm value. nb 6.7 has shipped, so a tm of 6.7 is invalid at this point
assign outher half of pcw's issues
scripting support (JRuby and Rails) is not a high priority for the GF team at this point. Lowering to p4.
We do not support JRuby on Rails in current GlassFish plugin releases. Closing this bug.