Solved

Unable to instantiate live instance for INSTANCE;

Posted on 2011-02-26
4
1,180 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
  • 3
4 Comments
 
LVL 47

Accepted Solution

by:
for_yan earned 500 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

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