jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JRuby
  • JRUBY-4737

Compatibility issue with Spring property from 1.4.0 to 1.5.0.RC1

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.5
  • Fix Version/s: JRuby 1.5
  • Component/s: None
  • Labels:
    None
  • Environment:
    (Java HotSpot(TM) 64-Bit Server VM 1.6.0_17) [x86_64-java]

Description

i have a spring application that wires a ruby object as a spring bean and i use property injection on that:

<lang:jruby id="identifier" script-interfaces="de.nofail.Identifier" script-source="classpath:/ruby/identifier.rb">
	<!-- http://static.springsource.org/spring/docs/3.0.2.RELEASE/spring-framework-reference/html/expressions.html -->
    <lang:property name="uuid" value="#{ T(java.util.UUID).randomUUID().toString() }" />
</lang:jruby>

updating to the latest version rises an exception on this configuration:

PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'uuid' threw exception; nested exception is org.springframework.scripting.jruby.JRubyScriptUtils$JRubyExecutionException: cannot convert instance of String to void; nested exception is org.jruby.exceptions.RaiseException: cannot convert instance of String to void

example code is on github: http://github.com/phoet/ruby-java-jruby-rjb/

btw 1.5.0.RC1 is missing in the jira versions...

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    stack_trace.txt
    23/Apr/10 2:22 AM
    10 kB
    Peter Schröder

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Charles Oliver Nutter added a comment - 22/Apr/10 4:54 PM

Can you provide a full stack trace or show us how to reproduce this on our end? I think I may know where the problem is, but I need a bit better description of how to reproduce it.

Show
Charles Oliver Nutter added a comment - 22/Apr/10 4:54 PM Can you provide a full stack trace or show us how to reproduce this on our end? I think I may know where the problem is, but I need a bit better description of how to reproduce it.
Hide
Permalink
Peter Schröder added a comment - 23/Apr/10 2:22 AM

here ist the stacktrace

Show
Peter Schröder added a comment - 23/Apr/10 2:22 AM here ist the stacktrace
Hide
Permalink
Charles Oliver Nutter added a comment - 23/Apr/10 12:12 PM

The stacktrace unfortunately appears to hide what's actually causing the error, so I'm still lost in the woods. I will try to pull your repo and run it.

Show
Charles Oliver Nutter added a comment - 23/Apr/10 12:12 PM The stacktrace unfortunately appears to hide what's actually causing the error, so I'm still lost in the woods. I will try to pull your repo and run it.
Hide
Permalink
Charles Oliver Nutter added a comment - 23/Apr/10 1:36 PM

I think I have found the problem. I managed to fetch and run your project (yay for buildr) and have figured out that under JRuby 1.4, we allowed objects to coerce to "void" by just returning null. I've re-added that functionality now and your tests pass. Still needs tests, but this will be in RC2.

Show
Charles Oliver Nutter added a comment - 23/Apr/10 1:36 PM I think I have found the problem. I managed to fetch and run your project (yay for buildr) and have figured out that under JRuby 1.4, we allowed objects to coerce to "void" by just returning null. I've re-added that functionality now and your tests pass. Still needs tests, but this will be in RC2.
Hide
Permalink
Charles Oliver Nutter added a comment - 23/Apr/10 2:48 PM

This was actually a good find. It turned out that 1.4 allowed types to coerce to "void" by just returning null, and stricter coercion logic in 1.5 prevented that in a number of cases, including for String. I made improvements to unify a bit more of the "toJava" logic across all types that override it, so that it now produces "null" for an incoming "void" type.

The changes and specs for this have been pushed to master in 1b919d4 and to jruby-1_5 in 5d4be98.

Show
Charles Oliver Nutter added a comment - 23/Apr/10 2:48 PM This was actually a good find. It turned out that 1.4 allowed types to coerce to "void" by just returning null, and stricter coercion logic in 1.5 prevented that in a number of cases, including for String. I made improvements to unify a bit more of the "toJava" logic across all types that override it, so that it now produces "null" for an incoming "void" type. The changes and specs for this have been pushed to master in 1b919d4 and to jruby-1_5 in 5d4be98.
Hide
Permalink
Peter Schröder added a comment - 23/Apr/10 3:38 PM

yay for buildr AND github!

Show
Peter Schröder added a comment - 23/Apr/10 3:38 PM yay for buildr AND github!

People

  • Assignee:
    Charles Oliver Nutter
    Reporter:
    Peter Schröder
Vote (0)
Watch (0)

Dates

  • Created:
    20/Apr/10 3:41 AM
    Updated:
    09/Feb/11 12:21 PM
    Resolved:
    23/Apr/10 2:48 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.