?
Solved

Unable to instantiate live instance for INSTANCE;

Posted on 2011-02-26
4
Medium Priority
?
1,205 Views
Last Modified: 2012-05-11
I have this warning message:
Unable to instantiate live instance for INSTANCE; using placeholder object instead.
in this class
public class PMDS {

    private static final PMDS instance = new PMDS();

    public static PMDS getInstance() {
        return instance;
    }
    DecisionCenterControl dcc;
    IGateway mFxcmGateway;
    MarketDataSnapshot incomingQuote;
    ITransportable message;

    private PMDS() {
        this.mFxcmGateway = DBFXConnect.getGateway();
        incomingQuote = (MarketDataSnapshot)message;
    }

    /**
     * @param message

     * @throws SQLException
     * @throws ClassNotFoundException
     * @throws InstantiationException
     * @throws IllegalAccessException
     * @throws FieldNotFound
     * @throws Exception
     */

    String symbol;
    double bidPx;
    double askPx;
    double bid;
    double ask;
//    BigDecimal ask;
    String eurusd_bid;
    String eurusd_ask;


    public void parseMarketDataSnapshot(ITransportable message,
                                        boolean printMarketData) throws SQLException,
                                                                        ClassNotFoundException,
                                                                        InstantiationException,
                                                                        IllegalAccessException,
                                                                        FieldNotFound,
                                                                        Exception {

        if (message instanceof MarketDataSnapshot) {

            incomingQuote = (MarketDataSnapshot)message;
            symbol = incomingQuote.getInstrument().getSymbol();
            bidPx = incomingQuote.getBidOpen();
            askPx = incomingQuote.getAskOpen();

            try {

                if ("EUR/USD".equalsIgnoreCase(symbol.trim())) {

Open in new window

What is it placeholder object?
0
Comment
Question by:gbcbr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 47

Accepted Solution

by:
for_yan earned 2000 total points
ID: 34987614
What is this "warning message"? Is it a Java runtime exception? What is exact Exception class name as you see it appear?
Can you post the stacktrace of it with exact line number
and how exactly this warning appears?

Another question - can you explain - in your own practical words - I mean not just this is a "singleton" pattern or something,
but physically, what is special about this class in this program, that the the authors of this code
use this kind of system to get to this instance - why not to have normal public constructor and then say
PMDS p = new PMDS() ? Maybe if you do just that - you'll not have this warning?
 
 


0
 
LVL 47

Expert Comment

by:for_yan
ID: 34987901

Well, it does not llok like Java Exception.
Are you by chance using somthing like JDeveloper.

If you google this warning  message, all pages which come up
have to do JDeveloper folks and something about JavaBeans
used for creating visual controls in JDeveloper, or something like
that. Your class does not seem to be a visual element.
Anyway, in one case I found some sort of explanation, seems from someone knowledgeable (see link below).
Please, read, perhaps it can give you some clue where to look and what to think:
http://programming.itags.org/development-tools/123520/

0
 

Author Comment

by:gbcbr
ID: 34987996
Thank you for your search, I google also this question before ask it here But I didn't find any explanation for my case.
Your link little bit help, but after your first reply I start reinvestigate my classes and found that nobody call PMDS class.
Really I don't remember who advice me to change it from PMDS pmds = new PMDS(); as I created from beginning.
I return everything back to original direct call from constructor of DBFXConnect and forget about this instantiation.
Thank you.
0
 
LVL 47

Expert Comment

by:for_yan
ID: 34988067
Great! I'm very happy. I like everything simple.
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month13 days, 4 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question