Search Results

Search found 8 results on 1 pages for 'babyangel86'.

Page 1/1 | 1 

  • Spring: PropertyPlaceHolderConfigurer to set values for non-string/integer properties

    - by babyangel86
    Hi, All the examples I have seen where the PropertyPlaceHolderConfigurer is used seem to be setting simple values like Strings and ints. How do you use the PPC to set the values of classes. E.g. If i had a class signature Source(String name, DistributionSample batch, DistributionSample delay) How would I go about setting the batch and delay properties. There is also a small catch. DistributionSample is an abstract class. On the bright side, The class that is using the propertyPlaceHolder knows the beanName of the "Solid" class that needs to be instantiated. Any help would be much appreciated.

    Read the article

  • Spring with Castor - Null Pointer Exception when initialising Application Context

    - by babyangel86
    Hi, I'm trying to register my castor mapping files with spring and I appear to be getting a null pointer exception. In my application context I have: <bean id="xmlContext" class="org.castor.spring.xml.XMLContextFactoryBean"> <property name="mappingLocations"> <list> <value>DistributionSamplerMappings.xml</value> </list> </property> <property name="castorProperties"> <props> <prop key="org.exolab.castor.xml.strictelements">false</prop> </props> </property> </bean> <bean id="marshaller" class="org.castor.spring.xml.CastorMarshallerFactoryBean"> <property name="xmlContext"><ref local="xmlContext"/></property> </bean> <bean id="unmarshaller" class="org.castor.spring.xml.CastorUnmarshallerFactoryBean"> <property name="xmlContext"> <ref local="xmlContext"/></property> <property name="ignoreExtraElements"><value>true</value></property> <property name="ignoreExtraAttributes"><value>true</value></property> </bean> Where DistributionSamplerMappings.xml lives in the same dir as the application context. I've tried using the spring-xml jar 1.2.1 and 1.5.3. but none of them seem to help. The exception being thrown back is: SEVERE: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xmlContext' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.lang.NullPointerException at org.castor.spring.xml.XMLContextFactoryBean.afterPropertiesSet(XMLContextFactoryBean.java:118) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335) ... 30 more I'm using Spring 2.5.6 and Castor 1.3.1. Looking around I find I'm not the only one who has had this problem, but I don't seem to be able to find a solution. Any help would be much appreciated.

    Read the article

  • Flex Force Decimal

    - by babyangel86
    Hi, I'm looking for a regex or a way to format the NumberValidator so that only decimal places are allowed. The domain="real" allows you to put integer values, but I need to force the user to but in 2.0 if they want an integer. This is because they pass through a Castor mapping file, it complains if it gets an integer when it expects a decimal. I dont want to restrict the number of decimal places, just insist that there must be a point, and a number after it. Any help would be much appreciated.

    Read the article

  • SPRING: How do you programmatically instantiate classes based on information passed from Flex UI

    - by babyangel86
    Imagine the UI passes back an XMl node as such: <properties> <type> Source </type> <name> Blooper </name> <delay> <type> Deterministic </type> <parameters> <param> 4 </param> </parameters> <delay> <batch> <type> Erlang </type> <parameters> <param> 4 </param> <param> 6 </param> </parameters> <batch> And behind the scene what it is asking that you instantiate a class as such: new Source("blooper", new Exp(4), new Erlang(4,6); The problem lies in the fact that you don't know what class you will need to processing, and you will be sent a list of these class definitions with instructions on how they can be linked to each other. I've heard that using a BeanFactoryPostProcessor might be helpful, or a property editor/convertor. However I am at a loss as to how best to use them to solve my problem. Any help you can provide will be much appreciated.

    Read the article

  • Setting the Panel Owner

    - by babyangel86
    Hi, I've got an application that allows a panel to popup to allow the user to edit some properties. How do I set the panel owner so that it is on top of all the other components on the page without actually disabling them like you do with an alert box?

    Read the article

  • Force Decimal Regex

    - by babyangel86
    Hi, I'm looking for a regex or a way to format the NumberValidator so that only decimal places are allowed. The domain="real" allows you to put integer values, but I need to force the user to but in 2.0 if they want an integer. This is because they pass through a Castor mapping file, it complains if it gets an integer when it expects a decimal. I dont want to restrict the number of decimal places, just insist that there must be a point, and a number after it. Any help would be much appreciated.

    Read the article

  • Storing Instances of Classes in Flex Shared Objects

    - by babyangel86
    Is it possible to store instances of a class in a cookie or in shared objects. Basically in my application I have an object "Diagram" that the user can create. If they hit save, I want to store the current instance as a cookie and allows them to reload it later. Alternatively, I could see about getting them to store the saved version on the hard disk. But even then, all I want to save and retreive is my actionscript object. Is this possible? I've tried storing the object to SharedObject.data.diag, but when I try to retrieve the object from the cookie doing SharedObject.data.diag as Diag returns null.

    Read the article

  • RegExpValidator never matches

    - by babyangel86
    Hi, I've got a class that's meant to validate input fields to make sure the value is always a decimal. I've tested the regex here: http://livedocs.adobe.com/flex/3/html/help.html?content=validators_7.html, and it looks like it does the right thing, but in my app, I can't seem to get it to match to a number format. Class Definition: public class DecimalValidator { //------------------------------- ATTRIBUTES public var isDecimalValidator:RegExpValidator; //------------------------------- CONSTRUCTORS public function DecimalValidator() { isDecimalValidator = new RegExpValidator(); isDecimalValidator.expression = "^-?(\d+\.\d*|\.\d+)$"; isDecimalValidator.flags = "g"; isDecimalValidator.required = true; isDecimalValidator.property = "text"; isDecimalValidator.triggerEvent = FocusEvent.FOCUS_OUT; isDecimalValidator.noMatchError = "Float Expected"; } } Setting the source here: public function registerDecimalInputValidator(inputBox:TextInput, valArr:Array):void { // Add Validators var dValidator:DecimalValidator = new DecimalValidator(); dValidator.isDecimalValidator.source = inputBox; dValidator.isDecimalValidator.trigger = inputBox; inputBox.restrict = "[0-9].\\.\\-"; inputBox.maxChars = 10; valArr.push(dValidator.isDecimalValidator); } And Calling it here: registerDecimalInputValidator(textInput, validatorArr); Where textInput is an input box created earlier. Clearly I'm missing something simple yet important, but I'm not entirely sure what! Any help would be much appreciated.

    Read the article

1