Shareable object interface cast problem

Hi,
I'm a student working on building a shareable object interface between two applets namely "EWallet" and "EPhone".
I currently use the javacard 2.2.X version and I mean to solve the shareable object interface in this version.
Thus not with servlets in 3.X.X.
The current problem I'm facing is the casting from the base type of shareable interface objects (Shareable) to the EWalletInterface which I need to do operations on the SIO of EWallet.
The code snippet of the EWallet applet (server)
public void verify(byte[] pincode) {
if ( pin.check(pincode, (short)0,(byte)(short)pincode.length) == false )
ISOException.throwIt(SW_VERIFICATION_FAILED);
public void debit(byte debitAmount) {
if (!pin.isValidated())
ISOException.throwIt(SW_PIN_VERIFICATION_REQUIRED);
// check debit amount
if ((debitAmount > MAX_TRANSACTION_AMOUNT) || (debitAmount < 0))
ISOException.throwIt(SW_INVALID_TRANSACTION_AMOUNT);
// check the new balance
if ((short)(balance - debitAmount) < (short)0)
ISOException.throwIt(SW_NEGATIVE_BALANCE);
balance = (short)(balance - debitAmount);
public Shareable getShareableInterfaceObject(AID client_aid, byte parameter){
byte[] ephone_aid_bytes = {(byte)0X15, (byte)0XEF, (byte)0X4D, (byte)0X55, (byte)0X86, (byte)0X60};
if(client_aid.equals(ephone_aid_bytes,(short)0,(byte)ephone_aid_bytes.length) == false)
return null;
if(parameter != (byte)0x01)
return null;
return this;
The code snippet of the EPhone applet (client)
//Helper method
private void makeBankcardDebit(short amount){
AID ewallet_aid = JCSystem.lookupAID(ewallet_aid_bytes,(short)0,(byte)ewallet_aid_bytes.length);
if(ewallet_aid == null)
ISOException.throwIt(SW_EWALLET_AID_NOT_EXIST);
//Error with casting from Shareable to EWalletInterface
EWalletInterface sio = (EWalletInterface)(JCSystem.getAppletShareableInterfaceObject(ewallet_aid, (byte)0x01));
if(sio == null)
ISOException.throwIt(SW_FAILED_TO_OBTAIN_SIO);
byte[] pin = new byte[4];
sio.verify(pin);
sio.debit((byte)amount);
this.balance = (short)(this.balance + amount);
The EWalletInterface code snippet
public interface EWalletInterface extends Shareable {
public void verify(byte[] pincode);
public void debit(byte amount);
The interface is currently both in the EWallet and EPhone packages.
The problem i'm facing is that in the code snippet of EPhone.
The "lookupAID"- and "getAppletShareableInterfaceObject"-methods work
The casting from Shareable to EWalletInterface gives me status word 0x6F00 which presents me with a google explanation of "No precise diagnosis".
Does anyone have an idea why the cast from Shareable to EWalletInterface doesn't work?
Thanks in advance,
Jeroen

Hi,
What happens if you get the SOI reference and store in a Shareable and see if it is null? Just to confirm, the two applets are in different packages and the server applet has be installed and is selectable?
If you get 0x6F00, you should start adding try/catch blocks to find the root cause.
Cheers,
Shane
=================================
Reposting with &#123;code} tags
=================================
Hi,
I'm a student working on building a shareable object interface between two applets namely "EWallet" and "EPhone".
I currently use the javacard 2.2.X version and I mean to solve the shareable object interface in this version.
Thus not with servlets in 3.X.X.
The current problem I'm facing is the casting from the base type of shareable interface objects (Shareable) to the EWalletInterface which I need to do operations on the SIO of EWallet.
The code snippet of the EWallet applet (server)
    public void verify(byte[] pincode) {
        if ( pin.check(pincode, (short)0,(byte)(short)pincode.length) == false )
            ISOException.throwIt(SW_VERIFICATION_FAILED);
    public void debit(byte debitAmount) {
        if (!pin.isValidated())
            ISOException.throwIt(SW_PIN_VERIFICATION_REQUIRED);
        // check debit amount
        if ((debitAmount > MAX_TRANSACTION_AMOUNT) || (debitAmount < 0))
           ISOException.throwIt(SW_INVALID_TRANSACTION_AMOUNT);
        // check the new balance
        if ((short)(balance - debitAmount) < (short)0)
             ISOException.throwIt(SW_NEGATIVE_BALANCE);
        balance = (short)(balance - debitAmount);
    public Shareable getShareableInterfaceObject(AID client_aid, byte parameter){
        byte[] ephone_aid_bytes = {(byte)0X15, (byte)0XEF, (byte)0X4D, (byte)0X55, (byte)0X86, (byte)0X60};
        if(client_aid.equals(ephone_aid_bytes,(short)0,(byte)ephone_aid_bytes.length) == false)
            return null;
        if(parameter != (byte)0x01)
            return null;
        return this;
The code snippet of the EPhone applet (client)
   //Helper method
    private void makeBankcardDebit(short amount){
        AID ewallet_aid = JCSystem.lookupAID(ewallet_aid_bytes,(short)0,(byte)ewallet_aid_bytes.length);
        if(ewallet_aid == null)
           ISOException.throwIt(SW_EWALLET_AID_NOT_EXIST);
        //Error with casting from Shareable to EWalletInterface
        EWalletInterface sio = (EWalletInterface)(JCSystem.getAppletShareableInterfaceObject(ewallet_aid, (byte)0x01));
        if(sio == null)
          ISOException.throwIt(SW_FAILED_TO_OBTAIN_SIO);
        byte[] pin = new byte[4];
        sio.verify(pin);
        sio.debit((byte)amount);
        this.balance = (short)(this.balance + amount);
The EWalletInterface code snippet
    public interface EWalletInterface extends Shareable {
        public void verify(byte[] pincode);
        public void debit(byte amount);
    }The interface is currently both in the EWallet and EPhone packages.
The problem i'm facing is that in the code snippet of EPhone.
The "lookupAID"- and "getAppletShareableInterfaceObject"-methods work
The casting from Shareable to EWalletInterface gives me status word 0x6F00 which presents me with a google explanation of "No precise diagnosis".
Does anyone have an idea why the cast from Shareable to EWalletInterface doesn't work?
Thanks in advance,
Jeroen

Similar Messages

  • Interfaces + casting problem

    ok, so i have a class Student that goes like
    import java.util.*;
    interface Copyable extends Cloneable {
         public Object clone();
         public String toString();
    public class Student implements Copyable {
         private String iName = "";
         private Student iMentor = null;
         private boolean isClone = false;
         public void setName (String name) {
              iName = name;
         public Student() {}
         public Student(String name, Student mentor) {
              iName = name;
              iMentor = mentor;
            //more code here
    }i also have a class Demo that contains the following:
    interface CopyListener {
         public void copyAdded(Copyable obj);
    public class Demo implements CopyListener {
         public void copyAdded(Copyable obj) {
              System.out.println("Added " + obj.toString());
         public static void main(String[] args) {
              Demo demo1 = new Demo();
              Demo demo2 = new Demo();
              ArrayListWrapper wrapper = new ArrayListWrapper();
              wrapper.addListener(demo1);
              wrapper.addListener(demo2);
              Student mentor = new Student("Mentor", null);
              Student std1 = new Student("Student1", mentor);
              Student std2 = new Student("Student2", mentor);
              Student std3 = new Student("Student3", mentor);
              wrapper.add(std1);
              wrapper.add(std2);
              wrapper.add(std3);
              Student std4 = new Student("Student3", mentor);
              wrapper.add(std4);
              wrapper.show();
    }the last class is ArrayListWrapper.
    it goes like
    import java.util.*;
    public class ArrayListWrapper {
         private CopyListener[] iListeners = new CopyListener[20];
         private ArrayList iArrayList = new ArrayList();
         public ArrayListWrapper() {}
         public void addListener (CopyListener listener) {
              boolean added = false;
              for (int i = 0; i < iListeners.length; i++ ) {
                   if (iListeners[i] == null) {
                        iListeners[i] = listener;
                        added = true;
                        break;
         public void add(Copyable obj) {
              if(!iArrayList.contains(obj)) {
                   Object objClone = obj.clone();
                   if(objClone != null){
                        iArrayList.add(objClone);
                        for (int i = 0; i < iListeners.length; i++ ) {
                             iListeners.copyAdded((Copyable)objClone);
         public void show() {
              for (int i = 0; i < iArrayList.size(); i++ ) {
                   iArrayList.get(i).toString();
    it all compiles, but i get a runtime error:
    Exception in thread "main" java.lang.NullPointerException
            at ArrayListWrapper.add(ArrayListWrapper.java:30)
            at Demo.main(Demo.java:23)line 30 in ArrayListWrapper is
    iListeners[i].copyAdded((Copyable)objClone);
    and line 23 in Demo
    wrapper.add(std1);
    which i guess are a part of one and same problem/error.
    really not sure how to fix it, though

    Well, what do you think the problem is? I've substituted j for i, for clarity.
    Exception in thread "main" java.lang.NullPointerException
    at ArrayListWrapper.add(ArrayListWrapper.java:30)
    at Demo.main(Demo.java:23)
    line 30 in ArrayListWrapper is
    iListeners[j].copyAdded((Copyable)objClone);
    What could possibly cause a NullPointerException on this line? Can you think of any ways to figure out what is null here at runtime? And why, oh why, are so many people incapable of the most trivial debugging?
    grumble

  • Class vs. interface casting

    This is a long read. But since I wrote test code and think its a ligit question:
    After compiling, if I move a *.class file to a different directory, casting with a class (but not an interface) fails. Please look at my test code to understand what I am trying to say:
    public class Main {
      public static void main(String[] args) {
        try {
          MyClassLoader mcL = new MyClassLoader();
          Class classA = mcL.loadClass("whatever");
          I inst = (I) classA.newInstance(); // <-- good
          // ClassA inst = (ClassA) classA.newInstance(); <-- bad
          inst.foo();
        } catch(Exception e) { e.printStackTrace() ; }
          public static class MyClassLoader extends ClassLoader {
            protected Class<?> findClass(String s) throws ClassNotFoundException, ClassFormatError {
              try {
                InputStream in = new FileInputStream(new File("/etc/ClassA.class"));
                int i = in.available();
                byte[] buf = new byte;
    in.read(buf, 0, buf.length);
    return defineClass(buf, 0, buf.length);
    } catch(Exception e) {e.printStackTrace(); }
    return null;
    public class ClassA implements I {
    public void foo() { println("ClassA::foo-->ok"); }
    public interface I { public void foo(); }
    C:\dev\dir *java
      Main.java
      ClassA.java
      I.java
    C:\dev\javac *java
    C:\dev\move ClassA.class \etc
    C:\dev\java Main
    using interface cast = no problem
    using a class to cast = _fail_
    Exception in thread "main" java.lang.NoClassDefFoundError: ClassA
         at Main.main(Main.java:18)
    Caused by: java.lang.ClassNotFoundException: ClassA
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         ... 1 more
    I will only cast with interfaces, but wondering what is going on with why casting with a class fails.
    _note_: to test that casting with classes works at all I wrote this code snippet:
    Class c = Thread.class;
    Class[] noArg = new Class[0];
    Constructor constr =  c.getConstructor(noArg);
    Thread t = (Thread) constr.newInstance(new Object[0]);
    println("-->" + t.getId());
    I hope this proves casting with classes is possible.So sometimes casting with a class is ok, sometimes not. I wonder why.
    thanks.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    ejp wrote:
    After compiling, if I move a *.class file to a different directoryYou can't do that. The .class file has to be in whatever directory is indicated by its package statement. Two classes with the same name in different packages are different, and a .class file in the wrong directory will cause NoClassDefFoundErrors.can i ask a follow-up?
    To be painfully clear, when I hit this line:
    ClassA inst = (ClassA) classA.newInstance();The type-checking tripped me up. I had a valid "ClassA" object. Object creation had been internalized to my class loader. However, when the jvm did a type-check, it needed to load the ClassA.class file, and it had been removed. So, my casting with a class failed only because of type-checking?

  • Runtime casting problems

    The following code gives me runtime casting problems:
    package edu.columbia.law.markup.test;
    import java.util.*;
    public class A {
       protected static Hashtable hash = null;
       static {
          hash = new Hashtable ();
          hash.put ("one", "value 1");
          hash.put ("two", "value 2");
       public static void main (String args []) {
           A a = new A ();
           String keys [] = a.keys ();
           for (int i = 0; i < keys.length; i++) {
               System.out.println (keys );
    public String [] keys () {
    return (String []) hash.keySet ().toArray ();
    The output on my console is:
    java.lang.ClassCastException: [Ljava.lang.Object;
            at edu.columbia.law.markup.test.A.keys(A.java:37)
            at edu.columbia.law.markup.test.A.main(A.java:29)I can not understand why is it a problem for JVM to cast?
    Any ideas?
    Thanks,
    Alex.

    return (String []) hash.keySet ().toArray ();This form of toArray returns an Object[] reference to an Object[] object. You cannot cast a reference to an Object[] object to a String[] reference for the same reason that you cannot cast a reference to a Object object to a String reference.
    You must use the alternate form of toArray instead:
    return (String []) hash.keySet ().toArray (new String[0]);This will return an Object[] reference to a String[] object, and this reference can be cast to a String[] reference.

  • DropDownList casting problem

    Table
    int id
    string name
    Tables extends table
    Array<TableLinks> of children
    TableLinks
    Table rightTable
    In flex, I get a list of Tables from my web service
    Display a combobox with the list of Tables
    Once someone selects from the list the list of TableLinks is populated in a datagrid
    in the rightTable column it displays the rightTable.name in the label
    When you edit the column a dropdownlist shows
    <mx:DataGridColumn id="tableNameDC"
       headerText="Table"
       editable="true"
       dataField="rightTable"
       labelFunction="tableFormat"
       editorDataField="value"
       width="150">
    Is there anyway to cast my Tables list to type Table here?
    Currently, I keep the list as Tables
    When you select and item the value is saved to a value object but casted from Tables to Table
    When you exit the dropdownlist the get value function returns the Table value Object.  But for some reason, it keeps telling me its null.
    Its as if when I cast the Tables item to Table it fails.
    public function get value():TableDto
    return rightTableDto
    protected function selectableDropDown_closeHandler(event:DropDownEvent):void
    rightTableDto = selectableDropDown.selectedItem as TableDto;
    So, if the first question is not doable,  what do you think I am doing wrong?

    Hi,
       You can use onClientSelect to trigger the javascript code.
    Here is a sample code to trigger the javascript
    <%String projectId="";%>
    <hbj:dropdownListBox
         id="projectIdDL"
         width="110"
         onClientSelect="getStages()">
    <%projectId=myContext.getParamIdForComponent(projectIdDL);%>
         </hbj:dropdownListBox>
    <script>
    var proid=document.getElementById('<%=projectId%>');
    function getStages()
    //code
    </script>
    Hope this will oslve your problem to trigger a javascript code when you select a value in DropdownListbox
    Regards
    Padmaja

  • Wide casting problem

    Hi All,
    Can u explain Wide casting in detail ? already i gone through sdn links but still i didnt get clear .  please go through the follwing code snippet and explain where i made mistake in order to getting wide casting.. my problem is as wide casting i want to access the base class methods with reference of sub class when the base class methods are redefined in sub class(actually sub class reference access the  subclass methods only if we have same methods in base and as well as sub class) in my program after performing wide cast also it is accessing sub class methods only please send the answer.
    REPORT  ZNARROW_WIDE.
    CLASS C1 DEFINITION.
    PUBLIC SECTION.
    METHODS:M1,M2.
    ENDCLASS.
    CLASS C1 IMPLEMENTATION.
    METHOD M1.
    WRITE:/ ' THIS IS SUPER CLASS METHOD M1'.
    ENDMETHOD.
    METHOD M2.
    WRITE:/ ' THIS IS SUPER CLASS METHOD M2'.
    ENDMETHOD.
    ENDCLASS.
    CLASS C2 DEFINITION INHERITING FROM C1.
    PUBLIC SECTION.
    METHODS:M1 REDEFINITION.
    METHODS:M2 REDEFINITION,
                      M3.
    ENDCLASS.
    CLASS C2 IMPLEMENTATION.
    METHOD M1.
    WRITE:/ ' THIS IS SUB CLASS METHOD M1'.
    ENDMETHOD.
    METHOD M2.
    WRITE:/ ' THIS IS SUBCLASS METHOD M2'.
    ENDMETHOD.
    METHOD M3.
    WRITE:/ ' THIS IS SUB CLASS METHOD M3'.
    ENDMETHOD.
    ENDCLASS.
    DATA:O_SUPER TYPE REF TO C1,
         O_SUB TYPE REF TO C2.
    START-OF-SELECTION.
    CREATE OBJECT O_SUPER.
    CREATE OBJECT O_SUB.
    CALL METHOD O_SUPER->M1.
    CALL METHOD O_SUPER->M2.
    CLEAR O_SUPER.
    O_SUPER = O_SUB.
    CALL METHOD O_SUPER->('M3').
    SKIP 5.
    ULINE 1(80).
    CLEAR O_SUB.
    O_SUB ?= O_SUPER.
    CALL METHOD O_SUB->M1.
    CALL METHOD O_SUB->M2.
    CALL METHOD O_SUB->M3.
    Thanks in advance.
    sreenivas P

    Hi,
    consider the following sample code:
    REPORT  ZA_TEST93.
    class class_super definition.
      public section.
        data: var_area type i.
        methods:
        area importing length type i breadth type i.
    endclass.
    class class_super implementation.
      method area.
        var_area = length * breadth.
        write:/ 'Area of rectangle = '.
        write: var_area.
      endmethod.
    endclass.
    class class_sub definition inheriting from class_super.
      public section.
      data:height type i.
      methods:
      area redefinition.
    endclass.
    class class_sub implementation.
      method area.
        var_area = 6 * length * breadth * height.
        write:/ 'Area of the cube ='.
        write: var_area.
      endmethod.
    endclass.
    start-of-selection.
    data: object_superclass type ref to class_super,
          object_subclass type ref to class_sub,
          object2_superclass type ref to class_super.
    create object object_superclass.
    create object object2_superclass.
    create object object_subclass.
    call method object_superclass->area exporting length = 10 breadth = 5.
    "Narrow casting
    object_subclass->height = 10.
    object_superclass = object_subclass.
    call method object_superclass->area exporting length = 10 breadth = 10.
    "Wide casting
    object_superclass ?= object2_superclass.
    call method object_superclass->area exporting length = 10 breadth = 5.
    Explanation:
    In the above code, consider the super class named 'class_super'.
    This class has a method called 'area' which is used to calculate the area of a rectangle.
    Consider the subclass 'class_sub', which inherits all the attributes and methods of super class 'class_super'.
    Now we want to use the same method of super class 'class_super', 'area', but this time we want it to calculate the area of a cube.
    For this purpose we use the 'redefinition' keyword in the definition part of 'class_sub' and enter the code for cube area calculation in the 'area' method body in the implementation part of 'class_sub'.
    From the above code, consider the following code snippet:
    create object object_superclass.
    create object object2_superclass.
    create object object_subclass.
    call method object_superclass->area exporting length = 10 breadth = 5.
    Explanation: Two objects of the superclass and one object of the subclass are created and the 'area' method of the superclass is called to compute the area of a rectangle.
    Now consider what comes next:
    "Narrow casting
    object_subclass->height = 10.
    object_superclass = object_subclass.
    call method object_superclass->area exporting length = 10 breadth = 10.
    Explanation:
    We assign a value of 10 to the 'height' instance variable of the subclass object.
    Then we perform narrow casting in the next line(object_superclass = object_subclass.).
    Now the instance of the superclass(object_superclass) now points or refers to the object of the subclass, thus the modified method 'area' of the subclass is now accessible.
    Then we call this method 'area' of the subclass to compute the area of the cube.
    Moving on to the final piece of code:
    "Wide casting
    object_superclass ?= object2_superclass.
    call method object_superclass->area exporting length = 10 breadth = 5.
    Explanation:
    The object 'object_superclass' now refers to the object of the subclass 'object_subclass'.
    Thus the 'area' method of the superclass cannot be called by this object.
    In order to enable it to call the 'area' method of the superclass, wide casting has to be perfomed.
    For this purpose, the RHS of the wide casting must always be an object of a superclass, and the LHS of the wide casting must always be an object reference declared as 'type ref to' the superclass(objectsuperclass ?= object2_superclass.)._
    Otherwise a runtime error will occur.
    Finally the 'area' method of the superclass can now be called once again to compute the area of the rectangle.
    The output of the above example program is as follows:
    Area of rectangle =          50
    Area of the cube =      6,000
    Area of rectangle =          50
    Also note that wide casting cannot be performed on subclass objects, wide casting can only be performed on superclass objects that have been narrow cast.
    Hope my explanation was useful,
    Regards,
    Adithya.
    Edited by: Adithya K Ramesh on Dec 21, 2011 11:49 AM
    Edited by: Adithya K Ramesh on Dec 21, 2011 11:51 AM

  • FPGA Interface Cast question

    I'm playing with a 5644 VST and the VST Streaming template.  On the FPGA VI I added some code, then added an indicator to the FPGA VI front panel and compiled.  Running the FPGA VI in interactive execution mode, the indicator works well.  On the host end, though, I can't seem to access the new indicator with a Read/Write control. 
    Coming out of the Open FPGA VI Reference I can see the indicator on the wire, but in the Dynamic FPGA Interface Cast function it's getting stripped out of the refnum somehow.  If I connect a Read/Write control directly to the output of the Open Reference function I can access the indicator just fine.
    Any idea what I'm doing wrong?
    Thanks.
    Solved!
    Go to Solution.

    Have you re-configured your FPGA VI reference interface with the new bitfile?  The dynamic interface cast defines the output wire as having all the methods and indicators described by the type wire connected.  You can right-click on the type constant and select "Configure FPGA VI Reference...".  In the pop-up that follows, choose "Import from bitfile..." and then select the new bitfile that you've built.
    You'll need to update the fpga reference type in the "Device Session.ctl" type def as well.  This is the type that you'll be able to access throughout the project.

  • How to invoke a method in application module or view objects interface?

    Hi,
    perhaps a stupid RTFM question, but
    How can i invoke a method that i have published in the application modules or view objects interfaces using uiXml with BC4J?
    Only found something how to invoke a static method (<ctrl:method class="..." method="..." />) but not how to call a method with or without parameters in AM or VO directly with a uix-element.
    Thanks in advance, Markus

    Thanks for your help Andy, but i do not understand why this has to be that complicated.
    Why shall i write a eventhandler for a simple call of a AM or VO method? That splatters the functionality over 3 files (BC4J, UIX, handler). Feature Request ;-)?
    I found a simple solution using reflection that can be used at least for parameterless methods:
    <event name="anEvent">
      <bc4j:findRootAppModule name="MyAppModule">
         <!-- Call MyAppModule.myMethod() procedure. -->
          <bc4j:setPageProperty name="MethodName" value="myMethod"/>
          <ctrl:method class="UixHelper"
                  method="invokeApplicationModuleMethod"/>
       </bc4j:findRootAppModule>
    </event>The UixHelper method:
      public static EventResult invokeApplicationModuleMethod( BajaContext context,
                                                               Page page,
                                                               PageEvent event ) {
        String methodName = page.getProperty( "MethodName" );
        ApplicationModule am = ServletBindingUtils.getApplicationModule( context );
        Method method = null;
        try {
          method = am.getClass(  ).getDeclaredMethod( methodName, null );
        } catch( NoSuchMethodException e ) {
          RuntimeException re = new RuntimeException( e );
          throw re;
        try {
          method.invoke( am, null );
        } catch( InvocationTargetException e ) {
          RuntimeException re = new RuntimeException( e );
          throw re;
        } catch( IllegalAccessException e ) {
          RuntimeException re = new RuntimeException( e );
          throw re;
        return null;
      }Need to think about how to handle parameters and return values.
    Btw. Do i need to implement the EventHandler methods synchronized?
    Regards, Markus

  • Ivette manzur : Interface errors problems on cisco 3560

    Hello,
    I have a problem on one of the interfaces on a cisco 3560 switch. In fact, I set up a monitoring network recently (cacti), and I have a significant number of errors on the interfaces. the problem is that when I do a sh interface I see no errors, and even by making a clear counters it does not solve my problem .. I also changed the wiring with cat 6 cables but nothing has changed ..
    What are the main causes of errors on an interface of a switch? what should I do in this case?
    Thank you for your help in advance
    ivette manzur

    Hello,
    I've a e61i and I experience a similar problem. My phone work very well on WiFi network with no encryption as well as 64-bit wep.
    At home I've 2 wireless routers, both encrypted at 128 bits, one with WEP and the other with WPA. On both of them I can correctly obtain an IP thru DHCP, but the traffic do not go thru.
    By using IfInfo I think I discovered the reason of the problem (unless IfInfo is not working properly...) and it seems a bug related to the netmask, broadcast and gateway settings. The router is 192.168.15.1 and this is what I get:
    1) DHCP case -- I get two IP adresses: the 169.254.x.x and the one assigned to the router. DNS is also set properly, but both gateway, broadcast and netmask are set to 0.0.0.0 for both IPs.
    IP Addr: 169.254.162.106
    Netmask: 0.0.0.0
    Broadcast: 0.0.0.0
    Gateway: 0.0.0.0
    DNS1: 192.168.15.1
    IP Addr: 192.168.15.100
    Netmask: 0.0.0.0
    Broadcast: 0.0.0.0
    Gateway: 0.0.0.0
    DNS1: 192.168.15.1
    2) Static IP 192.168.15.64, netmask set to 255.255.255.0 and gateway and DNS set to 192.168.15.1. The 169.254.x.x disappears and I get only one IP which is set to:
    IP Addr: 192.168.15.64
    Netmask: 0.0.0.0
    Broadcast:192.168.15.255
    Gateway: 192.168.15.1
    DNS1: 192.168.15.1
    So in conclusion, it seems that with 128bit encryption, in the DHCP case gateway, broadcast and netmask are not assigned correctly! While in the Static IP case the netmask is still not assigned correctly!!!
    Hope this can help...
    --AP

  • ABAP Object (Up cast, Down Cast)

    Someone should let me know.
    Version 4.70 Enterprise was as follows.
    " Up Cast (Narrowing-Cast)
      superclass = subclass.
    " Down Cast (Widening-Cast)
      subclass ?= superclass.
    It is why the help of F1 is changed as follows from the version ECC 6.0.
    (Widening-Cast and Narrowing-Cast became reverse.)
    " Up Cast (Widening-Cast)
      superclass = subclass.
    " Down Cast (Narrowing-Cast)
      subclass ?= superclass.

    Hello Tayori,
    You are referring to the link: [ABAP Objects: Narrowing Cast (Upcasting) |http://help-abap.blogspot.com/2008/09/abap-objects-narrowing-cast-upcasting.html], than you must have read the discussion between me and Christian.
    I am not clear why SAP has changed the definition.
    I am on ECC 5.0 and in my F1 defintion it says Narrowing Cast = Upcasting.
    It is better not to use Upcasting or Downcasting terms, as they are with the reference of the your view of Inheritence Tree. So, we can stick to the standard terms like Narrowing and Widening Cast.
    Narrowing:  "More Specific view of an object" to "less specific view".
    Like: BMW to CAR
    Widening: "Less Specific View of an ojbect" to "More Specific view"
    Like: CAR to BMW
    Regards,
    Naimesh Patel

  • Object Reference Casting Doubt

    class A extends Object{
      //this class is empty
    }//end class A
    //===================================//
    class B extends A{
      public void m(){
        System.out.println("m in class B");
      }//end method m()
    }//end class B
    //===================================//
    class C extends Object{
      //this class is empty
    }//end class C
    //===================================//
    public class Poly02{
      public static void main(
                            String[] args){
        Object var = new B();
        //Following will not compile
        //var.m();
        //Following will not compile
        //((A)var).m();   
        //Following will compile and run
        ((B)var).m();
      }//end main
    }//end class Poly02Why cant I do var.m();?
    Bacause var is an Object Reference and a new Object of type B itself is created. So run time polymorphism should hold good and I should be able to access [b]m() without any cast..
    Please tell me the best place to learn Object Reference Casting Fundamentals.

    Why cant I do var.m();?
    Bacause var is an Object Reference and a new
    Object of type B itself is created. So run time
    polymorphism should hold good and I should be able to
    access [b]m() without any cast..It doesn't matter what var is referencing. You should only look at the reference type. It's Object, and Object does not contain a m() method.
    Kaj

  • JTree data object type casting

    I need to invoke a method on my data object after the user selects the corresponding node on the tree. I'm not able to type cast the DefaultMutableTreeNode to my class called Account. I've even tried extending DefaultMutableTreeNode in my class Account but of no avail.
    any help in this matter will be highly appreciated
    thanx
    seeta

    Are you talking about the user object that is passed in the constructor of DefaultMutableTreeNode?
    If so, you don't cast the node itself, you get the user object and cast that (i.e. getUserObject()).

  • Object view multi-cast problem

    We are using the following object to generate XML the output for multi=cast is prodicing an unwanted extra tag "*_ITEM"
    Any ideias??
    CREATE OR REPLACE VIEW sjs.arrest_obj_view
    AS SELECT CAST(MULTISET(SELECT 'ERROR NEEDED ' FROM dual) AS errors_type) AS "Errors",
    a.a_date AS "ArrestDate",
    NVL(a.a_photo_num,'NULL') AS "PhotographNumber",
    NVL(a.a_division,'NULL') AS "AgencyDivision",
    'MODEL MAPPING PROBLEM' AS "ArrestType",
    NVL(agcy.agcy_ori,'NULL') AS "ArrestingAgency",
    a.a_id AS "ArrestNumber",
    NVL(oa.o_number,'NULL') AS "ArrestingOfficerID",
    NVL(o.o_number,'NULL') AS "AssistingOfficerID",
    'MODEL MAPPING PROBLEM' AS "AssistingAgency",
    'MODEL MAPPING PROBLEM' AS "CJTN",
    CAST(MULTISET(SELECT l.lu_name AS "Weapon"
    FROM sjs.arrestweapons awm,
    sjs.lookuptable l
    WHERE awm.a_id = a.a_id
    AND awm.weapons_id = lu_id (+)) AS arrest_weapons_type) AS "ArrestWeapons"
    FROM sjs.arrest a,
    sjs.agency agcy,
    sjs.officers o,
    sjs.officers oa
    WHERE a.agcy_id = agcy.agcy_id (+)
    AND a.o_arrest_id = oa.o_id (+)
    AND a.o_assist_id = o.o_id (+)
    - <ROWSET>
    - <ROW num="1">
    <InterfaceTransaction>ADD</InterfaceTransaction>
    <Resubmission>RESUBMISSION NEEDED</Resubmission>
    <SubmittingAgency>NY1111111</SubmittingAgency>
    <SubmittingEmployeeID>FFOTI</SubmittingEmployeeID>
    <TOT>TOT NEEDED</TOT>
    - <Errors>
    - <Errors_ITEM>
    <Error>ERROR NEEDED</Error>
    </Errors_ITEM>
    </Errors>
    <ArrestDate>3/18/2002 9:40:0</ArrestDate>
    <PhotographNumber>PPPPP</PhotographNumber>
    <AgencyDivision>PPP</AgencyDivision>
    <ArrestType>MODEL MAPPING PROBLEM</ArrestType>
    <ArrestingAgency>NY1111111</ArrestingAgency>
    <ArrestNumber>1</ArrestNumber>
    <ArrestingOfficerID>NULL</ArrestingOfficerID>
    <AssistingOfficerID>NULL</AssistingOfficerID>
    <AssistingAgency>MODEL MAPPING PROBLEM</AssistingAgency>
    <CJTN>MODEL MAPPING PROBLEM</CJTN>
    - <ArrestWeapons>
    - <ArrestWeapons_ITEM>
    <Weapon>FULLY AUTOMATIC RIFLE OR MACHINE GUN</Weapon>
    </ArrestWeapons_ITEM>
    - <ArrestWeapons_ITEM>
    <Weapon>FIRE/INCENDIARY DEVICE</Weapon>
    </ArrestWeapons_ITEM>
    </ArrestWeapons>
    </ROW>
    </ROWSET>

    How would you replace the multi-cast within the object with cursor?
    Thanks

  • Object oriented design problem concerning abstract classes and interfaces

    I have an abstract class (class A) that takes care of database connections. It cannot be made into an interface as other classes extend it and all these other classes require the functionality in the methods it has (i.e. I cannot make all the methods abstract and then make this class an interface).
    I have a class that contains data (Customer class) that I will create from the data I extract from the database. This class will also be created by the User and submitted to the database portion of the program. The Customer class has functionality in its methods which is required by the rest of the program (i.e. I cannot make all the methods abstract and then make this class an interface).
    I have a factory class (CustomerFactory) that extends the Customer class. This has been created to restrict access to the creation and manipulation of Customers.
    I have a class (DatabaseQuery) that extends class A. But now that I have retrieved all of the information that comprises a Customer from the database, I cannot construct a Customer without making reference to UserFactory. But UserFactory is a class that I don't want the database portion of the program to know about.
    What I would like to do is have my DatabaseQuery class extend both Customer class and A class. But they are both classes and Java won't allow that.
    I can't make either of the two classes that I want to make parents of DatabaseQuery into interfaces... so what can I do other than just keep a reference to UserFactory in my DatabaseQuery class?
    Thanks,
    Tim

    >
    What I would like to do is have my DatabaseQuery class
    extend both Customer class and A class. But they are
    both classes and Java won't allow that.
    I can't make either of the two classes that I want to
    make parents of DatabaseQuery into interfaces... so
    what can I do other than just keep a reference to
    UserFactory in my DatabaseQuery class?Just a guess...
    The description sounds a little vague but it sounds like the correct solution would be to refactor everything. The first clue is when I see "database connection" as an "abstract class". The only hierarchy that a database connection might exist in is in a connection pool and even that is probably shaky. It should never be part of data records, which is what your description sounds like.
    That probably isn't what you want to hear.
    The other solution, which is why refactoring is better (and which also makes it apparent why the original design is wrong) is to create an entire other hierarchy that mirrors your current data hierarchy and wraps it. So you now have "Customer", you will now have "Customer" and "DBCustomer". And all the code that currently uses "Customer" will have to start using DBCustomer. Actually it is easier than that since you can simply make the new class be "Customer" and rename the old class to "DBCustomer". Naturally that means the new class will have to have all of the functionality of the old class. Fortunately you can use the old class to do that. (But I would guess that isn't going to be easy.)

  • Class Cast problem when attempting to add Object in TreeSet, Please Help...

    hi friends,
    I have a TreeSet Object in which i add Object of type WeatherReport but when I trying to add my Second WeatherReport Object it throwing ClassCastException please Help Me in figure out the mistake that i did...
    /*code sample of my WeatherReport.class*/
    package com;
    class WeatherReport implements Serializable
    private String region;
    private String desc;
    private String temp;
    /*equvalent getter and setters come here*/
    /*in my jsp*/
    <%@ page import="com.WeatherReport"%>
    <%
    TreeSet<com.WeatherReport> ts=new TreeSet<com.WeatherReport>();
    while(condition)
    WeatherReport wp=new WeatherReport();
    /*setting data for all the Methods*/
    ts.add(wp);
    %>
    Error:
    java.lang.ClassCastException: com.WeatherReport
            at java.util.TreeMap.compare(TreeMap.java:1093)
            at java.util.TreeMap.put(TreeMap.java:465)
            at java.util.TreeSet.add(TreeSet.java:210)
            at org.apache.jsp.Weather_jsp._jspService(Weather_jsp.java:138)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
            at java.lang.Thread.run(Thread.java:595)Edited by: rajaram on Oct 31, 2007 12:56 AM

    hi ChuckBing,
    Thank you very much, your suggestion helps me a lot...
    I change the WeatherReport Class as follows and its working now...
    public class WeatherReport implements Serializable,Comparable {
        private String location;
        private String temp;
        private String desc;
        public int compareTo(Object o) {
            if(o instanceof WeatherReport)
                WeatherReport wp=(WeatherReport)o;
                String l1=wp.getLocation();
                String l2=this.getLocation();
                return l2.compareTo(l1);
            return -1;
    }Once Again Thanks a lot ...
    Edited by: rajaram on Oct 31, 2007 9:11 PM

Maybe you are looking for

  • Crystal Reports 2008 Customer Details Aging Report Example / Sample

    Hello! Anyone willing to send me a customer details aging report example for SAP Business One? (or give me a link?) I've been looking all over and have found examples of things, but not specifically for B1. Anything would be useful I am pretty flexib

  • Plugins for videos to be sent to mobile phones

    can anybody help me with this?? I need to know how I can make a video on FCP and send it to mobile phones?? What specifications should I have in order to be able to send it to mobile phones and view it clearly?? iMAC   Mac OS X (10.4.9)   iMAC   Mac

  • Problem in Transportation - create shipment

    Hi Gurus, I am implementing Transportation Module , I created one shipping point for each Plant and ,one transportation planning point for each plant .     In node " Transportation Planning Point Determination" i assigned Shipping point -Shipment typ

  • My nano ipod will not do anything but flash the apple logo.  Help?

    I have tried ever diagnostic tool available. Have reset it many times. Have even done every troubleshooting thing it suggests to no avail. I just got it for Xmas and am very frustrated having spent all day yesterday trying to fix it.

  • Corrupted RAW photos in iPhoto 9.6 (Yosemite) from Nikon D800

    Since upgrading to Yosemite (OS 10.10.1) and iPhoto 9.6, all my RAW photos imported into iPhoto from my Nikon D800 appear to be corrupted. The thumbnails contain pixellated boxes over the image.  It appears that if I go into Edit mode within iPhoto a