Solved

Unable to instantiate live instance for INSTANCE;

Posted on 2011-02-26
4
1,166 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now