Results 1 to 9 of 9

Thread: setting a static variable value

  1. #1
    Join Date
    Mar 2005
    Location
    India
    Posts
    97

    Default setting a static variable value

    Hi,

    I have a static variable(part of leagacy) that i need to populate with a value

    when the bean is getting deployed at appl. startup.the bean is a singleton

    I am not able to set the value ..it is throwing exception..

    Hw can we overcome this?

    regards

  2. #2
    Join Date
    Mar 2005
    Location
    India
    Posts
    97

    Default

    I am getting the exception..

    org.springframework.beans.NotWritablePropertyExcep tion: Invalid property 'PropertyName' of bean class....

  3. #3
    Join Date
    Mar 2007
    Posts
    515

    Default

    Have you defined setPropertyName() method ?
    http://forum.springframework.org/showthread.php?t=31718

  4. #4
    Join Date
    Mar 2005
    Location
    India
    Posts
    97

    Default

    yes...i did define the setxxx method...

  5. #5
    Join Date
    Mar 2007
    Posts
    515

    Default

    Can you post your code, please ?

  6. #6
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,425

    Default

    Last edited by karldmoore; Aug 27th, 2007 at 04:22 PM.
    Barracuda Networks SSL VPN Lead Developer
    http://pramatr.wordpress.com
    http://twitter.com/karldmoore
    http://www.linkedin.com/in/karldmoore
    Any postings are my own opinion, and should not be attributed to my employer or clients.

  7. #7
    Join Date
    Mar 2005
    Location
    India
    Posts
    97

    Default

    Quote Originally Posted by Andrei Stefan View Post
    Can you post your code, please ?

    I couldnt show u the exact code .....but this is the snapshot of the code...

    Object is the actual class .....

    public class Sample{

    public static Object obj;

    static{
    obj=new Object();

    }
    Sample(){
    }

    methods(){
    obj.xxx();
    }
    }

  8. #8
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,425

    Default

    Did you have a look at the reference manual link?
    Last edited by karldmoore; Aug 27th, 2007 at 04:22 PM.
    Barracuda Networks SSL VPN Lead Developer
    http://pramatr.wordpress.com
    http://twitter.com/karldmoore
    http://www.linkedin.com/in/karldmoore
    Any postings are my own opinion, and should not be attributed to my employer or clients.

  9. #9
    Join Date
    Mar 2005
    Location
    India
    Posts
    97

    Default

    Couldnt make much of it..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •