Announcement Announcement Module
Collapse
No announcement yet.
PropertyAccessExceptionsException and ref local Class Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • PropertyAccessExceptionsException and ref local Class

    I'm hoping someone can shed some light on this for me. Why does the following throw a PropertyAccessExceptionsException:
    Code:
    <bean id="myJob" class="com.blahblah.myJob"></bean>
    
    <bean id="myJobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">
    	<property name="jobClass">
    		<ref local="myJob"/>
    	</property>
    </bean>
    and this doesn't (it works fine):
    Code:
    <bean id="myJob" class="com.blahblah.myJob"></bean>
    
    <bean id="myJobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">
    	<property name="jobClass">
    		<value>com.blahblah.myJob</value>
    	</property>
    </bean>
    Is there a way to reference the myJob bean class? Here's the exception thrown from the former configuration:
    Code:
    Error setting property values; nested exception is org.springframework.beans.PropertyAccessExceptionsException:
    PropertyAccessExceptionsException (1 errors);
    nested propertyAccessExceptions are:
    [org.springframework.beans.TypeMismatchException:
    Failed to convert property value of type [com.blahblah.myJob] to
    required type [java.lang.Class] for property 'jobClass']
    What can I do to set the jobClass property to myJob's class? Is it even possible? Muchas gracias in advance!

  • #2
    So, a little more research and I find that there is just no easy way to do this. Sorry Quartz, you failed the ease of implementation test. Back to timer.

    Comment


    • #3
      You could use MethodInvokingFactoryBean to invoke the (inherited) getClass() method of the "myJob" bean. Have a look at the API documentation of MethodInvokingFactoryBean for details.

      Regards,
      Andreas

      Comment

      Working...
      X