Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8569893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:26:23+00:00 2026-06-11T18:26:23+00:00

I have one java bean class set values in parsing .My requirement to access

  • 0

I have one java bean class set values in parsing .My requirement to access this class
Globally but give null pointer exception when use its instance static and assign value in that.Code is as:-

private String Responce;
private String Error;
private String Url;
private SIPModle objsip;
private VMModle objvmmodle;
private ArrayList<CustompadModle> objcmodlelist = new ArrayList<CustompadModle>();
private SettingModle objsettingmodle;
private WifiModle objwifimodle;

public String getResponce() {
    return Responce;
}
public void setResponce(String responce) {
    Responce = responce;
}
public String getError() {
    return Error;
}
public void setError(String error) {
    Error = error;
}
public ArrayList<CustompadModle> getObjcmodlelist() {
    return objcmodlelist;
}
public void setObjcmodlelist(CustompadModle objcmodlelist) {
    this.objcmodlelist.add(objcmodlelist);
}
public String getUrl() {
    return Url;
}
public void setUrl(String url) {
    Url = url;
}
public SIPModle getObjsip() {
    return objsip;
}
public void setObjsip(SIPModle objsip) {
    this.objsip = objsip;
}
public VMModle getObjvmmodle() {
    return objvmmodle;
}
public void setObjvmmodle(VMModle objvmmodle) {
    this.objvmmodle = objvmmodle;
}

public SettingModle getObjsettingmodle() {
    return objsettingmodle;
}
public void setObjsettingmodle(SettingModle objsettingmodle) {
    this.objsettingmodle = objsettingmodle;
}
public WifiModle getObjwifimodle() {
    return objwifimodle;
}
public void setObjwifimodle(WifiModle objwifimodle) {
    this.objwifimodle = objwifimodle;
}

My requirement is that globle access this bean class globlly.Anyone suggest me

I am getting this object in doinbackground and assign in static object of that class as:
AsyncTask {

    ProgressDialog objprogress = new ProgressDialog(
            UserSettingConfiguration.this);
    ApplicationRequestHandler objhandler = new ApplicationRequestHandler();

    @Override
    protected void onPreExecute() {
        this.objprogress.setMessage("Please Wait While Loading...");
        this.objprogress.isShowing();
    }

    @Override
    protected ConfigurationSttingModle doInBackground(String... params) {
        objconfigsetting = objhandler.getConfigurationSetting(params[0],
                params[1], params[2], params[3]);
        return objconfigsetting;
    }

    @Override
    protected void onPostExecute(ConfigurationSttingModle result) {
        if (this.objprogress.isShowing()) {
            this.objprogress.dismiss();
        }


    }
}

And use in a class Advance as;-

private static HashMap<String, String> SUMMARIES = new HashMap<String, String>() {

    private static final long serialVersionUID = 3055562364235868653L;

    {
        String server = UserSettingConfiguration.objconfigsetting.getObjsip().getServer();
        String displayname1 = UserSettingConfiguration.objconfigsetting.getObjsip().getUser();
        String user = UserSettingConfiguration.objconfigsetting.getObjsip().getUser();
        String password= UserSettingConfiguration.objconfigsetting.getObjsip().getPassword();

        put(FIELD_DISPLAY_NAME,displayname1);// "90901");
        put(FIELD_CALLER_ID,displayname1); //"90901");
        put(FIELD_SERVER,server);
        put(FIELD_USERNAME,user);
        put(FIELD_AUTH_ID, "207");
        put(FIELD_PASSWORD,password);
        put(FIELD_PROXY, null);
    }
};
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:26:24+00:00Added an answer on June 11, 2026 at 6:26 pm

    I think that a singleton pattern will match your requirements.

    You must add this code:

    private static MyJavaBeanClass = null;
    
    public static MyJavaBeanClass getInstance(){
      if(null == instance){
        instance = new MyJavaBeanClass();
      }
      return instance;
    }
    

    You must change MyJavaBeanClass for the name of your class, and then you can invoke it anywhere like this:

    MyJavaBeanClass.getInstance().setError("Testing");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a really basic java program just one .java/.class file (.java uncompiled .class
I have a piece of code VERY similar to this one http://java.sun.com/developer/onlineTraining/JavaMail/contents.html#JavaMailFetching I the
I have a static Command class like this (but with many more commands): class
I have Java bean class and I want to sort list of these beans
I have the following spring bean configuration <bean id=fileBean class=java.io.File> <constructor-arg type=java.lang.String value=$prop{file.path.property} />
I have created a Java Web project with just one class. If I compile
I have one java project in netBeans. There are some packages, and classes in
I have one application that prints messages from Test.exe in console .My java program
i have one table TABLE_SUBJECT And i pass subject name to DBHelper.java. Then i
I consume Java Service in my .NET appliaction. I have one question: When service

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.