I just copy-pasted the example from HOWTO-scripting.txt for jruby in
my application (i used messageRecorder), in red5 0.9.1 on windows
vista, with java 1.6.
My red5-web.xml has:
<bean id="web.handler"
class="org.springframework.scripting.jruby.JRubyScriptFactory">
<constructor-arg index="0" value="classpath:applications/main.rb"/>
<constructor-arg index="1">
<list>
<value>org.red5.server.api.IScopeHandler</value>
<value>org.red5.server.adapter.IApplication</value>
</list>
</constructor-arg>
</bean>
And i copied the ruby script in main.rb.
When i start red5, i get this error:
[INFO] [Launcher:/]
org.springframework.beans.factory.support.DefaultListableBeanFactory -
Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@4d2ef4c6:
defining beans [placeholderConfig,web.context,web.scope]; parent:
org.springframework.beans.factory.support.DefaultListableBeanFactory@29a220e6
Exception in thread "Launcher:/messageRecorder"
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'web.scope' defined in ServletContext resource
[/WEB-INF/red5-web.xml]: Initialization of bean failed; nested
exception is org.springframework.beans.ConversionNotSupportedException:
Failed to convert property value of type
'org.springframework.scripting.jruby.JRubyScriptFactory' to required
type 'org.red5.server.api.IScopeHandler' for property 'handler';
nested exception is java.lang.IllegalStateException: Cannot convert
value of type [org.springframework.scripting.jruby.JRubyScriptFactory]
to required type [org.red5.server.api.IScopeHandler] for property
'handler': no matching editors or conversion strategy found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java
:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:4
50)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557
)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:84
2)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
at org.red5.server.tomcat.TomcatLoader$1.run(TomcatLoader.java:594)
Caused by: org.springframework.beans.ConversionNotSupportedException:
Failed to convert property value of type 'org.springframework.scriptin
g.jruby.JRubyScriptFactory' to required type
'org.red5.server.api.IScopeHandler' for property 'handler'; nested
exception is java.lang.Illeg
alStateException: Cannot convert value of type
[org.springframework.scripting.jruby.JRubyScriptFactory] to required
type [org.red5.server.ap
i.IScopeHandler] for property 'handler': no matching editors or
conversion strategy found
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:462)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactor
y.java:1351)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFacto
ry.java:1310)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java
:1067)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java
:511)
... 9 more
Caused by: java.lang.IllegalStateException: Cannot convert value of
type [org.springframework.scripting.jruby.JRubyScriptFactory] to
require
d type [org.red5.server.api.IScopeHandler] for property 'handler': no
matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:289)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:154)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:452)
... 13 more
I searched and found that someone in 2007 had the same issue. No
solution was given. Does anyone have one now?
Cheers,
Tom