|
From: Juergen H. <ju...@in...> - 2005-05-23 13:55:46
|
Actually, according to the CVS history of spring-beans.dtd, this has already been relaxed for Spring 1.1.4. Do you maybe have an old spring-beans.dtd around in your class path or IDE? The spring-beans.dtd as shipped in spring.jar should allow for arbitrary order of the sub elements there... You could also check the spring-beand.dtd file in the dist directory of your Spring distribution. Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Tim Kettering Sent: Monday, May 23, 2005 3:47 PM To: spr...@li... Subject: RE: [Springframework-developer] order of lookup-method in bean declaration important? Well, apparently it isn't working for me under spring 1.2 (RC2). We haven't updated our project to 1.2 final yet. I will give that a try today, but here is the exception stack trace I'm getting (see below). ----- Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Line 72 in XML document from resource [/WEB-INF/TopicPortlet-portlet.xml] of PortletContext is invalid; nested exception is org.xml.sax.SAXParseException: Element "bean" does not allow "property" here. at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefini tions(XmlBeanDefinitionReader.java:152) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadB eanDefinitions(AbstractBeanDefinitionReader.java:99) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDe finitions(AbstractXmlApplicationContext.java:102) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDe finitions(AbstractXmlApplicationContext.java:70) at org.springframework.context.support.AbstractRefreshableApplicationContext.re freshBeanFactory(AbstractRefreshableApplicationContext.java:87) at org.springframework.context.support.AbstractApplicationContext.refresh(Abstr actApplicationContext.java:262) at org.springframework.web.portlet.context.support.XmlPortletApplicationContext .refresh(XmlPortletApplicationContext.java:132) at org.springframework.web.portlet.FrameworkPortlet.createPortletApplicationCon text(FrameworkPortlet.java:315) at org.springframework.web.portlet.FrameworkPortlet.initPortletApplicationConte xt(FrameworkPortlet.java:260) at org.springframework.web.portlet.FrameworkPortlet.initPortletBean(FrameworkPo rtlet.java:230) at org.springframework.web.portlet.PortletBean.init(PortletBean.java:95) at javax.portlet.GenericPortlet.init(GenericPortlet.java:98) at org.apache.pluto.core.PortletServlet.init(PortletServlet.java:93) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10 91) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:750) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher. java:641) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch er.java:574) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher .java:499) at org.apache.pluto.invoker.impl.PortletInvokerImpl.invoke(PortletInvokerImpl.j ava:120) ... 89 more Caused by: org.xml.sax.SAXParseException: Element "bean" does not allow "property" here. at org.apache.crimson.parser.Parser2.error(Parser2.java:3354) at org.apache.crimson.parser.ValidatingParser$ChildrenValidator.consume(Validat ingParser.java:349) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1497) at org.apache.crimson.parser.Parser2.content(Parser2.java:1963) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691) at org.apache.crimson.parser.Parser2.content(Parser2.java:1963) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691) at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:667) at org.apache.crimson.parser.Parser2.parse(Parser2.java:337) at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448) at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:1 85) at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:76) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefini tions(XmlBeanDefinitionReader.java:145) ... 107 more -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf Of Juergen Hoeller Sent: Monday, May 23, 2005 9:30 AM To: spr...@li... Subject: Re: [Springframework-developer] order of lookup-method in bean declaration important? Ah yes, that has changed as of Spring 1.2. But that at least means that upgrading to Spring 1.2 should help :-) Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Christopher Harris Sent: Monday, May 23, 2005 2:39 PM To: spr...@li... Subject: Re: [Springframework-developer] order of lookup-method in bean declaration important? Juergen, I get the same problem when using spring 1.1.2. It is caused by the definition of the bean element within the spring-bean.dtd within the spring-core.jar: <!ELEMENT bean ( description?, (constructor-arg | property)*, (lookup-method | replaced-method)* )> Looks as if the spring-bean.dtd has been changed within the 1.2. Hope that helps. Chris. From: "Juergen Hoeller" <ju...@in...> Reply-To: spr...@li... To: <spr...@li...> Subject: Re: [Springframework-developer] order of lookup-method in bean declaration important? Date: Mon, 23 May 2005 11:59:04 +0200 Tim, The order of <bean> sub elements should not matter, with the sole exception of <description> which needs to be first. What kind of error do you get when you place your <lookup-method> tag before your <property> tag? Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Tim Kettering Sent: Thursday, May 19, 2005 11:21 PM To: spr...@li... Subject: [Springframework-developer] order of lookup-method in bean declaration important? Hi, I was looking into integrating lookup-method in my context, and I was using the reference found here: http://static.springframework.org/spring/docs/1.2/reference/beans.html#beans -factory-method-injection After much tussling around with some weird XML error, and looking at some other examples pasted in the forums, I moved the <lookup-method> tag to appear after the <property> tags, and it all worked after that. So I think the example in the reference is misleading, since it places the <lookup-method> tag before the <property> tag, which apparently does not work for me (in Spring 1.2). So, does the order matter? If so, the reference example should be updated and the text to clearly state in what order it should appear in the <bean> declaration. Thanks. -tim ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |