Sequel & Postgres Works when run, Fails when debug

View: New views
5 Messages — Rating Filter:   Alert me  

Sequel & Postgres Works when run, Fails when debug

by Paul F Fraser :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have 2 jar files listed in the project properties jruby classpath
configuration

postgresql-8.3-603.jdbc3.jar
Scenario-0.6.jar

Normal run of the code works OK, but  it fails in debug ---
C:/Users/paulf/Documents/Netbeans/netbeans-hudson-trunk-3690-ruby/netbeans/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/sequel-2.5.0/lib/sequel_core/adapters/jdbc/postgresql.rb:49:in
`method_missing': cannot load Java class org.postgresql.Driver (NameError)

If I remove the Scenario-0.6.jar from the jruby classpath it works for
run and debug mode. For some reason, adding the second reference stuffs
up the debugger. I have tried a few other jar files but in each case
when there are 2 references  the debugger fails, but the code will run
normally.

CODE====
require 'rubygems'
require 'sequel'

connect_string = "jdbc:postgresql://localhost/mydb?user=*&password=*"
  DB = Sequel.connect(connect_string)

  if DB.test_connection then
    puts "connection test passed"
  else
    puts  "#{connect_string} Connection Failed"
  end

puts "Finished"
==============

Regards
Paul Fraser

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: Sequel & Postgres Works when run, Fails when debug

by Martin Krauskopf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Paul Fraser wrote:

> I have 2 jar files listed in the project properties jruby classpath
> configuration
>
> postgresql-8.3-603.jdbc3.jar
> Scenario-0.6.jar
>
> Normal run of the code works OK, but  it fails in debug ---
> C:/Users/paulf/Documents/Netbeans/netbeans-hudson-trunk-3690-ruby/netbeans/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/sequel-2.5.0/lib/sequel_core/adapters/jdbc/postgresql.rb:49:in
> `method_missing': cannot load Java class org.postgresql.Driver (NameError)
>
> If I remove the Scenario-0.6.jar from the jruby classpath it works for
> run and debug mode. For some reason, adding the second reference stuffs
> up the debugger. I have tried a few other jar files but in each case
> when there are 2 references  the debugger fails, but the code will run
> normally.
>
> CODE====
> require 'rubygems'
> require 'sequel'
>
> connect_string = "jdbc:postgresql://localhost/mydb?user=*&password=*"
>  DB = Sequel.connect(connect_string)
>
>  if DB.test_connection then
>    puts "connection test passed"
>  else
>    puts  "#{connect_string} Connection Failed"
>  end
>
> puts "Finished"
> ==============

Hi Paul,

could you file a bug, against ruby/debugger and attach there logs as
described here:

   http://wiki.netbeans.org/FaqRubyNBLogging

Might be if you can take a look into the log with the logging turned on
whether it gives you some clue. In the logs are lines with a command
which NetBeans triggers.

Thanks,
        m.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: Sequel & Postgres Works when run, Fails when debug

by Paul F Fraser :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Martin Krauskopf wrote:

> Paul Fraser wrote:
>> I have 2 jar files listed in the project properties jruby classpath
>> configuration
>>
>> postgresql-8.3-603.jdbc3.jar
>> Scenario-0.6.jar
>>
>> Normal run of the code works OK, but  it fails in debug ---
>> C:/Users/paulf/Documents/Netbeans/netbeans-hudson-trunk-3690-ruby/netbeans/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/sequel-2.5.0/lib/sequel_core/adapters/jdbc/postgresql.rb:49:in
>> `method_missing': cannot load Java class org.postgresql.Driver
>> (NameError)
>>
>> If I remove the Scenario-0.6.jar from the jruby classpath it works
>> for run and debug mode. For some reason, adding the second reference
>> stuffs up the debugger. I have tried a few other jar files but in
>> each case when there are 2 references  the debugger fails, but the
>> code will run normally.
>>
>> CODE====
>> require 'rubygems'
>> require 'sequel'
>>
>> connect_string = "jdbc:postgresql://localhost/mydb?user=*&password=*"
>>  DB = Sequel.connect(connect_string)
>>
>>  if DB.test_connection then
>>    puts "connection test passed"
>>  else
>>    puts  "#{connect_string} Connection Failed"
>>  end
>>
>> puts "Finished"
>> ==============
>
> Hi Paul,
>
> could you file a bug, against ruby/debugger and attach there logs as
> described here:
Hi Martin,

http://www.netbeans.org/issues/show_bug.cgi?id=146515

The debugger works OK if the jars are placed in the jruby installation
lib dir.
Seems that the debuggger is not treating the classpath the same as the
runtime.
I would have added this as a comment to the bug report, but how do you
add a comment?????

Paul Fraser

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: Sequel & Postgres Works when run, Fails when debug

by Martin Krauskopf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Paul Fraser wrote:
[...]

>> Hi Paul,
>>
>> could you file a bug, against ruby/debugger and attach there logs as
>> described here:
> Hi Martin,
>
> http://www.netbeans.org/issues/show_bug.cgi?id=146515
>
> The debugger works OK if the jars are placed in the jruby installation
> lib dir.
> Seems that the debuggger is not treating the classpath the same as the
> runtime.

Thanks for investigation. This perception helps a lot. I'll get to it today.

> I would have added this as a comment to the bug report, but how do you
> add a comment?????

When you are logged in and go to the issue, there is "Additional
comments:" textarea. Just type your comment there and hit the Submit
button. I see you've already commented, even to that issue, so you must
know it ;)

Thanks,
        m.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: Sequel & Postgres Works when run, Fails when debug

by Paul F Fraser :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Martin Krauskopf wrote:
>> I would have added this as a comment to the bug report, but how do
>> you add a comment?????
>
> When you are logged in and go to the issue, there is "Additional
> comments:" textarea. Just type your comment there and hit the Submit
> button. I see you've already commented, even to that issue, so you
> must know it ;)
>
Duh...helps if you log in :-P

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...