0

ZK Spring Annotation latest - Not coming up any more ;(

asked 2009-04-28 21:15:44 +0800

christian gravatar image christian
136 2 4

Hi,

i just upgraded to ZK 3.6.1 and ZK-Spring svn 11473. Now my app isn't coming up any more:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'application': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.zkoss.spring.bean.ZkComponentFactoryBean]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.zkoss.spring.bean.ZkComponentFactoryBean.<init>()
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getNonSingletonFactoryBeanForTypeCheck(AbstractAutowireCapableBeanFactory.java:718)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:614)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:450)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:223)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:202)
	at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:143)
	at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findDefaultEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:503)
	at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:473)
	at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.resolveEntityManager(PersistenceAnnotationBeanPostProcessor.java:599)
	at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.getResourceToInject(PersistenceAnnotationBeanPostProcessor.java:570)
	at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:192)
	at org.springframework.beans.factory.annotation.InjectionMetadata.injectMethods(InjectionMetadata.java:117)
	at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:321)
	... 31 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.zkoss.spring.bean.ZkComponentFactoryBean]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.zkoss.spring.bean.ZkComponentFactoryBean.<init>()
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:58)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
	... 45 more
Caused by: java.lang.NoSuchMethodException: org.zkoss.spring.bean.ZkComponentFactoryBean.<init>()
	at java.lang.Class.getConstructor0(Class.java:2678)
	at java.lang.Class.getDeclaredConstructor(Class.java:1953)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:54)
	... 46 more

it seems the default constructor for org.zkoss.spring.bean.ZkComponentFactoryBean is now

	
	public ZkComponentFactoryBean(boolean applied) {
		_applied = applied;
	}
	

but it seems the config beans are not aware of the new constructor or missed i something?

Thanks,
chris

delete flag offensive retag edit

6 Replies

Sort by ยป oldest newest

answered 2009-04-29 01:39:29 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

updated 2009-04-29 01:41:32 +0800

Chris,

It is a version in developing. I will handle that part later. BTW, do you use XML configuration or Java annotation that cause this issue.

link publish delete flag offensive edit

answered 2009-04-29 08:10:01 +0800

christian gravatar image christian
136 2 4

Henri,

i'm using spring annotation.

this is my current spring config (no security yet):

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:sec="http://www.springframework.org/schema/security"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:zksp="http://www.zkoss.org/2008/zkspring"
       xmlns:zksp-annot="http://www.zkoss.org/2008/zkspring-annot"
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xsi:schemaLocation="
		   http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
	       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
	       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
		   http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.1.xsd
	       http://www.zkoss.org/2008/zkspring http://www.zkoss.org/2008/zkspring/zkspring.xsd
	       http://www.zkoss.org/2008/zkspring-annot http://www.zkoss.org/2008/zkspring-annot/zkspring-annot.xsd
	   ">
	
	<!-- Generic -->
    <context:annotation-config />
    <context:component-scan base-package="" />
    <aop:aspectj-autoproxy/>
    
	<!--
	ZK Spring config 
	 -->    
	<zksp-annot:component-scan base-package="org.zkoss.spring.jpa,org.lugcamp,test"/>
	<zksp:zk-config/>
	
	<!-- 
    Injected properties
    --> 
    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
	    <property name="locations">
	    <list>
            
            <value>classpath:/config/datasource.properties</value>
	    </list>
	    </property>
        
    </bean>
</beans>

i try to do everything by annotations ;)

bye,
chris

link publish delete flag offensive edit

answered 2009-05-05 00:57:04 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

chris,

Update from the svn.

link publish delete flag offensive edit

answered 2009-05-05 12:04:13 +0800

christian gravatar image christian
136 2 4

hi henri,

what should i update? zk-Spring is 10 days old, and this info is based on this revision...

bye,
chris

link publish delete flag offensive edit

answered 2009-05-06 00:56:47 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

I thought I have checked in :-). Please try again.

link publish delete flag offensive edit

answered 2009-05-06 14:45:34 +0800

christian gravatar image christian
136 2 4

hi henri,

am i connected to the wrong svn?

addon/           11473 	 8 days 	 henrichen 	 bug: 2781558 SpringAnnotations - @EventHandler dosn't honor @Scope("idspace") ...
branches/ 	 11493 	 37 hours 	 tomyeh 	 accurate zPkg.load
releases/ 	 11498 	 36 hours 	 jumperchen 	 3.6.1
svntest/ 	 9583 	 7 months 	 daviechen 	 
trunk/ 	         11496 	 36 hours 	 jumperchen 	 3.6.1

bye,
chris

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-04-28 21:15:44 +0800

Seen: 747 times

Last updated: May 06 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More