Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Unable to instantiate live instance for INSTANCE;

Posted on 2011-02-26
4
Medium Priority
?
1,224 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

636 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