Instantiation problem

Hi !
To clarify my problem, I have trimmed down the 4 files (here included) to keep just the essential.
When I try to compile the project, I have a �cannot resolve symbol� message for the drawingPanel and the currentObject objects referenced in the ToolbarPanel class.
The compiler does not seem to see these objects although they should be already instantiated at this point. All files are in the same directory so the classes should be seen without import statements.
I had the same problem a while ago and I solved it by using static members or inner classes. But here I cant do that (and it does not make sens to do so).
I must be missing something about how files relate to each other. I thought that dividing a project into custom Panel related files was a good idea �
Any clue someone ? Thanks !
JF
import java.awt.*;
import javax.swing.*;
public class MainWindow extends JFrame {
     public DrawingPanel drawingPanel;
     public ToolbarPanel toolbarPanel;
     public static void main( String args[] )
          MainWindow mainWindow = new MainWindow();
          mainWindow.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
     public MainWindow()
          super( "Testing application" );
          Container mainPanel = getContentPane();
          mainPanel.setLayout( new BorderLayout() );
          //     custom Jpanel
          drawingPanel = new DrawingPanel();
          mainPanel.add( drawingPanel, BorderLayout.CENTER );
          //     custom Jpanel
          toolbarPanel = new ToolbarPanel();                         
          mainPanel.add( toolbarPanel, BorderLayout.NORTH );
          setSize( 800,570 );
          setVisible( true );
}// class MainWindow*******************************************************************************
import javax.swing.*;
public class DrawingPanel extends JPanel {
     public MyObject currentObject;
     public int newVariable;
     public DrawingPanel()
          newVariable = 31;     // Default value
          createNewObject();
     public void createNewObject()
          currentObject = new MyObject( newVariable );
}// class DrawingPanel*******************************************************************************
import javax.swing.*;
import java.awt.event.*;
public class ToolbarPanel extends JPanel implements ActionListener {
     private JButton addButton;
     public ToolbarPanel()
          addButton = new JButton( "  Add  " );
          add( addButton );
          addButton.addActionListener(this);
     public void actionPerformed( ActionEvent ae )
          if (ae.getSource() == addButton)
               drawingPanel.newVariable = currentObject.variable ++;
               drawingPanel.createNewObject();
}// class ToolbarPanel*******************************************************************************
public class MyObject {
     public int variable;
     public MyObject( int variable )
          this.variable = variable;
}// class MyObject

but that they don't
need any instance or class qualification toidentify
them.In Java 1.5 you can accomplish this.
Sort of. You're just explicitly mentioning the
qualifier in one place, but it's not completely gone.So ?
Java has to know where to look for variables ... it can't just mysteriously find them.
I don't know if you'll find anything "official" that
settles it once and for all, but a quick google turned
up enough to convince me not to call 'em "global
variables."Well, they may not be global in the way other languages think of them (and like you do; i.e. must be referred to w/o prefix) but they are still "global", so it doesn't really matter, IMO.
Your sentence would be better off something like: "Java doesn't have c-style global variables.".
For example, the JLS won't tell you explicitly that
you can have a variable who's value is 10, but itcan
be accomplished.That's not really the same thing.You are saying that the JLS should explicitly state something as achievable, and if it doesn't you can't say it exists.
I say: "Java has variables which are equal to 10".
You say: "Where in the JLS does it say that?"
Similarly, I say: "Java has variables which can be global"
You say: "Where in the JLS ... ?"

