From: Andrew T. <and...@ds...> - 2004-06-06 21:10:37
|
Obviously this will be a dumb question, but I can't get the message.properties file to be read, which causes the application NOT to load - error about label required. Now, I have my messages.properties file in the src directory My application-context.xml has: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="application" class="org.springframework.rcp.application.Application"> <constructor-arg index="0"> <ref bean="applicationInfo"/> </constructor-arg> </bean> <bean id="applicationInfo" class="org.springframework.rcp.application.ApplicationInfo"> <property name="version"><value>1.0</value></property> <property name="buildId"><value>20040530001</value></property> </bean> <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basenames"> <list> <value>messages</value> </list> </property> </bean> </beans> My messages.properties file has: applicationInfo.title=Test Application applicationInfo.caption=Test Application Caption, Spring RCP applicationInfo.description=Test Spring RCP And what happens is that the two properties in the application exist fine, but the properties from messages.properties does not - obviously a problem with the messageSource section of the application-context, but what? My directory structure is: /src /src/messages.properties /src/org/at/Start.java /resources/application-context.xml Andrew |
From: Keith D. <kd...@cs...> - 2004-06-06 21:33:10
|
Andrew, Can you post your stack trace? The definitive evidence that always proves most helpful! Thanks, Keith _____ From: spr...@li... [mailto:spr...@li...] On Behalf Of Andrew Todd Sent: Sunday, June 06, 2004 5:10 PM To: Spring Framework Rich Client Platform Subject: [Springframework-rcp-dev] Dumb Question Obviously this will be a dumb question, but I can't get the message.properties file to be read, which causes the application NOT to load - error about label required. Now, I have my messages.properties file in the src directory My application-context.xml has: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="application" class="org.springframework.rcp.application.Application"> <constructor-arg index="0"> <ref bean="applicationInfo"/> </constructor-arg> </bean> <bean id="applicationInfo" class="org.springframework.rcp.application.ApplicationInfo"> <property name="version"><value>1.0</value></property> <property name="buildId"><value>20040530001</value></property> </bean> <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basenames"> <list> <value>messages</value> </list> </property> </bean> </beans> My messages.properties file has: applicationInfo.title=Test Application applicationInfo.caption=Test Application Caption, Spring RCP applicationInfo.description=Test Spring RCP And what happens is that the two properties in the application exist fine, but the properties from messages.properties does not - obviously a problem with the messageSource section of the application-context, but what? My directory structure is: /src /src/messages.properties /src/org/at/Start.java /resources/application-context.xml Andrew |
From: Andrew - D. <at....@ds...> - 2004-06-06 21:50:06
|
2004-06-06 22:34:15,379 WARN [org.springframework.rcp.application.startup.ApplicationLauncher] - <Exception occured initializing context.> org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'application' defined in class path resource [org/ats/hrm/application-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.rcp.application.Application]; constructor threw exception; nested exception is java.lang.IllegalArgumentException: The labeled object's label must be configured. org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.rcp.application.Application]; constructor threw exception; nested exception is java.lang.IllegalArgumentException: The labeled object's label must be configured. java.lang.IllegalArgumentException: The labeled object's label must be configured. at org.springframework.util.Assert.notNull(Assert.java:176) at org.springframework.rcp.core.LabeledObjectSupport.getDisplayName(LabeledObjectSupport.java:99) at org.springframework.rcp.application.Application.setApplicationInfo(Application.java:166) at org.springframework.rcp.application.Application.<init>(Application.java:140) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:274) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:66) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:395) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:214) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:177) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:183) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:268) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:68) at org.springframework.rcp.application.startup.ApplicationLauncher.launch(ApplicationLauncher.java:115) at org.springframework.rcp.application.startup.ApplicationLauncher.<init>(ApplicationLauncher.java:81) at org.ats.Start.main(HRM.java:14) On Sun, 2004-06-06 at 22:33, Keith Donald wrote: > Andrew, > > > > Can you post your stack trace? The definitive evidence that always > proves most helpful! > > > > Thanks, > > Keith > > > > > ______________________________________________________________________ > > From:spr...@li... > [mailto:spr...@li...] On Behalf > Of Andrew Todd > Sent: Sunday, June 06, 2004 5:10 PM > To: Spring Framework Rich Client Platform > Subject: [Springframework-rcp-dev] Dumb Question > > > > > Obviously this will be a dumb question, but I can't get the > message.properties file to be read, which causes the application NOT > to load - error about label required. > Now, I have my messages.properties file in the src directory > My application-context.xml has: > <?xml version="1.0" encoding="UTF-8"?> > <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" > "http://www.springframework.org/dtd/spring-beans.dtd"> > > <beans> > <bean id="application" > class="org.springframework.rcp.application.Application"> > <constructor-arg index="0"> > <ref bean="applicationInfo"/> > </constructor-arg> > </bean> > > <bean id="applicationInfo" > class="org.springframework.rcp.application.ApplicationInfo"> > <property name="version"><value>1.0</value></property> > <property name="buildId"><value>20040530001</value></property> > </bean> > > <bean id="messageSource" > > class="org.springframework.context.support.ResourceBundleMessageSource"> > <property name="basenames"> > <list> > <value>messages</value> > </list> > </property> > </bean> > </beans> > > My messages.properties file has: > applicationInfo.title=Test Application > applicationInfo.caption=Test Application Caption, Spring RCP > applicationInfo.description=Test Spring RCP > > And what happens is that the two properties in the application exist > fine, but the properties from messages.properties does not - obviously > a problem with the messageSource section of the application-context, > but what? > > My directory structure is: > /src > /src/messages.properties > /src/org/at/Start.java > /resources/application-context.xml > > > > Andrew > > > Andrew - DEV |
From: Keith D. <kd...@cs...> - 2004-06-06 22:06:03
|
Andrew, Your message source bean definition looks fine to me, pulling messages from the root of your classpath, which I assume to be the /src directory. Plus, if there was a problem initializing the message source locations, it would certainly tell you. Do you have an application object configurer bean defined in your context? See the petclinic application-context.xml example. What this does is configure all application objects by bean name after they are instantiated by spring. It is a bean post processor. This is used to wire up internationalized display properties for making those objects fit for display in the GUI. So for example, when the "applicationInfo" bean is instantiated, the configurer will lookup the title, caption, and description from the message source (applicationInfo.title, applicationInfo.caption, applicationInfo.description, respectively) and inject them into your ApplicationInfo bean. Without the configurer defined, none of this will happen. The configurer is there to remove a good deal of the configuration you must specify in the context file. You don't have to use it, but I recommend it. If you don't, you must fully define all required properties in the context file. Keith _____ From: spr...@li... [mailto:spr...@li...] On Behalf Of Andrew Todd Sent: Sunday, June 06, 2004 5:10 PM To: Spring Framework Rich Client Platform Subject: [Springframework-rcp-dev] Dumb Question Obviously this will be a dumb question, but I can't get the message.properties file to be read, which causes the application NOT to load - error about label required. Now, I have my messages.properties file in the src directory My application-context.xml has: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="application" class="org.springframework.rcp.application.Application"> <constructor-arg index="0"> <ref bean="applicationInfo"/> </constructor-arg> </bean> <bean id="applicationInfo" class="org.springframework.rcp.application.ApplicationInfo"> <property name="version"><value>1.0</value></property> <property name="buildId"><value>20040530001</value></property> </bean> <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basenames"> <list> <value>messages</value> </list> </property> </bean> </beans> My messages.properties file has: applicationInfo.title=Test Application applicationInfo.caption=Test Application Caption, Spring RCP applicationInfo.description=Test Spring RCP And what happens is that the two properties in the application exist fine, but the properties from messages.properties does not - obviously a problem with the messageSource section of the application-context, but what? My directory structure is: /src /src/messages.properties /src/org/at/Start.java /resources/application-context.xml Andrew |
From: Andrew - D. <at....@ds...> - 2004-06-06 22:30:44
|
Keith, Thanks for that, sorted out the problem with those messages. However, the app now fails with this: Looking in the petclinic app, I don't see anything related to globalActionRegistry.? org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'application' defined in class path resource [org/ats/hrm/application-context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'globalActionRegistry' is defined: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [application,applicationInfo,messageSource,applicationObjectConfigurer,mainWindow]; Root of BeanFactory hierarchy org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'globalActionRegistry' is defined: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [application,applicationInfo,messageSource,applicationObjectConfigurer,mainWindow]; Root of BeanFactory hierarchy at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:242) at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:498) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:143) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:399) at org.springframework.rcp.application.Application.setupActionHandling(Application.java:256) at org.springframework.rcp.application.Application.initApplicationContext(Application.java:203) at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:79) at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:65) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:138) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:248) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:177) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:183) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:268) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:68) at org.springframework.rcp.application.startup.ApplicationLauncher.launch(ApplicationLauncher.java:115) at org.springframework.rcp.application.startup.ApplicationLauncher.<init>(ApplicationLauncher.java:81) at org.ats.hrm.HRM.main(HRM.java:14) On Sun, 2004-06-06 at 23:05, Keith Donald wrote: > Andrew, > > > > Your message source bean definition looks fine to me, pulling messages > from the root of your classpath, which I assume to be the /src > directory. Plus, if there was a problem initializing the message > source locations, it would certainly tell you. > > > > Do you have an application object configurer bean defined in your > context? See the petclinic application-context.xml example. What > this does is configure all application objects by bean name after they > are instantiated by spring. It is a bean post processor. This is > used to wire up internationalized display properties for making those > objects fit for display in the GUI. So for example, when the > “applicationInfo” bean is instantiated, the configurer will lookup the > title, caption, and description from the message source > (applicationInfo.title, applicationInfo.caption, > applicationInfo.description, respectively) and inject them into your > ApplicationInfo bean. Without the configurer defined, none of this > will happen. > > > > The configurer is there to remove a good deal of the configuration you > must specify in the context file. You don’t have to use it, but I > recommend it. If you don’t, you must fully define all required > properties in the context file. > > > > Keith > > > > > ______________________________________________________________________ > > From:spr...@li... > [mailto:spr...@li...] On Behalf > Of Andrew Todd > Sent: Sunday, June 06, 2004 5:10 PM > To: Spring Framework Rich Client Platform > Subject: [Springframework-rcp-dev] Dumb Question > > > > > Obviously this will be a dumb question, but I can't get the > message.properties file to be read, which causes the application NOT > to load - error about label required. > Now, I have my messages.properties file in the src directory > My application-context.xml has: > <?xml version="1.0" encoding="UTF-8"?> > <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" > "http://www.springframework.org/dtd/spring-beans.dtd"> > > <beans> > <bean id="application" > class="org.springframework.rcp.application.Application"> > <constructor-arg index="0"> > <ref bean="applicationInfo"/> > </constructor-arg> > </bean> > > <bean id="applicationInfo" > class="org.springframework.rcp.application.ApplicationInfo"> > <property name="version"><value>1.0</value></property> > <property name="buildId"><value>20040530001</value></property> > </bean> > > <bean id="messageSource" > > class="org.springframework.context.support.ResourceBundleMessageSource"> > <property name="basenames"> > <list> > <value>messages</value> > </list> > </property> > </bean> > </beans> > > My messages.properties file has: > applicationInfo.title=Test Application > applicationInfo.caption=Test Application Caption, Spring RCP > applicationInfo.description=Test Spring RCP > > And what happens is that the two properties in the application exist > fine, but the properties from messages.properties does not - obviously > a problem with the messageSource section of the application-context, > but what? > > My directory structure is: > /src > /src/messages.properties > /src/org/at/Start.java > /resources/application-context.xml > > > > Andrew > > > Andrew - DEV |
From: Keith D. <kd...@cs...> - 2004-06-06 23:01:52
|
The globalActionRegistry is defined in view-context.xml in the petclinic sample, within the ui package. It is a registry for actions that are shared / re-targeted between views; for example, cut, copy, paste, delete, properties. I've changed its definition is not required to startup the application; however, if you need global actions you will need to define one for now. I will be enhancing the startup application configuration capability to support programmatic configuration in-line with the enhanced lifecycle support I brought up in a previous email to Ronald soon. Keith _____ From: spr...@li... [mailto:spr...@li...] On Behalf Of Andrew - Development Sent: Sunday, June 06, 2004 6:31 PM To: Spring Framework Rich Client Platform Subject: RE: [Springframework-rcp-dev] Dumb Question Keith, Thanks for that, sorted out the problem with those messages. However, the app now fails with this: Looking in the petclinic app, I don't see anything related to globalActionRegistry.? org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'application' defined in class path resource [org/ats/hrm/application-context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'globalActionRegistry' is defined: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [application,applicationInfo,messageSource,applicationObjectConfigurer,mainW indow]; Root of BeanFactory hierarchy org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'globalActionRegistry' is defined: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [application,applicationInfo,messageSource,applicationObjectConfigurer,mainW indow]; Root of BeanFactory hierarchy at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean Definition(DefaultListableBeanFactory.java:242) at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanD efinition(AbstractBeanFactory.java:498) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra ctBeanFactory.java:143) at org.springframework.context.support.AbstractApplicationContext.getBean(Abstr actApplicationContext.java:399) at org.springframework.rcp.application.Application.setupActionHandling(Applicat ion.java:256) at org.springframework.rcp.application.Application.initApplicationContext(Appli cation.java:203) at org.springframework.context.support.ApplicationObjectSupport.setApplicationC ontext(ApplicationObjectSupport.java:79) at org.springframework.context.support.ApplicationContextAwareProcessor.postPro cessBeforeInitialization(ApplicationContextAwareProcessor.java:65) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory .applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFact ory.java:138) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory .createBean(AbstractAutowireCapableBeanFactory.java:248) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory .createBean(AbstractAutowireCapableBeanFactory.java:177) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra ctBeanFactory.java:159) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInst antiateSingletons(DefaultListableBeanFactory.java:183) at org.springframework.context.support.AbstractApplicationContext.refresh(Abstr actApplicationContext.java:268) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(Cl assPathXmlApplicationContext.java:68) at org.springframework.rcp.application.startup.ApplicationLauncher.launch(Appli cationLauncher.java:115) at org.springframework.rcp.application.startup.ApplicationLauncher.<init>(Appli cationLauncher.java:81) at org.ats.hrm.HRM.main(HRM.java:14) On Sun, 2004-06-06 at 23:05, Keith Donald wrote: Andrew, Your message source bean definition looks fine to me, pulling messages from the root of your classpath, which I assume to be the /src directory. Plus, if there was a problem initializing the message source locations, it would certainly tell you. Do you have an application object configurer bean defined in your context? See the petclinic application-context.xml example. What this does is configure all application objects by bean name after they are instantiated by spring. It is a bean post processor. This is used to wire up internationalized display properties for making those objects fit for display in the GUI. So for example, when the "applicationInfo" bean is instantiated, the configurer will lookup the title, caption, and description from the message source (applicationInfo.title, applicationInfo.caption, applicationInfo.description, respectively) and inject them into your ApplicationInfo bean. Without the configurer defined, none of this will happen. The configurer is there to remove a good deal of the configuration you must specify in the context file. You don't have to use it, but I recommend it. If you don't, you must fully define all required properties in the context file. Keith _____ From:spr...@li... [mailto:spr...@li...] On Behalf Of Andrew Todd Sent: Sunday, June 06, 2004 5:10 PM To: Spring Framework Rich Client Platform Subject: [Springframework-rcp-dev] Dumb Question Obviously this will be a dumb question, but I can't get the message.properties file to be read, which causes the application NOT to load - error about label required. Now, I have my messages.properties file in the src directory My application-context.xml has: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="application" class="org.springframework.rcp.application.Application"> <constructor-arg index="0"> <ref bean="applicationInfo"/> </constructor-arg> </bean> <bean id="applicationInfo" class="org.springframework.rcp.application.ApplicationInfo"> <property name="version"><value>1.0</value></property> <property name="buildId"><value>20040530001</value></property> </bean> <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basenames"> <list> <value>messages</value> </list> </property> </bean> </beans> My messages.properties file has: applicationInfo.title=Test Application applicationInfo.caption=Test Application Caption, Spring RCP applicationInfo.description=Test Spring RCP And what happens is that the two properties in the application exist fine, but the properties from messages.properties does not - obviously a problem with the messageSource section of the application-context, but what? My directory structure is: /src /src/messages.properties /src/org/at/Start.java /resources/application-context.xml Andrew Andrew - DEV |