Solved

Unable to instantiate live instance for INSTANCE;

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Configure a Bean in an XML file 4 49
hibernate example issues from command prompt 10 66
eclipse buid path vs tomcat lib path 10 38
Java class and jar 3 43
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

730 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