Casting error

Hi, I'm new to Java. Pls help.
double firstValue=1.1;
String secondValue;
secondValue=(String) firstValue;
I have error compiling this. Can anyone pls tell me how to cast a double to a String? Can I do that?

double firstValue = 1.1;
String secondValue = new String( firstValue.toString()
);I should probably read my own posts every now and again, this will not work, you are using a primitive, to do the above you would have to use a Double object:
Double firstValue = new Double( 1.1 );
String secondValue = new String( firstValue.toString() );
Sorry for any confusion.
Patrick

Similar Messages

  • Cast error in java sound

    Hey, i got a little run-time error:
    Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: com.sun.media.sound.PortMixer$PortMixerPort
    the code segment it occurs at is here:
    case 0:
          targetDataLine1 = (TargetDataLine)mixer1.getLine(targetInfo);
          targetDataLine2 = targetDataLine1;
    }Some background info: I used getTargetLines() method of Mixer to obtain an arraylist of all the Line.Info objects (for targetLines) in a mixer, then I passed this into a GUI class, and made a vector to display in combo box. once user selects an item, it casts it back into Line.Info, and calls the mixer's "getLine()" method to retrieve the line. But I get the cast error. I know you can cast from Line to TargetDataLine (since TargetDataLine is a subinterface of Line) -- and I saw it on a tutorial, so I don't know what's wrong. Any help?
    If you need more info, just tell me.

    But still, the tutorial I looked at
    (http://java.sun.com/j2se/1.5.0/docs/guide/sound/progr
    ammer_guide/chapter3.html#113154)
    still showed it down-casting from a Line object to a
    TargetDataLine object.
    You need to understand the difference between a reference and an object. The object itself was a TargetDataLine object, otherwise the cast wouldn't have worked. The reference to it was of type Line.
    // obj is a reference of type Object. The object it points to is a String:
    Object obj = "I am a String";
    // Which explains why this works:
    String s = (String)obj;
    // and why this fails:
    Integer i = (Integer)obj;
    Not to mention, the java API says that the
    getLine(Line.Info) object returns an object of type
    Line.
    And I still don't understand why you can't cast from
    a superclass to a subclass. I know intuitively, it
    makes since, since not all RECTANGLES are SQAURES,
    but all SQUARES are RECTANGLES. But still, I know
    enough programming to remember numerous instances of
    casting Object as other classes....
    See above.
    Oh, and what does the $ symbol in
    com.sun.media.sound.PortMixer$PortMixerPort mean?It means that the the class PortMixerPort is an inner class (or nested class, I never remember the difference :-) in the class PortMixer.

  • Field symbols - casting error

    Hi,
       I created a table dynamically and assigned it to field symbol. Now i want to write the contents of the internal table to a flat file in app server. Here is what i am doing.
    parameters: p_table(30) type c default 'PA0008',
                p_file LIKE RLGRAP-FILENAME default '/usr/sap/tmp/test.txt'.         " Path to save files to
    FIELD-SYMBOLS: <w_table> type standard table,
                   <w_wa>   TYPE any,
                   <w_field> type any.
    DATA: w_dyn_wa type ref to data,
          w_dyn_table type ref to data.
    CREATE DATA w_dyn_wa TYPE (p_table). "Suitable work area
    ASSIGN w_dyn_wa->* TO <w_wa>.
    create data w_dyn_table type standard table of (p_table).
    assign w_dyn_table->* to <w_table>.
    data w_dyn_data(5000) type c.
    SELECT * FROM (p_table) INTO table <w_table> where endda >= sy-datum.
    Data: w_temp type string.
    OPEN DATASET p_file FOR OUTPUT IN TEXT MODE encoding default.
    IF SY-SUBRC = 0.
      loop at <w_table> into <w_wa>.
      w_temp = ''.
        do.
          assign component sy-index of structure <w_wa> to <w_field>.
          if sy-subrc <> 0.
            exit.
          endif.
          concatenate w_temp <w_field> into w_temp respecting blanks.
          if sy-index = 1.
            transfer '' to p_file.
          endif.
         transfer <w_field> to p_file no end of line.
        enddo.
       transfer w_temp to p_file no end of line.
       write:/ w_temp.
      endloop.
    endif.
    close dataset p_file.
    when i run the program with PA0008 i am getting a casting error "Object not char like". How do i get rid of this error?. I tried moving the contents of field symbol to a string and appending it. It worked, but i lost the exact formatting of data in the file. In other words, it got rid of extra blanks. I need exact structure of internal table in the file.
    Thanks,
    Sandeep
    Thanks,
    Sandeep

    Hi
    Have u tried to use MOVE statament instead of CONCATENATE?
    do.
    assign component sy-index of structure <w_wa> to <w_field>.
    if sy-subrc <> 0.
    exit.
    endif.
    DESCRIBE FIELD <W_FIELD> LENGTH V_LEN.
    MOVE <W_FIELD> TO w_temp+V_OFFSET(V_LEN).
    V_OFFSERT = V_OFFSET + V_LEN.
    Max

  • Why alert casting error when module url changed?

    Hi, everyone.
    I occurred a stranger error when click the item in DataGrid
    which is redirected by "ModuleLoader" url.
    Error #1034: Cast Error:Cannot cast
    mx.managers::DragManagerImpl@482f971 to
    mx.managers.IDragManager。
    at mx.managers::DragManager$/get
    impl()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\DragManager.as:152]
    at mx.managers::DragManager$/get
    isDragging()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\DragManager.as:18 7]
    at
    mx.controls.listClasses::ListBase/dragScroll()[E:\dev\3.0.x\frameworks\projects\framework \src\mx\controls\listClasses\ListBase.as:7148]
    at Function/
    http://adobe.com/AS3/2006/builtin::apply()
    at <anonymous>()
    at SetIntervalTimer/onTimer()
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()
    Actually I never modify about DragManagerImpl...
    In my main.mxml there is a
    <mx:ModuleLoader id="module"
    url="modules/DeviceRegisterSelectWizardModule.swf"/>
    this ModuleLoader control is to load a new swf module when
    change the url.
    Althought the first loaded module which included DataGrid is
    OK, it popup the error when this module is the second time switched
    by the url...
    The error is the above when click the item in it.
    Actually all cast operation is error as I tried:
    And is there any solution for it? ModuleLoader has such a
    bug?
    Thank you very much.

    Hi,
    Another way to "find" the URL for the oamconsole, that I use if I'm not familiar with the configuration I'm working on is to first log into the Adminserver WL Console, then go to "Deployments".
    Then, find "oamconsole" in the Deployments listed (on the right).
    Click on that, then on the next page, look for the "Testing" tab. Click on the "Testing" tab, which which show the /oamconsole app.
    Click on the "+" to expand the tree, and you should see a bunch of different URLs on the right, e.g., if you have OAM console deployed to managed servers, etc., there'll be different URLs for those, etc., and you can just click on the links to open up OAM Console in your browser.
    Jim

  • Cast error in upgrading R12 from 11i

    Hi,
    We are upgrading Oracle R12 from 11i.
    In iExpnese-- DetailsCO I am getting the error i.e.- oracle.apps.fnd.framework.webui.beans.message.OAMessageChoiceBean cannot be cast to oracle.apps.fnd.framework.webui.beans.message.OAMessageLovInputBean..when selecting a value from custom DFF enabled in DetailsPG.
    This DFF is also enabled in 11i and this code is running perfectly in 11i. I want to know is there any changes in the functionality of R12 for this error?
    Your help is highly appreciated.
    Please reply.
    Thanks
    Vikram

    Class Cast Exception should come the moment you page loads. Can you please confirm exactly when you get exception.
    Regards
    Shobhit S

  • Cast error trying to access tree binding

    JDeveloper version 11.1.2.1.0
    java.util.ArrayList cannot be cast to oracle.jbo.uicli.binding.JUCtrlHierBinding
    Hi All
    I'm using code from ADF Code Corner (http://www.oracle.com/technetwork/developer-tools/adf/learnmore/78-man-expanding-trees-treetables-354775.pdf) to try and programmatically set the tree node disclosure level when the page is initially rendered. The tree's DisclosedRowKeys property is set to #{viewScope.FieldPickerHandler.newDisclosedTreeKeys}. The code for the handler method that's causing the problem is below. First you can see that I have commented out Frank's original code on lines 5, 6 & 8 because for some reason this did not find the tree component (always returned null). So instead I have set the tree component's Binding property to #{viewScope.FieldPickerHandler.jsfTree} to make the component instance available in the handler and this seems to work. However when the code hits line 16 I get the class cast exception at the head of this post.
    One significant variation from the Code Corner example is that my tree is based on a POJO model that is populated programmatically from a VO (as posted by Lucas Jellema http://technology.amis.nl/blog/2116/much-faster-adf-faces-tree-using-a-pojo-as-cache-based-on-read-only-view-object-showing-proper-leaf-nodes-again) hence my root node set, and each node's child set, is declared as "List<FieldPickerNode> nodes = new ArrayList<FieldPickerNode>();".
    Does the way the POJO tree is constructed make it incompatible with the Code Corner node expansion approach? Can anyone suggest how I can modify my handler bean code to work with the POJO tree?
    Thanks
    Adrian
    PS The tree's Value property is set to #{viewScope.FieldPickerHandler.treemodel} where treemodel is a managed property of the bean - I guess this mean my tree is not ADF-bound?
    1 public RowKeySetImpl getNewDisclosedTreeKeys() {
    2 if (newDisclosedTreeKeys == null) {
    3 newDisclosedTreeKeys = new RowKeySetImpl();
    4
    5// FacesContext fctx = FacesContext.getCurrentInstance();
    6// UIViewRoot root = fctx.getViewRoot();
    7 //lookup thetree component by its component ID
    8// RichTree tree = (RichTree)root.findComponent("t1");
    9 //if tree is found ....
    10 if (jsfTree != null) {
    11 //get the collection model to access the ADF binding layer for
    12 //the tree binding used. Note that for this sample the bindings
    13 //used by the tree is different from the binding used for the tree
    14 //table
    15 CollectionModel model = (CollectionModel)jsfTree.getValue();
    16 JUCtrlHierBinding treeBinding = (JUCtrlHierBinding)model.getWrappedData();
    Edited by: blackadr on 03-Nov-2011 17:56

    Hello Frank et al
    Still struggling valiantly to create a POJO tree that uses the ADF binding layer. Rather than referencing the treemodel directly from the component I have now added a method to my model class that returns the set of root nodes as an ArrayList:
    public List<FieldPickerNode> getRootNodes() {
    if (treemodel == null) {
    treemodel = initializeTreeModel();
    return rootNodes;
    and my FieldPickerNode class also now has a method to return its children as an ArrayList. The model class is managed in view scope. So I drag the rootNodes collection from the Data Controls panel into my panel collection and get the option to create it as an ADF tree. Great. I add the method to get the children as an accessor and the bindings end up looking like this:
    <iterator Binds="root" RangeSize="25" DataControl="FieldPickerModel" id="FieldPickerModelIterator"/>
    <accessorIterator MasterBinding="FieldPickerModelIterator" Binds="rootNodes" RangeSize="25"
    DataControl="FieldPickerModel" BeanClass="view.picker.FieldPickerNode" id="rootNodesIterator"/>
    <tree IterBinding="rootNodesIterator" id="rootNodes">
    <nodeDefinition DefName="view.picker.FieldPickerNode" Name="rootNodes0">
    <AttrNames>
    <Item Value="nodeID"/>
    </AttrNames>
    <Accessors>
    <Item Value="children"/>
    </Accessors>
    </nodeDefinition>
    </tree>
    The tree component looks like this:
    <af:tree value="#{bindings.rootNodes.treeModel}" var="node"
    selectionListener="#{bindings.rootNodes.treeModel.makeCurrent}"
    rowSelection="single" id="t1">
    <f:facet name="nodeStamp">
    <af:outputText value="#{node}" id="ot1"/>
    </f:facet>
    </af:tree>
    To my untrained eye this all seems to look ok but when I run the page I get two null pointer errors in the browser and a couple thousand lines of repeated stack in the log viewer. In the early stages of the log there's a message "<BeanHandler> <getStructure> Failed to build StructureDefinition for : view.picker.FieldPickerModel" which I feel can't be good but is in the depths of the framework so difficult for me to debug (am in the process of requesting the ADF source). I've shown the message below with a few lines of context either side.
    Can you think of any other lines of enquiry I can follow to progress this? For example are there other attributes or methods that I need to add to my tree model classes in order to support the ADF binding?
    For background, the reason I started pursuing the POJO tree in the first place was because for large hierarchies the VO driven tree is unacceptably slow given that it fires SQL for each individual node disclosure. Linking the tree model directly to the component demonstrates just how quick the POJO approach is but I would like to have it go through the ADF bindings so I have more scope to customise the tree behaviour.
    Any pointers or help you (or anyone) can give would be very much appreciated.
    Adrian
    <ADFLogger> <end> Refreshing binding container
    <DCExecutableBinding> <refreshIfNeeded> [40] DCExecutableBinding.refreshIfNeeded(338) Invoke refresh for :rootNodesIterator
    <DCIteratorBinding> <refresh> [41] DCIteratorBinding.refresh(4438) Executing and syncing on IteratorBinding.refresh from :rootNodesIterator
    <ADFLogger> <begin> Instantiate Data Control
    <BeanHandler> <getStructure> Failed to build StructureDefinition for : view.picker.FieldPickerModel
    <MOMParserMDS> <parse> [42] MOMParserMDS.parse(226) No XML file /view/picker/picker.xml for metaobject view.picker.picker
    <MOMParserMDS> <parse> [43] MOMParserMDS.parse(228) MDS error (MetadataNotFoundException): MDS-00013: no metadata found for metadata object "/view/picker/picker.xml"
    <DefinitionManager> <loadParent> [44] DefinitionManager.loadParent(1508) Cannot Load parent Package : view.picker.picker
    <DefinitionManager> <loadParent> [45] DefinitionManager.loadParent(1509) Business Object Browsing may be unavailable

  • ABAP Objects Casting error

    Hi,
    I have declared two classes with names, ZCL_ONE, ZCL_TWO.
    ZCL_TWO is inhering ZCL_ONE.
    Now i am using them in the se38 program.
    While i use it, Narrow casting is working fine, But widening casting is not working.
    It is throwing an exception or a dump if i do not catch an exception.
    <i>Code:</i>
    DATA: OBJ1 TYPE REF TO ZCL_ONE,
               OBJ2 TYPE REF TO ZCL_TWO.
    CREATE OBJECT OBJ1.
    OBJ2 ?= OBJ1.
    The above code is giving me dump. Any guesses about how to solve it.
    I am able to work with the Narrow casting.. which is below code.. It is working fine.
    DATA: OBJ1 TYPE REF TO ZCL_ONE,
              OBJ2 TYPE REF TO ZCL_TWO.
    CREATE OBJECT OBJ2.
    OBJ1 = OBJ2.
    How to resolve the error.
    Thanks in Advance.

    obj1 should be the super(inherited) class of obj2....while using widening cast....
    example:
    INTERFACE i1.
      DATA a1 TYPE ...
    ENDINTERFACE.
    INTERFACE i2.
      INTERFACES i1.
      ALIASES a1 FOR i1~a1.
      DATA a2 TYPE ...
    ENDINTERFACE.
    CLASS c1 DEFINITION.
      PUBLIC SECTION.
        INTERFACES i2.
    ENDCLASS.
    CLASS c2 DEFINITION INHERITING FROM c1.
      PUBLIC SECTION.
        METHODS m1.
    ENDCLASS.
    DATA: iref TYPE REF TO i2,
          cref TYPE REF TO c1.
    CREATE OBJECT iref TYPE c2.
    ... iref->a1 ...
    ... iref->a2 ...
    TRY.
      cref ?= iref.
      CALL METHOD cref->('M1').
      CATCH cx_sy_move_cast_error
            cx_sy_dyn_call_illegal_method.
    ENDTRY.
    Message was edited by:
            Muthurajan Ramkumar

  • TYPE CASTING ERROR

    HI GURU's
    I AM REQUIRED TO GENERATE USER ID AUTOMATICALLY STARTING FROM 0001, 0002, 0003 AND GOES ON INCREMENTING BY 1.
    - I MADE USER ID FIELD OPTIONAL.
    - THEN I CREATED AN ENTITY ADAPTER TO TRIGGER AT PRE INSERT EVENT, TAKING INITIAL VALUE AS 0000 IN A INTEGER VARIABLE.
    - THEN OTHER VARIABLE STORES THE INCREMENTED VALUE OF INITIAL VALUE (INT ADD METHOD).
    - THEN I MAPPED THE ADAPTER RETURN VARIABLE WITH THE ENTITY VALUE USER ID OF USER FORM.
    WHEN I TRY TO CREATE USER IT SAY ERROR IN TYPE CASTING, OBVIOUSLY IT SHOULD SHOW BECAUSE I AM MAPPING INTEGER RETURN VARIABLE WITH THE STRING TYPE USER ID.
    KINDLY SHOW ME THE WAY TO ACHIEVE THIS.
    THANKS A LOT.

    Have you tried searching this on Google.
    See this link:
    http://www.javadb.com/convert-an-int-value-to-string
    In your Entity Adapter code, write few more lines from the method in the above link.
    THEN I CREATED AN ENTITY ADAPTER TO TRIGGER AT PRE INSERT EVENT, TAKING INITIAL VALUE AS 0000 IN A INTEGER VARIABLE.
    - THEN OTHER VARIABLE STORES THE INCREMENTED VALUE OF INITIAL VALUE (INT ADD METHOD).
    - THEN I MAPPED THE ADAPTER RETURN VARIABLE WITH THE ENTITY VALUE USER ID OF USER FORM.

  • Reschedule Excel or PDF instance fails with CAST error in CRS 2008

    Rescheduling an Excel or PDF Instance in Crystal Reports Server 2008 gives error message when trying to set parameters.  "An error has occurred:Unable to cast object of type 'CrystalDecisions.Enterprise.Desktop.Pdf' to type 'BusinessObjects.Enterprise.Desktop.Publication'. "
    Previously this used to give a $Proxy5 message. 
    I have installed SP2 and now it does this. 
    It works in the Java InfoView - but not in the .Net Infoview. 
    Any suggestions (other than using Java Infoview that is) ...

    Hi,
    this morning reading note (metalink and other) about CSS Timeout misscount ,and the impact on dbca ... i have changed the value from 60 to 360 ... byt the problem is not resolved!!
    i wait for news ......
    i beginning to think next to some particular bug, data also the ORA-600... with argumet not identified (today) from Oracle.
    bye,
    Luca Acri

  • Adf web service run time cast error

    When I run the web service using the test client, I get the following error after entering the parameter and invoke
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault><faultcode>env:Server</faultcode><faultstring>app1.model.common.UiSDOImpl cannot be cast to app1.model.common.uiSDO</faultstring></env:Fault></env:Body></env:Envelope>
    What I can do to fix this please?

    Hi,
    given 11.1.1.3 this an old version of JDeveloper, can you create a simple testcase using a newer build e.g. 1.1.1.6 or 11.1.17? This prevents chasing down old issues.
    Frank

  • Expression Builder - Anydata Cast Error - Encountered the symbol "("

    Hello
    I am using OWB 11 with Oracle 11 and am hitting an error on something I would think is super simple in expression builder!
    So I been reading around the forums and havent been able to figure out what is going on with my transformation
    I drag and dropped the transformation "Anydata Cast" onto my mapping
    I select the target type as "VARCHAR" for casting
    I drag and drop the source column and drop it over the auto generated "CAST_SOURCE" from INGRP1
    I then drag CAST_TARGET from the OUTGRP1 to my target
    I right click the ANYDATA_CAST transformation and click on "Output Attributes" and click on the "..." to open the expression builder
    Then I input the following code
    CAST( INGRP1.CAST_SOURCE AS VARCHAR(10))
    And hit validate
    I then hit the following error
    Line 1, Col 40:
    PLS-00103: Encountered the symbol "(" when expecting one of the following:
    Am I missing something in my code??
    I know this is really simple, but I really cant find what I am doing wrong??
    Thanks in advance

    Hello
    I am using OWB 11 with Oracle 11 and am hitting an error on something I would think is super simple in expression builder!
    So I been reading around the forums and havent been able to figure out what is going on with my transformation
    I drag and dropped the transformation "Anydata Cast" onto my mapping
    I select the target type as "VARCHAR" for casting
    I drag and drop the source column and drop it over the auto generated "CAST_SOURCE" from INGRP1
    I then drag CAST_TARGET from the OUTGRP1 to my target
    I right click the ANYDATA_CAST transformation and click on "Output Attributes" and click on the "..." to open the expression builder
    Then I input the following code
    CAST( INGRP1.CAST_SOURCE AS VARCHAR(10))
    And hit validate
    I then hit the following error
    Line 1, Col 40:
    PLS-00103: Encountered the symbol "(" when expecting one of the following:
    Am I missing something in my code??
    I know this is really simple, but I really cant find what I am doing wrong??
    Thanks in advance

  • Cast error message when discovering ref cursor parameter from stored proced

    We are today using Microsoft's Oracle provider with some code from the old Data Application Block (from MSDN) to discover parameters from the stored procedures. This code uses the OracleCommandBuilder.DeriveParameters to get the parameters from the stored procedure and command.Parameters.CopyTo copies the discovered parameters into the command object.
    If I test with a simple function returning a ref cursor I get one parameter with type refCursor and ParameterDirection.OutPut. This is working fine as long we where using Microsoft's Oracle provider. But using Oracle ODP .NET I get the following error message on datadapter.Fill (I fill a dataset with the result from the reference cursor)
    Unable to cast object of Type 'Oracle.DataAccess.Client.OracleDataReader' to type 'Oracle.DataAccess.Types.OracleRefCursor.
    If I create a ref parameter manualy like this:
    OracleParameter myrefCursor = new OracleParameter();
    myrefCursor .OracleDbType = OracleDbType.RefCursor;
    myrefCursor .ParameterName = "myParameterName";
    myrefCursor .Direction = ParameterDirection.ReturnValue;
    and add it to the command object this is working OK. So it seems to be a problem with discovering ref cursor parameters from the database, other parameter types is OK.. I have compared the properties of my manual ref cursor parameter with the one discovered from the stored procedure, but I cannot see any difference. (I see the Value property has some values for the discovered one, but I have set this to DBNull.Value without any result)
    Any ideas why I get this error code? Is there any other code blocks I can use to discover the parameters? We send in params object[] with the different values into the helper class and the value is added to the parameter. (Se I don't need to set the data type etc for each parameter, I just need to have the correct order of the parameters)

    For accuracy's sake, just wanted to let everyone know that this is actually a bug. The correct bug number is 8423178.
    Christian
    Mark_Williams wrote:
    Just to follow-up on this issue...
    The bug has been closed as "not a bug" as it seems undocumented behavior was relied upon for this to work in earlier releases.
    Note from the documentation on DeriveParameters:
    "The output values of derived parameters return as .NET Types by default. To obtain output parameters as provider types, the OracleDbType property of the parameter must be set explicitly by the application to override this default behavior. One quick way to do this is to set the OracleDbType to itself for all output parameters that should be returned as provider types." (emphasis added)
    The issue, as you might already know, is that there is no corresponding .NET Framework Type for an Oracle Ref Cursor and the type is, therefore, set to Object. So, explicitly setting the type to OracleDbType.RefCursor should work.
    Regards,
    Mark

  • Extended a class, getting a class cast error

    Hi all,
    I'm writing a program that uses a closed-source jar in its library (with permission, of course).
    One of the classes in that jar wasn't working as I wanted it to, so I extended the class and overwrote one of its methods. So, when using the class, instead of callingThirdPartyClass obj = new ThirdPartyClass();I could useMyThirdPartyClass obj = new MyThirdPartyClass();This seems to work, until a certain line of their code throws a class cast exception:
    java.lang.ClassCastException: org.thirdparty.ThirdPartyClass$2
         at org.thirdparty.Event.findTop(Event.java:279)
         at org.thirdparty.ThreadUtils$4.run(ThreadUtils.java:86
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
        ....Why does this occur? Surely, since MyThirdPartyClass is a child of ThirdPartyClass, anything that expects a ThirdPartyClass shouldn't have any problem, right? Or do I have that backwards? And if so, is there anything I can do to fix the problem?
    Thanks!
    Sam

    paulcw wrote:
    Specifically, the ThirdPartyClass itself was an extension of a JApplet. Since I wanted to use it directly in my code, I couldn't set the applet's parameters, so I overwrote the getParameters(String) method to return strings of my choosing.Your approach makes little sense to me. Applets follow a well-defined lifecycle. If you wanted to embed the applet into your own application, all you have to do is use the applet following its lifecycle (that is, instantiate it, set the context, invoke init and start and stop and destroy). Overriding anything should not be necessary.That's exactly what I want to do. However, the applet requires one parameter to be set (DefaultModel = some url) -- if this isn't set I can't run the applet. As far as I can tell (and I have an as-yet unanswered question in the Applets forum asking about this), there is no way to set the parameters in an Applet in any way besides putting in in the 'param' tag in the Applet code in the HTML.
    If I'm wrong about that, please let me know.
    On the assumption that I was right, I decided to extend the getParameters(String) method, so that it would return the desired String when asked. Naturally, to do this, I had to extend the entire class.
    This solved the problem of the program failing when it asked for the parameter, but then it failed when it checked the codebase. I overrode the getCodeBase() method, and the applet no longer had a problem there.
    Then I got the exceptions I got above.
    I'm fairly certain (but, naturally, not 100% certain of anything) that neither of my methods should have affected the inner-workings of LiteApplet -- I was overriding methods that were from Applet (and not overridden in LiteApplet, I checked) that are just supposed to pass back strings -- the same Strings that would be passed back if it were embedded in a web page -- and not affect the applet in any way.
    Naturally, I'm wrong about one or more of my assumptions above, but I just can't work out how overriding those two methods could have created the error that I'm getting.
    Sam
    PS: Here is the entire exception, if you think it could help. I was scrubbing it merely so as not to confuse matters and make my posts overly long. The last exception below gets repeated indefinitely.
    AutoConverter.runVisitor() failed: CREATE-SUN expected 2 inputs, a number and a command block (optional).
    java.lang.NullPointerException
         at org.nlogo.swing.OptionDialog.show(OptionDialog.java:36)
         at org.nlogo.window.GUIWorkspace$11.handleError(GUIWorkspace.java:1125)
         at org.nlogo.compiler.AutoConverter.convert(AutoConverter.java:161)
         at org.nlogo.window.ProceduresLite.handleLoadSectionEvent(ProceduresLite.java:44)
         at org.nlogo.event.LoadSectionEvent.beHandledBy(LoadSectionEvent.java:38)
         at org.nlogo.event.Event.doRaise(Event.java:215)
         at org.nlogo.event.Event.raise(Event.java:116)
         at org.nlogo.window.ModelLoader.loadHelper(ModelLoader.java:76)
         at org.nlogo.window.ModelLoader.load(ModelLoader.java:45)
         at org.nlogo.window.LiteApplet.go(LiteApplet.java:128)
         at org.nlogo.window.LiteApplet$1.run(LiteApplet.java:26)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    java.lang.ClassCastException: org.nlogo.window.CompilerManager
         at org.nlogo.event.Event.findTop(Event.java:279)
         at org.nlogo.event.Event.doRaise(Event.java:190)
         at org.nlogo.event.Event.raise(Event.java:116)
         at org.nlogo.window.CompilerManager.compileAll(CompilerManager.java:68)
         at org.nlogo.window.CompilerManager.handleLoadEndEvent(CompilerManager.java:61)
         at org.nlogo.event.LoadEndEvent.beHandledBy(LoadEndEvent.java:11)
         at org.nlogo.event.Event.doRaise(Event.java:215)
         at org.nlogo.event.Event.raise(Event.java:116)
         at org.nlogo.window.ModelLoader.loadHelper(ModelLoader.java:115)
         at org.nlogo.window.ModelLoader.load(ModelLoader.java:45)
         at org.nlogo.window.LiteApplet.go(LiteApplet.java:128)
         at org.nlogo.window.LiteApplet$1.run(LiteApplet.java:26)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    java.lang.ClassCastException: org.nlogo.window.LiteApplet$2
         at org.nlogo.event.Event.findTop(Event.java:279)
         at org.nlogo.event.Event.doRaise(Event.java:190)
         at org.nlogo.event.Event.raise(Event.java:116)
         at org.nlogo.window.GUIWorkspace$6.run(GUIWorkspace.java:660)
         at org.nlogo.window.ThreadUtils$2.run(ThreadUtils.java:37)
         at org.nlogo.window.ThreadUtils$4.run(ThreadUtils.java:86)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

  • Cisco Network Assistant cast error (vlan)

    Hello,
    As we have a new Catalyst 2960XS PoE in our network I upgraded the CNA 5.2 to version 5.7 (6) keeping my old configuration. Then I added the 2960XS and it is working fine. But now, when I try to configure any port's VLAN of one of our old switches (Catalyst 3508G-XL and both of our Catalyst 3548-XL) I am not able to do it anymore. It just shows the error this message :
    Error: Modify Port Mode com.cisco.cpnm.features.dsbu.c3500.vlan.C3500Vlan cannot be cast to com.cisco.features.dsbu.defn.vlan.CommonVlan

    Hello,
    We have the same error message with CNA 5.8(6) on Cisco Catalys 3548XL IOS 12.0(5)WC17.
    Error: Modify Port Mode com.cisco.cpnm.features.dsbu.c3500.vlan.C3500Vlan cannot be cast to com.cisco.features.dsbu.defn.vlan.CommonVlan
    Is there any workaround ?
    Thank you
    Regards,
    Marc

  • Application casting error

    I'm trying to set a class to centralized event handling. I'm
    using the model from the Flex 2 Beyond the Basis cd, but ran into a
    problem. I'm getting an error from a line of code I copied from the
    CD, but don't what to do, since the example on the CD runs without
    error. The line of code would appear simple, since it's just
    setting up a private variable in the class and casting
    Application.application to CentralEvents type. Here's the code from
    the skeleton of the class. Can anyone tell me what's wrong?
    package controller
    import mx.core.Application;
    import mx.controls.Alert;
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    public class FrontController
    private var app:CentralEvents = Application.application as
    CentralEvents;
    public function FrontController()
    }

    To be honest, I'm not exactly sure why the cast of the
    Application.application value. As I mentioned, I took the code from
    the Training CD. According to the narrator, he's setting up the app
    variable to be an instance of the current application. He later
    uses the app variable to set up addEventListeners inside the
    constructor method for the class. By having an instance of the
    application in the class the code was able to value bindable
    variables found in the main mxml form.
    The goal of the exercise was to set up the class to handle
    all event operations from a central class. It made sense to me and
    since I had the code from the examples I decided to try it.
    That said, when I look at the syntax of casting the type of
    the variable to CentralEvents, it looks OK
    Thanks for responding and if you have an good ideas please
    let me know.
    Tom

Maybe you are looking for

  • MacBook Pro Can't Find RV Park Router's IP Address

    I was using the RV park's wifi, which does not require a password.  Now my MBP won't connect because it can't find the router's IP address.  I used IP Scanner and found the IP address.  Is there some way I can "tell" my MBP what the IP address is?  I

  • Missing Movies

    When I purchase a movie from iTunes, it downloads to my iPad, but not my laptop. When I check 'purchased' on iTunes it comes up blank. However I am logged in with my Apple ID.

  • PIN Address in Microsoft Outlook

    I have recently received about 20 new PIN addresses and was hoping there was a method of adding PIN's into my Outlook Contacts, however I don't find this as a field I can add in my Outlook Contacts.  Do I have to resort to only inputting PIN addresse

  • InDesign CS3 Printing Issue

    I recently installed the CS3 Suite including InDesign, Flash, Dreamweaver, Photoshop, Illustrator, Acrobat, et al. I am not able to print anything from any of my CS3 apps. CS2 continues to perform just fine, and I've been forced to save down CS3 docs

  • I need to change my apple id, can I do this without losing all my info and purchases?

    I need to change my apple id, can I do this without losing all my info and purchases?