Similar Messages

  • Factory Instantiation Problem when publishing WSDL in Service Registry

    I have installed SOA Suite 10.1.3.1 and OSR 10.1.3. and am trying to publish a WSDL for a new business created as admin. This causes an UDDI error, though:
    "Invalid WSDL location! WSDLException: faultCode=CONFIGURATION_ERROR: Problem instantiating factory implementation.: oracle.j2ee.ws.wsdl.factory.WSDLFactoryImpl."
    I checked the jars in {oracle.home}/j2ee and couldn't find WSDLFactoryImpl in any of these. It is contained in orawsdl.jar under jdeveloper and bpel, though.
    Anyone seeing the same problem or are you guys able to use the OSR and publish services ? Hints on how to patch the OSR classpath ? (I am running it as standalone within OC4J).
    cheers,
    Diego

    yes, I do have one tip:
    ..don't install in the "home" instance. Well, to be more precise, don't install in the same instance as your BPEL PM and ESB - which by default is the "home" instance.
    You have to create a new instance (e.g. "registry") for your OSR, see "Integrating Oracle BPEL Process Manager with the Oracle Application Server Service Registry", page 2-32, step 6 in the "Oracle BPEL Process Manager Administrator's Guide".
    Maybe also have a read in
    Re: Anyone successfully installed SOA [Advanced] & Service Registry 10.1.3.1 ?
    good luck :-)
    Message was edited by:
    Diego Tognola

  • Am SDK command line sample AMStoreConnection Instantiation problem

    I am trying to use the Sun One am SDK in an java command line sample but when i try to instantiate the AMStoreConnection Object i get the following error:
    Exception in thread "main" java.lang.ExceptionInInitializerError
    at com.iplanet.am.sdk.AMStoreConnection.<clinit>(AMStoreConnection.java:46)
    at CommandLineSSO.main(CommandLineSSO.java:41)
    Caused by: java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key authError-nullInput
    at java.util.ResourceBundle.getObject(ResourceBundle.java:314)
    at java.util.ResourceBundle.getString(ResourceBundle.java:274)
    at com.iplanet.services.util.I18n.getString(I18n.java:255)
    at com.iplanet.authentication.server.AuthSPrincipal.<init>(AuthSPrincipal.java:66)
    at com.iplanet.authentication.AuthPrincipal.<init>(AuthPrincipal.java:49)
    at com.iplanet.am.sdk.AMSDKUtil.<clinit>(AMSDKUtil.java:222)
    ... 2 more
    i the amSDK debug log the error messages is :
    10/25/2002 10:01:31:078 AM CEST: Thread[main,5,main]
    ERROR: AdminUtils: Initialize admin info
    Got LDAPServiceException code=19
         at com.iplanet.services.ldap.DSConfigMgr.loadServerConfiguration(DSConfigMgr.java:299)
         at com.iplanet.services.ldap.DSConfigMgr.getDSConfigMgr(DSConfigMgr.java:54)
         at com.iplanet.am.util.AdminUtils.<clinit>(AdminUtils.java:37)
         at com.iplanet.am.sdk.AMSDKUtil.<clinit>(AMSDKUtil.java:222)
         at com.iplanet.am.sdk.AMStoreConnection.<clinit>(AMStoreConnection.java:46)
         at CommandLineSSO.main(CommandLineSSO.java:41)
    Here is the java code :
              AMObject amObj;
              AMStoreConnection conn;
              SSOTokenManager manager = SSOTokenManager.getInstance();
              SSOToken token = manager.createSSOToken(args[0]);
                   conn = new AMStoreConnection( token);
    /***************************************************************/

    I am having the same problem as was initially posted in this thread, yet it doesn't seem to be fixed by the suggestion below. I have the SUNWam/lib and SUNWam/locale directories in my classpath, which makes all the right properties files available to the classloader.
    I was able to determine that the problem was just a missing line in the amSDK.properties file "authError-nullInput=Null Values" ... but now I just get a NullPointerException
    [25/Jul/2003:11:33:43] failure (25141): Internal error: Unexpected error condition thrown (unknown exception,no description), stack: java.lang.ExceptionInInitializerError: java.lang.NullPointerException: Null Values
         at com.iplanet.authentication.server.AuthSPrincipal.<init>(AuthSPrincipal.java:66)
         at com.iplanet.authentication.AuthPrincipal.<init>(AuthPrincipal.java:49)
         at com.iplanet.am.sdk.AMSDKUtil.<clinit>(AMSDKUtil.java:222)
         at com.iplanet.am.sdk.AMStoreConnection.<clinit>(AMStoreConnection.java:46)
         at test.TestServlet.service(TestServlet.java:90)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:897)
         at com.iplanet.server.http.servlet.NSServletRunner.Service(NSServletRunner.java:464)
    any help would be greatly appreciated. thanks.

  • Lazy instantiation problem

    I would like to instantiate collections only when they are needed. It
    works fine for non transactional instances but fails when my instance is
    transactional with following error:
    To perform writes on persistent data outside of a transaction,
    the "nontransactionalWrite" property must be set on the
    PersistenceManagerFactory or Transaction.
    Collection getChildNodesCollection() {
    if (childNodes == null) {
    childNodes = new ArrayList();
    return childNodes;
    I guess it is to be expected as JDO have to enhance all assignments to
    childNodes collection but is there any way to avoid it. If not I will
    have to go back to constructor based initialization which is a waste of
    resources because when JDO creates an instance it will replace all
    collection I create with its own

    Hi,
    Sorry, this is not an answer for your question.
    I'm a beginner on Kodo, and I wonder how did you do the "lazy instantiation"
    of
    members of a collection. Can you specify any documents written about it?
    Thank you,
    Tomohiro Koike
    ""Roytman, Alex"" <[email protected]> wrote in message
    news:[email protected]..
    I would like to instantiate collections only when they are needed. It
    works fine for non transactional instances but fails when my instance is
    transactional with following error:
    To perform writes on persistent data outside of a transaction,
    the "nontransactionalWrite" property must be set on the
    PersistenceManagerFactory or Transaction.
    Collection getChildNodesCollection() {
    if (childNodes == null) {
    childNodes = new ArrayList();
    return childNodes;
    I guess it is to be expected as JDO have to enhance all assignments to
    childNodes collection but is there any way to avoid it. If not I will
    have to go back to constructor based initialization which is a waste of
    resources because when JDO creates an instance it will replace all
    collection I create with its own

  • EmpApplet can't be instantiated ERROR

    Hi,I'm having the same "tutorial.EmpApplet can't be
    instantiated" problem everyone else seems to be having. I've
    tried all the recommended solutions and nothing works. Here is
    a copy of the output to the Java Console using Internet Explorer.
    com.ms.security.SecurityExceptionEx
    [com/sun/java/swing/UIManager.setLookAndFeel]:
    java.io.IOException: bad path: D:\Program
    Files\Oracle\JDeveloper 2.0.184
    Beta\myclasses\com\sun\java\swing\plaf\metal\MetalLookAndFeel.cla
    ss
    at com/ms/security/permissions/FileIOPermission.check
    at com/ms/security/PolicyEngine.deepCheck
    at com/ms/security/PolicyEngine.checkPermission
    at com/ms/security/StandardSecurityManager.chk
    at com/ms/security/StandardSecurityManager.checkRead
    at java/io/File.isDirectory
    at sun/net/www/protocol/file/FileURLConnection.connect
    at
    sun/net/www/protocol/file/FileURLConnection.getInputStream
    at
    com/ms/vm/loader/ResourceLoader.getCodebaseRelativeData
    at com/ms/vm/loader/ResourceLoader.getClassData
    at com/ms/vm/loader/URLClassLoader.findClass
    at com/ms/vm/loader/URLClassLoader.loadClass
    at java/lang/ClassLoader.loadClassInternal at
    java/lang/Class.forName
    at com/sun/java/swing/UIManager.setLookAndFeel
    at com/sun/java/swing/UIManager.initializeDefaultLAF
    at com/sun/java/swing/UIManager.initialize
    at com/sun/java/swing/UIManager.maybeInitialize
    at com/sun/java/swing/UIManager.getDefaults
    at com/sun/java/swing/UIManager.getColor
    at borland/jbcl/control/BevelPanel.<init>
    at borland/jbcl/control/ButtonBar.<init>
    at borland/jbcl/control/NavigatorControl.<init>
    at tutorial/QueryEmpPanel.<init> at
    tutorial/EmpApplet.<init>
    at com/ms/applet/BrowserAppletFrame.newInstance
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.processSentEvent at
    com/ms/applet/AppletPanel.run
    at java/lang/Thread.runError loading class:
    com.sun.java.swing.plaf.metal.MetalLookAndFeel
    com.ms.security.SecurityExceptionEx
    [com/sun/java/swing/UIManager.setLookAndFeel]:
    java.io.IOException: bad path: D:\Program
    Files\Oracle\JDeveloper 2.0.184
    Beta\myclasses\com\sun\java\swing\plaf\metal\MetalLookAndFeel.cla
    ss
    com.ms.security.SecurityExceptionEx
    [com/sun/java/swing/UIManager.setLookAndFeel]:
    java.io.IOException: bad path: D:\Program
    Files\Oracle\JDeveloper 2.0.184
    Beta\myclasses\com\sun\java\swing\plaf\metal\MetalLookAndFeel.cla
    ss
    at com/ms/security/permissions/FileIOPermission.check
    at com/ms/security/PolicyEngine.deepCheck
    at com/ms/security/PolicyEngine.checkPermission
    at com/ms/security/StandardSecurityManager.chk
    at com/ms/security/StandardSecurityManager.checkRead
    at java/io/File.isDirectory
    at sun/net/www/protocol/file/FileURLConnection.connect
    at
    sun/net/www/protocol/file/FileURLConnection.getInputStream
    at
    com/ms/vm/loader/ResourceLoader.getCodebaseRelativeData
    at com/ms/vm/loader/ResourceLoader.getClassData
    at com/ms/vm/loader/URLClassLoader.findClass
    at com/ms/vm/loader/URLClassLoader.loadClass
    at java/lang/ClassLoader.loadClassInternal at
    java/lang/Class.forName
    at com/sun/java/swing/UIManager.setLookAndFeel
    at com/sun/java/swing/UIManager.initializeDefaultLAF
    at com/sun/java/swing/UIManager.initialize
    at com/sun/java/swing/UIManager.maybeInitialize
    at com/sun/java/swing/UIManager.getDefaults
    at com/sun/java/swing/UIManager.getColor
    at borland/jbcl/control/BevelPanel.<init>
    at borland/jbcl/control/ButtonBar.<init>
    at borland/jbcl/control/NavigatorControl.<init>
    at tutorial/QueryEmpPanel.<init> at
    tutorial/EmpApplet.<init>
    at com/ms/applet/BrowserAppletFrame.newInstance
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.processSentEvent at
    com/ms/applet/AppletPanel.run
    at java/lang/Thread.runError loading class:
    com.sun.java.swing.plaf.metal.MetalLookAndFeel
    com.ms.security.SecurityExceptionEx
    [com/sun/java/swing/UIManager.setLookAndFeel]:
    java.io.IOException: bad path: D:\Program
    Files\Oracle\JDeveloper 2.0.184
    Beta\myclasses\com\sun\java\swing\plaf\metal\MetalLookAndFeel.cla
    ss
    java.lang.InstantiationException: tutorial/EmpApplet
    at com/ms/applet/BrowserAppletFrame.newInstance
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.processSentEvent at
    com/ms/applet/AppletPanel.run
    at java/lang/Thread.run
    Please help as I am trying to prove that JDeveloper is the way
    our organization should go for Oracle development.
    Thanks,
    Joe Villarreal
    null

    Joe,
    Does the version on IE that you are using support Swing 1.1 ?
    Also, I am not sure why it is referring to the absolute path (D:
    \Program Files\Oracle\JDeveloper 2.0.184
    Beta\myclasses\com\sun\java\swing\plaf\metal\MetalLookAndFeel.cla
    ). Does your jar file have this path?
    Regards,
    Joe Villarreal (guest) wrote:
    : Hi,I'm having the same "tutorial.EmpApplet can't be
    : instantiated" problem everyone else seems to be having. I've
    : tried all the recommended solutions and nothing works. Here
    is
    : a copy of the output to the Java Console using Internet
    Explorer.
    : com.ms.security.SecurityExceptionEx
    : [com/sun/java/swing/UIManager.setLookAndFeel]:
    : java.io.IOException: bad path: D:\Program
    : Files\Oracle\JDeveloper 2.0.184
    Beta\myclasses\com\sun\java\swing\plaf\metal\MetalLookAndFeel.cla
    : ss
    : at com/ms/security/permissions/FileIOPermission.check
    : at com/ms/security/PolicyEngine.deepCheck
    : at com/ms/security/PolicyEngine.checkPermission
    : at com/ms/security/StandardSecurityManager.chk
    : at com/ms/security/StandardSecurityManager.checkRead
    : at java/io/File.isDirectory
    : at sun/net/www/protocol/file/FileURLConnection.connect
    : at
    : sun/net/www/protocol/file/FileURLConnection.getInputStream
    : at
    : com/ms/vm/loader/ResourceLoader.getCodebaseRelativeData
    : at com/ms/vm/loader/ResourceLoader.getClassData
    : at com/ms/vm/loader/URLClassLoader.findClass
    : at com/ms/vm/loader/URLClassLoader.loadClass
    : at java/lang/ClassLoader.loadClassInternal at
    : java/lang/Class.forName
    : at com/sun/java/swing/UIManager.setLookAndFeel
    : at com/sun/java/swing/UIManager.initializeDefaultLAF
    : at com/sun/java/swing/UIManager.initialize
    : at com/sun/java/swing/UIManager.maybeInitialize
    : at com/sun/java/swing/UIManager.getDefaults
    : at com/sun/java/swing/UIManager.getColor
    : at borland/jbcl/control/BevelPanel.<init>
    : at borland/jbcl/control/ButtonBar.<init>
    : at borland/jbcl/control/NavigatorControl.<init>
    : at tutorial/QueryEmpPanel.<init> at
    : tutorial/EmpApplet.<init>
    : at com/ms/applet/BrowserAppletFrame.newInstance
    : at com/ms/applet/AppletPanel.processSentEvent
    : at com/ms/applet/AppletPanel.processSentEvent at
    : com/ms/applet/AppletPanel.run
    : at java/lang/Thread.runError loading class:
    : com.sun.java.swing.plaf.metal.MetalLookAndFeel
    : com.ms.security.SecurityExceptionEx
    : [com/sun/java/swing/UIManager.setLookAndFeel]:
    : java.io.IOException: bad path: D:\Program
    : Files\Oracle\JDeveloper 2.0.184
    Beta\myclasses\com\sun\java\swing\plaf\metal\MetalLookAndFeel.cla
    : ss
    : com.ms.security.SecurityExceptionEx
    : [com/sun/java/swing/UIManager.setLookAndFeel]:
    : java.io.IOException: bad path: D:\Program
    : Files\Oracle\JDeveloper 2.0.184
    Beta\myclasses\com\sun\java\swing\plaf\metal\MetalLookAndFeel.cla
    : ss
    : at com/ms/security/permissions/FileIOPermission.check
    : at com/ms/security/PolicyEngine.deepCheck
    : at com/ms/security/PolicyEngine.checkPermission
    : at com/ms/security/StandardSecurityManager.chk
    : at com/ms/security/StandardSecurityManager.checkRead
    : at java/io/File.isDirectory
    : at sun/net/www/protocol/file/FileURLConnection.connect
    : at
    : sun/net/www/protocol/file/FileURLConnection.getInputStream
    : at
    : com/ms/vm/loader/ResourceLoader.getCodebaseRelativeData
    : at com/ms/vm/loader/ResourceLoader.getClassData
    : at com/ms/vm/loader/URLClassLoader.findClass
    : at com/ms/vm/loader/URLClassLoader.loadClass
    : at java/lang/ClassLoader.loadClassInternal at
    : java/lang/Class.forName
    : at com/sun/java/swing/UIManager.setLookAndFeel
    : at com/sun/java/swing/UIManager.initializeDefaultLAF
    : at com/sun/java/swing/UIManager.initialize
    : at com/sun/java/swing/UIManager.maybeInitialize
    : at com/sun/java/swing/UIManager.getDefaults
    : at com/sun/java/swing/UIManager.getColor
    : at borland/jbcl/control/BevelPanel.<init>
    : at borland/jbcl/control/ButtonBar.<init>
    : at borland/jbcl/control/NavigatorControl.<init>
    : at tutorial/QueryEmpPanel.<init> at
    : tutorial/EmpApplet.<init>
    : at com/ms/applet/BrowserAppletFrame.newInstance
    : at com/ms/applet/AppletPanel.processSentEvent
    : at com/ms/applet/AppletPanel.processSentEvent at
    : com/ms/applet/AppletPanel.run
    : at java/lang/Thread.runError loading class:
    : com.sun.java.swing.plaf.metal.MetalLookAndFeel
    : com.ms.security.SecurityExceptionEx
    : [com/sun/java/swing/UIManager.setLookAndFeel]:
    : java.io.IOException: bad path: D:\Program
    : Files\Oracle\JDeveloper 2.0.184
    Beta\myclasses\com\sun\java\swing\plaf\metal\MetalLookAndFeel.cla
    : ss
    : java.lang.InstantiationException: tutorial/EmpApplet
    : at com/ms/applet/BrowserAppletFrame.newInstance
    : at com/ms/applet/AppletPanel.processSentEvent
    : at com/ms/applet/AppletPanel.processSentEvent at
    : com/ms/applet/AppletPanel.run
    : at java/lang/Thread.run
    : Please help as I am trying to prove that JDeveloper is the way
    : our organization should go for Oracle development.
    : Thanks,
    : Joe Villarreal
    null

  • Can someone please help me understand this

    I am a new poster here and was hoping someone might be able to help me...
    I am writing a program that is supposed to generate a non applet (IE text) version of a 4-way intersection....however i have run into a problem that i simply cannot see a solution....please tell me why this code does not do what it is supposed to:
    in i meant to call the car arrives method which is supposed to enqueue based on some randomly determined parameters, known as direction and bound....it is supposed to loop through and do that for every car created.. what i think is happnening is that everything is getting overwritten rather than enqueued...what i dont understand is why...the reason i believe that nothing is enqueuing is because later in the code i attempt to dequeue these queues and and set a paramter and i get a null pointer exception
    PLEASE NOTE I RECIEVED THESE ERRORS BEFORE INSTANTIATING THE VEHICLE CURRENT CAR AS NULL...perhaps it is an instantiation problem but i cannot tell...please help me out as I have worked on this forthe last few days and am desparate for an answer
    Vehicle CurrentCar = null;
         do
              //this ensures that the number of vehicles generated is within the spec guidelines
              if (j == 1)//might need to be changed
                   numCars = generator.nextInt(7) + 4;
              else if ((j%2) == 0)
                   numCars = generator.nextInt(6) + 10;
              else if ((j>1)&&( (j%2) !=0))
                   numCars = generator.nextInt(4) + 10;
              totalCars += numCars;
              System.out.println("j is " + j);
              System.out.println( numCars);
              System.out.println(totalCars);
              //this ensures the number of vehicles never goes over 100
                   if (totalCars>100)
                        int subCars = (totalCars - 100); //ensures that car total never goes above 100
                        numCars = numCars - subCars;
                   //calls the MakeMeaCar method which contains the vehicle constructor
                   for (int k=1;k <= numCars; k++)
                   CurrentCar = MakeMeACar(count);
                   count ++;
                   Street.CarArrives(CurrentCar);
                   CurrentCar.toString();
    HERE IS THE CAR ARRIVES METHOD
    public static void CarArrives (Vehicle CurrentCar)
    //These if-else statements evaluate the enum parameters from the vehicle class and assigns them to a queue based on those parameters
    if (CurrentCar.getDirection() == Directenum.s)
         if ((CurrentCar.getBound() == Boundenum.nB) || (CurrentCar.getBound() == Boundenum.wB))
              lfstrChurchNorthbound.enqueue(CurrentCar);
         else if (CurrentCar.getBound() == Boundenum.eB)
              rChurchNorthbound.enqueue(CurrentCar);
    else if (CurrentCar.getDirection() == Directenum.n)
         if ((CurrentCar.getBound() == Boundenum.sB) || (CurrentCar.getBound() == Boundenum.eB))
              lfstrChurchSouthbound.enqueue(CurrentCar);
         else if (CurrentCar.getBound() == Boundenum.wB)
              rChurchSouthbound.enqueue(CurrentCar);
    else if (CurrentCar.getDirection() == Directenum.e)
         if ((CurrentCar.getBound() == Boundenum.wB) || (CurrentCar.getBound() == Boundenum.sB))
              lfstrMainEastbound.enqueue(CurrentCar);
         else if (CurrentCar.getBound() == Boundenum.nB)
              rMainEastbound.enqueue(CurrentCar);
    else if (CurrentCar.getDirection() == Directenum.w)
         if ((CurrentCar.getBound() == Boundenum.eB) || (CurrentCar.getBound() == Boundenum.nB))
              lfstrMainWestbound.enqueue(CurrentCar);
         else if (CurrentCar.getBound() == Boundenum.sB)
              rMainWestbound.enqueue(CurrentCar);
    if you need more code to help please let me know...i would post it all but it about 8 pages or more total (inlcuding the various classes)
    thanks
    I appreciate all help given

    ok running it through a debugger DID NOT HELP at all, please somebody help me, im very desparate now. i have spent 15 hours on this problem alone. i see absolutley nothing wrong with my code and have tried about 10 doifferent ways of trying this.,....i cannot get it to work, somebody please help me, ...in addition i was hoping someone could clear up an issue i have with enums...i do not understand how i can access the variable of the enum, the only access to it my text book provides is how to acess the string associated with enums....but i need to access the variable itself...how would i design such a get method....ive tried that a bunch of different ways as well, and right now im so lost that i want to cry, somebody please help, im begging on my knees...i really need someone to explain this to me....

  • ADF ADFBC_tutorial.pdf Error - in Jdev 10.1.3.3.0

    Hi ,
    I am trying to run ADFBC_tutorial.pdf in Jdev 10.1.3.3.0,
    (I didn't use ADFBCTutorialSetup10131.zip, But i have created the Workspace and project and the jspx and try to run)
    When i try to run the test page, I am getting the following error message.
    We should not use 10.1.3.3.0 for this kind of tutorial?
    What version we need to use? 10.1.3.1 or 10.1.3.0?
    Thanks.
    08/07/22 23:26:40 [SEVERE]: Error instantiating application at file:/D:/Downloads/Jdev11g/jdevstudio10133/jdev/system/oracle.j2ee.10.1.3.41.57/embedded-oc4j/applications/datatags.ear: Unable to get ApplicationConfig for datatags : Error creating deployment directory: IO Error: The system cannot find the path specified
    08/07/22 23:26:40 [SEVERE]: cannot update a configuration file because instantiating application is failed. please correct the instantiating problem and restart oc4j.
    08/07/22 23:26:41 Error initializing server: At least one valid code-source or import-shared-library element is required for shared-library "global.libraries" in /D:/Downloads/Jdevs/jdevstudio10133/jdev/system/oracle.j2ee.10.1.3.41.57/embedded-oc4j/config/server.xml.
    08/07/22 23:26:41 Fatal error: server exiting
    Thanks.
    With Regards,
    Kali.
    OSSI.
    null
    Message was edited by:
    Kalimuthu V

    I have fixed the issue by changing the version of the Jdeveloper.
    I have copied the mywork to the jdeveloper version 10.1.3.1.
    After that i have got an error,
    java.lang.NoSuchMethodError: oracle.adf.view.faces.webapp.wrapper.RequestWrapper.isActionRequest()Z
    but with the help of the thread
    Re: jhs10131 and mydemo1031 can not work in jdev1031
    ie, copiying the library "adf-faces-impl.jar" from C:/JDeveloper/jlib to APP_PATH/ViewController/public_html/WEB-INF/lib
    I could resolve the issue.
    Thanks.
    With Regards,
    Kali.
    OSSI.

  • Any way to run the processor before the compiler throws an error?

    Hi,
    I want to generate code for an annotation @OverrideAll that would implement all the interface I methods with some default body.:
    Example
    interface I {
      void method();
    @OverrideAll
    class A implements I {
    }would have to generate code like this:
    class A_gen implements I {
      public void method() {
    class A extends A_gen {}However, I have the problem that the original source file does NOT compile because the interface I is not implemented, and as such, the annotation processor never runs. My question is:
    Is there any way I could force the annotation processor to run before the compiler shows the error? Or at least some way to supress this error message and give a chance to the annotation processor to run?
    TIA,
    Gabriel

    belingueres wrote:
    Hi,
    Thanks for answering so soon.
    I would prefer not to name the generated class in the original source code. As an alternative I thought to rather generate a subclass, but then there is the instantiation problem (can&acute;t do it without creating a factory method in class A and making it abstract, and indeed again need to name the generated class):
    @OverrideAll
    abstract class A implements I {
    public static A create() {
    return new A_gen();
    // generated class
    class A_gen extends A {
    public void method() {
    }so it seems I reached a dead end here.
    It would really help if (using the superclass generation as originally posted) I could change in the processor the superclass of class A to be A_gen, but it would require AST rewritting and I guess it is not a good option (if at all possible.)Belingueres,There are two ways to do what you want. You can either generate a superclass of A, or a subclass of A.
    If you generate a superclass, you need to specify the generated superclass's name in the extends clause of A. But you said "I would prefer not to name the generated class in the original source code", but give no reasons then go off exploring the second alternative.
    If you generate a subclass of A, then you need a way for the rest of the code to instantiate As without really knowing about the subclass, so you do in fact need a factory method in A which actually returns A_gens.
    I suggest you revisit your preference for not naming the generated class, and work out why you have that preference, and whether it is actually a sound engineering constraint, an aesthetic nicety (maybe in terms of not wanting the implemention strategy to be brought to the surface) or something emotional.
    You can do what you want with annotation processing, but you must choose between naming the generated superclass in the extends, or having an factory method that names the subclass.
    A related issue is that if you generate the superclass, the annotation processor can pick up the name of the class to be generated from the "extends" clause, and you therefore don't need to specify it any other way, whereas if you generate a subclass, the annotation processor cannot infer the name of the subclass that is being instantiated from the factory method (unless you use non standard APIs in your annotation processor), which means you need to explicitly name it as an attribute of the annotation.
    I have a preference for generating a superclass because that imposes less restrictions on whatever else you do with the class, and less of the code generation implementation details leak up into the class's signature.
    Also note when generating a superclass, if you want to extend something other than Object, then you need to specify that as an annotation value, usually as a Class<?>.
    Bruce

  • Does OC4J 10.1.3.3 container support JSF 1.2

    All,
    I am spending more than 2 days to solve an error I am getting when I trying to resolve the error :
    09/06/29 13:37:35 [SEVERE]: cannot update a configuration file because instantiating application is failed. please correct the instantiating problem and restart oc4j.
    Can somebody please clarify if OC4J 10.1.3.3 support JSF 1.2 and which version of rich faces does it support?
    Thanks

    Found a bit more information located here:
    http://wiki.glassfish.java.net/Wiki.jsp?page=JavaServerFacesRI
    See the section entitled
    "Do I have to use a JSP 2.1/Servlet 2.5 container with the Mojarra version 1.2?" which states:
    If you're using JSPs for your view descriptions, then yes, you will need to use a JSP 2.1/Servlet 2.5 compliant container. However, if you're using another view technology, such as Facelets or JSFTemplating, you can run JSF 1.2 within a Servlet 2.4 container with out issue.
    Now here is the part that may make me look like a newb... not sure if I am "using JSP's for my view descriptions"... what does that mean anyway?
    I dont think I am not using Facelets or JSFTemplating. I'm just using standard JSF... All of my pages end in jsp and the standard faces servlet that makes all *.faces requests go through the faces controller servlet. There is really no JSP EL code in my faces pages, just standard jsf tags h:form, f:selectItems, h:inputText etc...
    So my question is... am I using JSP's for my view descriptions?

  • Problems in Instantiating the Model Node

    Hi All,
    I Have a problem with creating the instance of a Model Node  which needs an urgent solution, This is the Scenario:
    I Have created a WebDynpro Project using NetWeaver CE Environment and Java EE 5.0 where i am using an Adaptive WebService Model. I have successfully created the model using the WSDL files and have also added to the Controller,
    But when I try to create an Instance of the Request Node in my controller ie after writing this line:
    Request_MI_Nwce007_AS_SOAPReq objReq = null;
    objReq = new Request_MI_Nwce007_AS_SOAPReq();
    This is the Request Structure from the WSDL - Request_MI_Nwce007_AS_SOAPReq
    it gives me an Error saying The constructor Request_MI_Nwce007_AS_SOAPReq() is undefined.
    Please let me know the exact problem and also the way to overcome this problem.
    Its Quite URGENT!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Points Rewarded for helpful answers.
    Regards,
    Poojith MV

    Hi Poojitha,
    If your imported Webservice has any structure like  this Request_MI_Nwce007_AS_SOAPReq_Input then instantiate the input structure.
    else
    Try instantiating along with the package name, for example if your package name is: com.sdn then try this:
    "com.sdn.*Request_MI_Nwce007_AS_SOAPReq objReq = null;
    objReq = new com.sdn.Request_MI_Nwce007_AS_SOAPReq();
    Hope this solves your problem.
    Thanks n Regards,
    Jhansi Miryala

  • Problem with model instantiation

    I have an EJB model and while instantiating it in WDP I am getting  an error at runtime:
    The initial exception that caused the request to fail, was:
       java.lang.NullPointerException
        at -- Optimized, preallocated exception. No stack trace. Run VM with -XX:-OmitStackTraceInFastThrow to avoid this optimization. -- .()
    I cant make any head and tail out of this. There is absolutely nothing in stackTrace other than the above message. I could instantiate my other EJB models and they are working fine. I dont know why this one particular model is giving some problems...
    I tried reimporting/rebuilding/reload but in vain. My WS (which encapsulates EJB) is working fine.
    Please help!!!

    The compiler does not generate template instances that are already in libCstd, which is linked by default to programs. Instead of trying to force those instances into your shared library, you should build your library with a dependency on libCstd.
    Remember that no system libraries are referenced automatically when you create a shared library -- you have to mention them explicitly. Normally you want to link against libCstd, libCrun, libm and libc. Refer to the C++ User's Guide that comes with the compiler, the "Building Libraries" chapter.

  • Problem with Expilicit Instantiation using const

    Hello All,
    I have a global template function
    template <typename T> int getValue(T t);
    defined in file "a.h"
    I am trying to do explicit instantiation of this function in "b.h" like this:
    #include "a.h"
    struct B;
    template <> int getValue<const B&>(const B& t);
    where "B" is any Structure.
    Definition of above function is present in "b.C" as:
    template<> int getValue<const B&>(const B& t)
         return t.getIntValue();
    getIntValue() defined in Struct B returns int identifier of that object.
    On Compiling this code using Forte Compiler 5.3 update 2 i am getting following Errors.
    >>
    /opt/SUNWspro/bin/../WS6U2/bin/CC -g -c -o output/main.o
    main.C
    main.C:
    *** Error code 1
    "b.h", line 3: Error: No match found to do explicit
    instantation of type int(const B&).
    1 Error(s) detected.
    dmake: Fatal error: Command failed for target `output/main.o'
    <<
    Can anybody tell me what can be the problem. One thing to note is that same code use to compile using Forte 5.3 update 1.
    Also if I remove const declaration in explicit instantiation the code compiles.
    Please respond ASAP.
    Best Regards,
    Sanyam

    The compiler does not generate template instances that are already in libCstd, which is linked by default to programs. Instead of trying to force those instances into your shared library, you should build your library with a dependency on libCstd.
    Remember that no system libraries are referenced automatically when you create a shared library -- you have to mention them explicitly. Normally you want to link against libCstd, libCrun, libm and libc. Refer to the C++ User's Guide that comes with the compiler, the "Building Libraries" chapter.

  • Problem Accessing Instantiated Objects

    I'm sorry for the long code that follows. Am hoping that someone can point out some ideas for how to structure this properly. Following my instructor's cookie requirements, the first panel two user inputed balances and an interest rate. Two objects are instantiated, one for each balance, in a seperate class. The results of 12 months of savings are then displayed in the 2nd panel. There is then the required option to change the interest rate. When modified, it should show the new interests and balances for the original balances instead.
    I successfully got the first set of interests and new balances, and thought, "sweet! I'm home free now!"
    Because God himself hates me, this is of course not the case. It's not recognizing the objects in the second event, which is modifying the interest rate.
    I'm not sure how I can restructure this so that the objects which are instantiated using user input can be accessible by both events. If anybody can suffer through looking at all this junk and has some ideas (or even just some general advice on how to manipulate objects), I'd appreciate it.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.text.DecimalFormat;
    public class SavingsTest extends JFrame
        private JLabel balanceLabel, dollaSign, balanceLabel2, dollaSign2, percentSign, rateLabel;
        private JTextField balanceField, balanceField2, rateField;
        private JTextArea displayArea;
        private JButton submitButton, modifyButton;
        private String cBalance1S, cBalance2S, intRateS;
        private double cBalance1, cBalance2, intRate, oldBalance1, oldBalance2;
        // Constructor creates frame
        public SavingsTest ()
            super( "Savings Calculator" );
            Container container = getContentPane();
            JPanel mainPanel = new JPanel();
            mainPanel.setLayout(new FlowLayout());
            mainPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));   
    *          INPUT PANEL        *
            JPanel inputPanel = new JPanel();
            inputPanel.setLayout(null);        
            inputPanel.setPreferredSize(new Dimension(500,250));         
      //      inputPanel.setBackground(Color.white);       
            inputPanel.setBorder(BorderFactory.createCompoundBorder(
                          BorderFactory.createTitledBorder("Enter Data"),
                          BorderFactory.createEmptyBorder(5,5,5,5)));
            // Consumer 1 Balance Components
            balanceLabel = new JLabel ("Enter Customer 1 balance:"); 
            balanceLabel.setBounds(85,25,168,24);
            inputPanel.add(balanceLabel);
            dollaSign = new JLabel ("$ "); 
            dollaSign.setBounds(125,55,168,24);
            inputPanel.add(dollaSign);       
            balanceField = new JTextField(10);
            balanceField.setBounds(145,55,50,24);
            inputPanel.add(balanceField);
            // Consumer 2 Balance Components
            balanceLabel2 = new JLabel ("Enter Customer 2 balance:"); 
            balanceLabel2.setBounds(265,25,168,24);
            inputPanel.add(balanceLabel2);
            dollaSign2 = new JLabel ("$ "); 
            dollaSign2.setBounds(305,55,168,24);
            inputPanel.add(dollaSign2);       
            balanceField2 = new JTextField(10);
            balanceField2.setBounds(325,55,50,24);
            inputPanel.add(balanceField2);        
        // Interest Rate Components      
            rateLabel = new JLabel ("Enter annual rate :"); 
            rateLabel.setBounds(215,105,168,24);
            inputPanel.add(rateLabel);
            percentSign = new JLabel ("% "); 
            percentSign.setBounds(215,145,168,24);
            inputPanel.add(percentSign);       
            rateField = new JTextField(10);
            rateField.setBounds(235,145,50,24);
            inputPanel.add(rateField); 
         // Submit Button Component
            submitButton = new JButton("SUBMIT");
            submitButton.setBounds(215, 185, 80, 30);
            inputPanel.add(submitButton);
            mainPanel.add(inputPanel);             
    *          DISPLAY PANEL      *
            JPanel displayPanel = new JPanel();
            displayPanel.setLayout(null);        
            displayPanel.setPreferredSize(new Dimension(500,375));        
            displayPanel.setBorder(BorderFactory.createCompoundBorder(
                          BorderFactory.createTitledBorder("Monthly Interest & Balances"),
                          BorderFactory.createEmptyBorder(5,5,5,5)));
            // Modify Interest Rate Button Component
            modifyButton = new JButton("Modify Rate");
            modifyButton.setEnabled( false );       
            modifyButton.setBounds(215, 25, 80, 30);
            displayPanel.add(modifyButton);    
            // Display Area Component
            displayArea = new JTextArea(); 
            displayArea.setEditable(false);
            displayArea.setBounds(25,85,445,275);
            displayPanel.add(displayArea);          
            mainPanel.add(displayPanel);    
    *         MAIN PANEL           *
            container.add( mainPanel);      
            setSize(630, 700);
            setVisible( true );  
    *     SUBMIT BUTTON EVENT               *
    submitButton.addActionListener(
              new ActionListener()
         { // Open ActionListener
              public void actionPerformed (ActionEvent e)
                        getInput();
         } // Close ActionListener
    *          MODIFY BUTTON EVENT          *
    modifyButton.addActionListener(
              new ActionListener()
         { // Open ActionListener
              public void actionPerformed (ActionEvent e)
                        modifyInput();
         } // Close ActionListener
        }  // End Constructor
    public static void main ( String args[] )
          SavingsTest initiate = new SavingsTest();
          initiate.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
       private void getInput()
                // Get values from fields and assign to Strings
                cBalance1S = balanceField.getText();
                balanceField.setText("");
                cBalance2S = balanceField2.getText();
                balanceField2.setText("");
                intRateS = rateField.getText();
                rateField.setText("");
                // Parse Strings to doubles, etc
                cBalance1 = Double.parseDouble(cBalance1S);           
                cBalance2 = Double.parseDouble(cBalance2S);
                intRate = Double.parseDouble(intRateS);           
                intRate = intRate * .01;
                oldBalance1 = cBalance1;
                oldBalance2 = cBalance2;
                submitButton.setEnabled( false );
                modifyButton.setEnabled( true );
                SavingsAccount account1 = new SavingsAccount(cBalance1, intRate);
                SavingsAccount account2 = new SavingsAccount(cBalance2, intRate);              
                displayArea.append("\t         Account 1\t\t         Account 2\n");
                displayArea.append("\tInterest\tBalance\tInterest\tBalance\n");
                DecimalFormat twoDigits = new DecimalFormat( "0.00");
                // Calculate Interests & Balances, then display
                for (int i = 1; i <13; i++)
                    double interest1 = account1.calculateMonthlyInterest ();
                    double interest2 = account2.calculateMonthlyInterest ();
                    double newBalance1 = account1.calculateNewBalance(interest1);
                    double newBalance2 = account2.calculateNewBalance(interest2);
                    displayArea.append("Month " + i + ":\t" + twoDigits.format(interest1)
                    + "\t" + twoDigits.format(newBalance1) + "\t" +
                    twoDigits.format(interest2) + "\t" + twoDigits.format(newBalance2)
                    + "\n");
       private void modifyInput()
         intRateS = JOptionPane.showInputDialog(" Enter new annual rate: ");       
            intRate = Double.parseDouble(intRateS);
            SavingsAccount.modifyInterestRate(intRate);
            displayArea.setText("");
                displayArea.append("\t         Account 1\t\t         Account 2\n");
                displayArea.append("\tInterest\tBalance\tInterest\tBalance\n");
                DecimalFormat twoDigits = new DecimalFormat( "0.00");
                // Calculate Interests & Balances, then display
                for (int i = 1; i <13; i++)
                    // ERROR IS HERE WHERE IT DOES NOT RECOGNIZE THE OBJECTS
                    double interest1 = account1.calculateMonthlyInterest ();
                    double interest2 = account2.calculateMonthlyInterest ();
                    double newBalance1 = account1.calculateNewBalance(interest1);
                    double newBalance2 = account2.calculateNewBalance(interest2);
                    displayArea.append("Month " + i + ":\t" + twoDigits.format(interest1)
                    + "\t" + twoDigits.format(newBalance1) + "\t" +
                    twoDigits.format(interest2) + "\t" + twoDigits.format(newBalance2)
                    + "\n");
     

    I believe I did indeed state was not being recognized.I didn't see it. But then, I didn't read all your code either. That's not me (or paul) being an asshole--it's just too much code.
    Besides in the content of my post, if I were a
    gambling woman, I'd wager it's probably within that
    code which you went through so much trouble to make
    sure everybody knows you aren't reading. He wasn't doing that for anybody's benefit but your own. That is a lot of code to read. Pasting in the exact error message the compiler gave you would have made it a lot easier for someone to help you. Yawmark waas very kind, but in general, if you want help here, you should post details about what the problem is. "Not recognizing objects" means next to nothing, but the actual error message tells us a lot. In fact, you should take a stab at reading it yourself. Error messages are your friends. They tell you pretty precisely what was wrong and where.
    It says
    exactly where the objects are unrecognizable. It's
    even in big, red, pretty letters.The compiler gave you a lot more detail than that. You didn't indicate which objects.
    But why make posts which make coherent sense when you
    could just make an ass of yourself without all that
    silly reading.Paul's comments were intended to goad you into posting something that would make it easier for people to help you.
    >
    For example, complaining that there's too much code
    (having seen only half the code at that), It doesn't matter if that was only 0.001% of your code. It's too much to post here for that problem. It's understandable that you wouldn't know that, as you're new here, but copping an attitude instead of accepting the constructive criticism doesn't really accomplish anything.
    The only thing lending itself to the idea that God
    hates me is the fact that he let some idiot such as
    yourself wonder into this thread. There are some
    brilliant, wonderful, kind, and very helpful people on
    these forums to which I am eternally grateful. Then I
    guess there's also you.Actually, paulcw helps a lot of people here. Like most of us, he gets annoyed sometimes at poorly constructed questions.
    I hope that you won't take the above as a personal attack. It's not intended that way. It's intended to be constructive criticism.

  • Problem with instantiating array

    Hi, so my problem is 2 fold :)
    First off, here are my constructors:
    public class ArrayBag implements BagADT<Object> {
        public Object[] bag;
        private int bagSize = size();
        public ArrayBag() {
            bag = new Object[100];
        public ArrayBag(int c) {
            if (c >= 0) {
                bag = new Object[c];
        }For some reason, netbeans doesnt recognize that the bag has been instantiated unless i change it to Object arrayBag[] = new Object[100] all on the same line.. I wrote a tester program which so far consists of arrayBag(100); and yeah...i get a null pointer error which poitns at the following method:
    public int size() {
            int count = 0;
            while (count < bag.length && bag[count] != null) {
                count++;
            }//end while
            return count;
        } The error directly points at the line containing the while statment...But if i DO change the instantiation to a single line, then this error doesnt happen. Im sure that these errors are interconnected with one and other...just unsure how to fix them.
    Thanks!
    Paul
    Edited by: Toadums on Jan 20, 2009 6:07 PM

    ah of course! Thanks!
    I do have another question though.
    So what my teacher did...he sent the part of the code which he wrote as a class file...we had to import it into the library and all that jazz...when i try to run my program i get some lines of errors:
    Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object;
            at MemoryGame.init(MemoryGame.java:128)
            at MemoryGame.<init>(MemoryGame.java:57)
            at MemoryGame.main(MemoryGame.java:47)
    Java Result: 1like that....and im just wondering, since i cant look at the code that he gave us...how am i supposed to test, cause im not sure where the error is O.o

  • Problem instantiating COM+ object

    Hi,
    I'm trying to instantiate a com+ object using
    <cfobject> and I'm getting:
    An exception occurred when instantiating a Com object
    The cause of this exception was that: AutomationException:
    0x80070002
    The com object is built in c# .net and implements the
    iDispatch interface. We're running mx 7, and using the following
    syntax to instantiate the object:
    <cfobject type = "com" action = "create" class =
    "COMService" name = "myCOMService" context = "local" />
    Can anyone suggest any pointers?
    Thanks,

    Turns out it was a problem with the COM+ component. Googling
    the specific error code 0x80070002 helped to uncover the
    problem.

Maybe you are looking for

  • My background color for all pages has changed to pink, how do I get it back to white?

    The background color in all of my screens has switched to pink. How do I get it back to white? I wonder if it changed when I was shopping in a web site and had clicked on a pink watch(?)

  • HP Photosmart c7280 All-in-One Mac 10.7.1 (Lion) the "Two-Sided​" option is grayed and cannot use?

    I have a HP Photosmart c7280 All-in-One printer and a Macbook Air that runs the Lion operating system (10.7.1).  I am trying and needing to print via the "Two-sided" option that appears under the "Layout" pull down tab option, however, the "Two-Sided

  • How to change the schema to another user ?

    Hi, I've registerd this schema and it works well, but I need to change the schema to connect to another User like MYUSER_2. because I have to migrate the MYUSER_1 to MYUSER_2 and then to delete MYUSER_1 when I register the schema again with this user

  • JVM on WinCE 3.0?

    Hi, Can anybody please urgently tell me whether JVM for Win CE 3.0 for personal PC available. If yes then where can i get more information on this. And if no then please tell me can I write Java Apllications on WinCE 3.0 and using which JVM? Thanx ve

  • Look up and V lookup

    Hi Gurus, What is Lookup.At which instances is it used?Do we have any Look up in BW?could any one help me with the info pls?? With Thanks, Ravi