Applet selection return false?

Hi,
In the spec, there may be cases that the applet select() method return false. I am suspecting which cases cause the applet return false?
In my mind, before selection, the applet is in idle state so that it should be ready to be selected. Hence invoking its select() method should always return true in all cases.
regards,
Hoang Long

For some applicative reasons, an applet may refuse to be selected:
- it could be a "server" applet, whose only purpose is to provide a shareable object to other applets
- the applet may have been "invalidated" by the card issuer (expiration date, theft/loss, etc...)
It's up to the application provider to define the cases where an applet refuses selection.

Similar Messages

  • Bug Report: ResultSet.isLast() returns false when queries return zero rows

    When calling the method isLast() on a resultset that contains zero (0) rows, false is returned. If a resultset contains no rows, isLast() should return true because returning false would indicate that there are more rows to be retrieved.
    Try the following Java source:
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import oracle.jdbc.driver.*;
    public class Test2 {
    public static void main (String [] args) throws Exception {
    Connection conn = null;
    String jdbcURL = "jdbc:oracle:thin:@" +
    "(DESCRIPTION=(ADDRESS=(HOST=<host computer>)"+
    "(PROTOCOL=tcp)(PORT=<DB port number>))"+
    "(CONNECT_DATA=(SID=<Oracle DB instance>)))";
    String userId = "userid";
    String password = "password";
    try{
    // Load the Oracle JDBC Driver and register it.
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    // *** The following statement creates a database connection object
    // using the DriverManager.getConnection method. The first parameter is
    // the database URL which is constructed based on the connection parameters
    // specified in ConnectionParams.java.
    // The URL syntax is as follows:
    // "jdbc:oracle:<driver>:@<db connection string>"
    // <driver>, can be 'thin' or 'oci8'
    // <db connect string>, is a Net8 name-value, denoting the TNSNAMES entry
    conn = DriverManager.getConnection(jdbcURL, userId, password);
    } catch(SQLException ex){ //Trap SQL errors
    // catch error
    //conn = new OracleDriver().defaultConnection(); // Connect to Oracle 8i (8.1.7), use Oracle thin client.
    PreparedStatement ps = conn.prepareStatement("select 'a' from dual where ? = ?", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); // Use any query that will return zero rows.
    ps.setInt(1, 1); // Set the params so that the query returns 0 rows.
    ps.setInt(2, 2);
    ResultSet rs = ps.executeQuery();
    System.out.println("1. Last here? " + rs.isLast());
    while (rs.next()) {
    // do whatever
    System.out.println("2. Last here? " + rs.isLast());
    ps.close();
    rs.close();
    EXPECTED RESULT -
    1. Last here? true
    2. Last here? true
    ACTUAL RESULT -
    1. Last here? false
    2. Last here? false
    This happens to me on Oracle 9.2.0.1.0.

    387561,
    For your information, I discovered this problem from
    running a query that did access an actual DB table.
    Try it and let me know.I did say I was only guessing, and yes, I did try it (after I posted my reply, and before I read yours). And I did check the query plan for the queries I tried -- to verify that they were actually doing some database "gets".
    In any case, the usual way that I determine whether a "ResultSet" is empty is when the very first invocation of method "next()" returns 'false'. Is that not sufficient for you?
    Good Luck,
    Avi.

  • A strange applet selection fail problem

    Hi, All. I am trying to implement the RSA encryption and decryption using rmi. I use the RSA implementation sample code in the previous post and the RMIPurse sample code in the package (3.0.2 classic ) for testing. However, after I add some initialization codes into the PurseImpl class, I got the "applet selection failed" error.
    The code that I modified based on RMIPurse
    import javacard.framework.ISO7816;
    import javacard.framework.ISOException;
    import javacard.security.CryptoException;
    import javacard.security.KeyBuilder;
    import javacard.security.KeyPair;
    import javacard.security.RSAPrivateCrtKey;
    import javacard.security.RSAPublicKey;
    import javacardx.crypto.Cipher;
    public class PurseImpl extends CardRemoteObject implements Purse {
        private short balance = 0;
        private byte[] number;
         // crypto variables
         final static byte GETSET_CLA = (byte) 0x85;
         final static byte CRYPT_CLA = (byte) 0x00;
         // Instruction set for SimpleString
         final static byte SET = (byte) 0x10;
         final static byte GET = (byte) 0x20;
         final static byte SELECT = (byte) 0xA4;
         // This buffer contains the string data on the card
         byte TheBuffer[];
         // globals
         RSAPrivateCrtKey rsa_PrivateCrtKey;
         RSAPublicKey rsa_PublicKey;
         KeyPair rsa_KeyPair;
         Cipher cipherRSA;
         final short dataOffset = (short) ISO7816.OFFSET_CDATA;
        public PurseImpl() {
            super(); // export it
            number = new byte[5];
              // crypto
            TheBuffer = new byte[100];
            // generate own rsa_keypair
            try {
                   rsa_KeyPair = new KeyPair(KeyPair.ALG_RSA_CRT, KeyBuilder.LENGTH_RSA_1024);
                   rsa_KeyPair.genKeyPair();
                   rsa_PublicKey = (RSAPublicKey) rsa_KeyPair.getPublic();
                   rsa_PrivateCrtKey = (RSAPrivateCrtKey) rsa_KeyPair.getPrivate();
                   cipherRSA = Cipher.getInstance(Cipher.ALG_RSA_PKCS1, false);
              catch (CryptoException e) {
                short sw = (short) 0x9100;
                sw |= e.getReason();
                ISOException.throwIt(sw);
        }I got:
    Receiving initial reference... java.rmi.RemoteException: Applet selection failed, SW = 6d00
    That's strange. because without the initialization codes in try/catch block, there is no problem to select the applet. Can anyone help?

    I have exactly the same problem when calling (trying to) any applets method. Where are these parameters to be turned on?

  • Installer Applet Selection Problem

    Dear All,
    I am having a little problem in installation of applet on the actual java card.
    I have giesecke & Devrient 3.0 Contactless Java Card.
    I was having problem in installing my applet. So i have removed all the apdus from the script and left only applet selection apdu as below:
    Script:
    powerup;
    0x00 0xA4 0x04 0x00 0x09 0xa0 0x00 0x00 0x00 0x62 0x03 0x01 0x08 0x01 0x7F;
    powerdown;
    The result when i try to send this to the card using apdutool:
    C:\Documents and Settings\santosh\Desktop>apdutool -pcsc wallet.scr
    Java Card 2.2.2 APDU Tool, Version 1.3
    Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    WARNING: PC/SC is not officially supported and may not work on all platforms.
    Before SCardEstablishContext ...
    After SCardEstablishContext ...
    SUCCESS ...-855572480
    Reader 0 : SCM Microsystems Inc. SDI010 Contactless Reader 0
    Reader 1 : SCM Microsystems Inc. SDI010 Smart Card Reader 0
    Using reader SCM Microsystems Inc. SDI010 Contactless Reader 0
    NativeConnect Context is ... -855572480
    NativeConnect card is ... ea010000
    NativeStatus card is ... ea010000
    Received ATR = 0x3b 0xfe 0x91 0x00 0xff 0x91 0x81 0x71 0xfe 0x40 0x00 0x41 0x28 0x00 0x41 0x33 0xb1 0x00 0x73 0xc8 0x40 0x13 0x0
    0 0x90 0x00 0x9d
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 14
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 00, INS: a4, P1: 04, P2: 00, Lc: 09, a0, 00, 00, 00, 62, 03, 01, 08, 01, Le: 00, SW1: 6a, SW2: 82
    NativeDisconnect is ... ea010000
    What could be going wrong, will the installer applet id be different for different cards.
    I know there has seen a similar post on this forum but the problem as prescribed in the replies to that post i cannot use JCOP tools right now as i am unable to find any download related to JCOPS.
    Any help will be appreciated.
    Regards
    Santosh

    Script:
    powerup;
    // Select the installer applet
    0x00 0xA4 0x04 0x00 0x08 0xA0 0x00 0x00 0x00 0x03 0x00 0x00 0x00 0x7F;
    0x80 0xB0 0x00 0x00 0x00 0x7F;
    // com/sun/javacard/samples/HelloWorld/javacard/Header.cap
    0x80 0xB2 0x01 0x00 0x00 0x7F;
    0x80 0xB4 0x01 0x00 0x16 0x01 0x00 0x13 0xDE 0xCA 0xFF 0xED 0x01 0x02 0x04 0x00 0x01 0x09 0xA0 0x00 0x00 0x00 0x62 0x03 0x01 0x0C 0x01 0x7F;
    0x80 0xBC 0x01 0x00 0x00 0x7F;
    // com/sun/javacard/samples/HelloWorld/javacard/Directory.cap
    0x80 0xB2 0x02 0x00 0x00 0x7F;
    0x80 0xB4 0x02 0x00 0x20 0x02 0x00 0x1F 0x00 0x13 0x00 0x1F 0x00 0x0E 0x00 0x0B 0x00 0x36 0x00 0x0C 0x00 0x67 0x00 0x0A 0x00 0x13 0x00 0x00 0x00 0x6C 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x7F;
    0x80 0xB4 0x02 0x00 0x02 0x01 0x00 0x7F;
    0x80 0xBC 0x02 0x00 0x00 0x7F;
    // com/sun/javacard/samples/HelloWorld/javacard/Import.cap
    0x80 0xB2 0x04 0x00 0x00 0x7F;
    0x80 0xB4 0x04 0x00 0x0E 0x04 0x00 0x0B 0x01 0x02 0x01 0x07 0xA0 0x00 0x00 0x00 0x62 0x01 0x01 0x7F;
    0x80 0xBC 0x04 0x00 0x00 0x7F;
    // com/sun/javacard/samples/HelloWorld/javacard/Applet.cap
    0x80 0xB2 0x03 0x00 0x00 0x7F;
    0x80 0xB4 0x03 0x00 0x11 0x03 0x00 0x0E 0x01 0x0A 0xA0 0x00 0x00 0x00 0x62 0x03 0x01 0x0C 0x01 0x01 0x00 0x14 0x7F;
    0x80 0xBC 0x03 0x00 0x00 0x7F;
    // com/sun/javacard/samples/HelloWorld/javacard/Class.cap
    0x80 0xB2 0x06 0x00 0x00 0x7F;
    0x80 0xB4 0x06 0x00 0x0F 0x06 0x00 0x0C 0x00 0x80 0x03 0x01 0x00 0x01 0x07 0x01 0x00 0x00 0x00 0x1F 0x7F;
    0x80 0xBC 0x06 0x00 0x00 0x7F;
    // com/sun/javacard/samples/HelloWorld/javacard/Method.cap
    0x80 0xB2 0x07 0x00 0x00 0x7F;
    0x80 0xB4 0x07 0x00 0x20 0x07 0x00 0x67 0x00 0x02 0x10 0x18 0x8C 0x00 0x01 0x18 0x11 0x01 0x00 0x90 0x0B 0x87 0x00 0x18 0x8B 0x00 0x02 0x7A 0x02 0x30 0x8F 0x00 0x03 0x3D 0x8C 0x00 0x04 0x7F;
    0x80 0xB4 0x07 0x00 0x20 0x3B 0x7A 0x05 0x23 0x19 0x8B 0x00 0x05 0x2D 0x19 0x8B 0x00 0x06 0x32 0x03 0x29 0x04 0x1F 0x65 0x1B 0x1A 0x08 0xAD 0x00 0x16 0x04 0x1F 0x8D 0x00 0x07 0x3B 0x16 0x7F;
    0x80 0xB4 0x07 0x00 0x20 0x04 0x1F 0x41 0x29 0x04 0x19 0x08 0x8B 0x00 0x08 0x32 0x70 0xE6 0x19 0x8B 0x00 0x09 0x3B 0x19 0x16 0x04 0x08 0x41 0x8B 0x00 0x0A 0x19 0x03 0x08 0x8B 0x00 0x0B 0x7F;
    0x80 0xB4 0x07 0x00 0x0A 0x19 0xAD 0x00 0x03 0x16 0x04 0x8B 0x00 0x0C 0x7A 0x7F;
    0x80 0xBC 0x07 0x00 0x00 0x7F;
    // com/sun/javacard/samples/HelloWorld/javacard/StaticField.cap
    0x80 0xB2 0x08 0x00 0x00 0x7F;
    0x80 0xB4 0x08 0x00 0x0D 0x08 0x00 0x0A 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x7F;
    0x80 0xBC 0x08 0x00 0x00 0x7F;
    // com/sun/javacard/samples/HelloWorld/javacard/ConstantPool.cap
    0x80 0xB2 0x05 0x00 0x00 0x7F;
    0x80 0xB4 0x05 0x00 0x20 0x05 0x00 0x36 0x00 0x0D 0x02 0x00 0x00 0x00 0x06 0x80 0x03 0x00 0x03 0x80 0x03 0x01 0x01 0x00 0x00 0x00 0x06 0x00 0x00 0x01 0x03 0x80 0x0A 0x01 0x03 0x80 0x0A 0x7F;
    0x80 0xB4 0x05 0x00 0x19 0x06 0x06 0x80 0x10 0x02 0x03 0x80 0x0A 0x03 0x03 0x80 0x0A 0x07 0x03 0x80 0x0A 0x09 0x03 0x80 0x0A 0x04 0x03 0x80 0x0A 0x05 0x7F;
    0x80 0xBC 0x05 0x00 0x00 0x7F;
    // com/sun/javacard/samples/HelloWorld/javacard/RefLocation.cap
    0x80 0xB2 0x09 0x00 0x00 0x7F;
    0x80 0xB4 0x09 0x00 0x16 0x09 0x00 0x13 0x00 0x03 0x0E 0x26 0x2B 0x00 0x0C 0x05 0x0C 0x06 0x04 0x08 0x05 0x11 0x0C 0x07 0x09 0x06 0x09 0x7F;
    0x80 0xBC 0x09 0x00 0x00 0x7F;
    0x80 0xBA 0x00 0x00 0x00 0x7F;
    powerdown;

  • The ResultSet.next() returns false....

    Hai,
    I am working on jdbc. The connection credentials all correct, and its getting connected to the sybase without any problems. But I am not able to perform any 'select' or "update" statements...There are no exception or any errors...But the ResultSet.next() returns false and executeUpdate returns 0 . .
    I think you can help me.....Thanks...

    Yes the query is sameAs already pointed out, there are ONLY two possibilities.
    1. The query is not the same
    2. The database is not the same.
    You are making assumptions about what is going on and then drawing conclusions.
    You need to understand that you assumptions are wrong. So it doesn't matter what conclusion you draw.
    In terms of why the query isn't the same there could be any number of reasons but usually it is because you are passing in data and that data isn't what you think (assume) it is. It can also be that you are constructing the SQL and that construction is different. It could be that the environment that you use to test as settings which impact SQL.

  • In a javascript function invoked from an onsubmit handler, if the function returns false, the form is still submitted. If I find an error in a form, how do I cancel the submit?

    HTML form has: action="/TTFFRP/addlicense.rex" method="get" onsubmit="validate_data();"
    validate_data is defined in tags:
    function validate_data()
    alert('in validate routine');
    if (document.getElementById('custname').value == '')
    alert('Customer name must not be blank; put in name of organization licensing File RePackager');
    return false;
    }

    Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The helpers over there are more knowledgeable about web page development issues with Firefox.
    [http://forums.mozillazine.org/viewforum.php?f=25]
    You'll need to register and login to be able to post in that forum.

  • How do I find a word in all my document, return false if it's not in there.

    Hi,
    I struggle with something that should be easy, and didn't find any answer on this forum.
    I have a list of word that I want to search in a 300 pages catalogue in InDesign. I'd like to know how can i:
    1) Look for the word
    2) Return true if it's in the document
    3) Return false if it's not
    FYI, the words i'm searching are product code, so if they're not in the catalogue, the product isn't in the catalogue.
    Thanks a lot,
    Olivier

    Hi Oliver,
    Use this,
    var doc = app.documents;
    app.findTextPreferences = NothingEnum.nothing;
    app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences.findWhat = "Text";
    var foundtext = app.activeDocument.stories.everyItem().paragraphs.everyItem().findText();
    for (var i=0;i<foundtext.length;i++){
            if (foundtext[i].length != 0){
                alert("True");
            else{
                alert("False")
    app.findTextPreferences = NothingEnum.nothing;
    app.changeTextPreferences = NothingEnum.nothing;

  • (New to C# here) What is the best way to return false in a function if it cannot be executed successfully?

    In Javascript or PHP you can have a function that could return, for example, a string in case of success and false in case of failure.
    I've noticed (in the few days I've been learning C#) that you need to define a type of value that the function will return, so you need to return that type of value but in case of failure you can't return false.
    What is the best way to achieve this behavior and is there an example I can see?
    Thank you in advance,
    Juan

    Juan, be aware that returning null won't work with value types, such as an int, which can't be null. You'd have to use a nullable value type. A nullable int would be declared with a "?", such as:
    int? someOtherFunction(int param)
    if(something goes great)
    return param * 42;
    return null;
    And you have to use it like this:
    int? result = someOtherFunction(666);
    if (result != null) // you can also use result.HasValue
    // it worked, do something with the result
    // if you're doing math with the result, no problem
    int x = result * 2;
    // but if you're assigning it to another an int, you need to use this syntax
    int y = result.Value;
    Before nullable value types came along, for a method that returned an int, I'd use a value of something that wouldn't normally be returned by that method to indicate failure, such as a -1.
    ~~Bonnie DeWitt [C# MVP]
    That's something very very important to keep in mind. Can save you from a lot of headaches!
    So if you have an int function and it might return NULL, if you are doing Math with the return value you can use it directly, but if you're assigning it to another variable you have to use .Value?
    Thanks

  • ExternalInterface.available returns false on a Mac

    Hi there!
    I'm triyng to get the browsers back-button to work with my
    flash site. The general principle is this:
    There is an index.html page containing an (not yet) hidden
    Iframe and the flash movie.
    The Iframe contains page A, which starts with JavaScript
    calling a BACK-function on the index-page.
    The BACK-function triggers an AS-function in the flash-movie
    that activates its own back-button, and then changes the URL of the
    Iframe to Page B. This causes a new History to be added to the
    browser.
    The flash movie now contains 5 frames (labeled in the middle
    of the stage) and two navigation buttons: back (Terug) and forward
    (Verder). Those buttons do exactly what you'd expect them to do
    (prevFrame and nextFrame).
    On a PC (IE) this seems to work pretty well. But on a mac
    nothing seems to work propperly.
    I've got a testpage at:
    http://www.multimediamatters.nl/test
    Here's the code I have on the first frame.
    stop();
    _root.terug.onRelease = function(){
    prevFrame();
    terugF = function(){
    trace(_root._currentframe);
    if (_root._currentframe > 1){
    _root.terug.onRelease();
    else {
    _root.getURL("javascript::history.go(-2)");
    import flash.external.*;
    var isAvailable:Boolean = ExternalInterface.available;
    var txtField2:TextField = this.createTextField("txtField",
    this.getNextHighestDepth(), 300, 0, 200, 50);
    txtField2.border = true;
    txtField2.text = "ExternalInterface.available =
    "+isAvailable.toString();
    var methodName:String = "goHome";
    var instance:Object = null;
    var method:Function = terugF;
    var wasSuccessful:Boolean =
    ExternalInterface.addCallback(methodName, instance, method);
    var txtField:TextField = this.createTextField("txtField",
    this.getNextHighestDepth(), 0, 0, 200, 50);
    txtField.border = true;
    txtField.text = "ExternalInterface.addCallback =
    "+wasSuccessful.toString();
    Somehow the ExternalInterface doesn't seem to get loaded. Any
    suggestions to solve this?
    Thanks in advance.
    Yours,
    Andra
    P.S.
    The condition
    if (_root._currentframe > 1){ doesn't work on a PC
    either. It always calls
    _root.terug.onRelease(). I can't figure out why...

    Woops!! I guess I wasn't paying enough attention...
    On a mac using Internet Explorer, both
    ExternalInterface.available and
    ExternalInterface.addCallback return false. Using the back
    button does reload Page A into the Iframe, but doesn't execute any
    AS-functions.
    Using Safari, they both return true. However, using the back
    button reloads the entire index.html instead of loading Page A back
    into the Iframe. This means the flash-movie is reloaded aswell, so
    you're automatically back at frame 1.
    Is there any way I could get this working properly?
    Yours,
    Andra

  • Webutil_file_transfer.as_to_client_with_progress returns false

    Hi,
    I have the following problem: I want to transfer a file from the application server to the client. I use the following code:
    DECLARE
    l_cache_filename VARCHAR2(150) := 'Q:\OracleReportsTemp\123.html';
    l_report_desname VARCHAR2(150) := 'C:\pcedownload\456.html';
    BEGIN
    IF NOT webutil_file_transfer.is_as_readable(l_cache_filename)
    THEN
    message('error in configuration');
    ELSE
    IF NOT webutil_file_transfer.as_to_client_with_progress(l_report_desname, l_cache_filename, 'Transferring to '||l_report_desname, 'Transferring to '||l_report_desname)
    THEN
    message('error while transferring');
    END IF;
    END IF;
    END;
    The file Q:\OracleReportsTemp\123.html exists on the application server and the directory C:\pcedownload exists on the client PC.
    This is the extract from webutil.cfg from the application server:
    transfer.database.enabled=FALSE
    transfer.appsrv.enabled=TRUE
    transfer.appsrv.workAreaRoot=Q:\OracleReportsTemp
    transfer.appsrv.accessControl=TRUE
    transfer.appsrv.read.1=Q:\OracleReportsTemp
    Although this code works fine on my local OC4J, webutil_file_transfer.as_to_client_with_progress always return FALSE on the Application Server. The function webutil_file_transfer.is_as_readable returns true on both environments. Other webutil function such as client_text_io also work fine on both environments.
    Versions:
    Forms 10g Release 2
    Application Server 10g Release2 using OID and SSL
    Webutil 1.0.6
    Jinitiator 1.3.1.22

    Hi,
    You can try as follows in your webutil.cfg file:
    transfer.database.enabled=TRUE
    transfer.appsrv.enabled=TRUE
    transfer.appsrv.workAreaRoot=
    transfer.appsrv.accessControl=FALSE
    transfer.appsrv.read.1=
    transfer.appsrv.write.1=
    In formsweb.cfg you might have:
    [webutil]
    WebUtilArchive=frmwebutil.jar,jacob.jar
    WebUtilLogging=off
    WebUtilLoggingDetail=normal
    WebUtilErrorMode=Alert
    WebUtilDispatchMonitorInterval=5
    WebUtilTrustInternal=true
    WebUtilMaxTransferSize=16384
    baseHTMLjinitiator=webutiljini.htm
    baseHTMLjpi=webutiljpi.htm
    archive_jini=frmall_jinit.jar,frmwebutil.jar,jacob.jar
    archive=frmall.jar
    lookAndFeel=oracle
    userid=user/pwd@mbcprod10g
    width=100%
    height=100%
    then try with the following link:
    http://localhost:8889/forms/frmservlet?config=webutil&form=<Form_Name>
    Hopefully it will work.
    Regards
    Kausar Iqbal

  • How to Check for Default Applet Selection

    Hello all,
    I'm new to the Java Card world, so I'll warn you in advance my questions will be basic. I appreciate your willingness to help us newbies out.
    I've been given a smart card and applets to dissect an reverse engineer. Currently, Applet 1 is loaded onto the card. I've tried installing the Wallet demo applet onto the card, and by all accounts it appears the applet has loaded. However, I cannot select the Wallet demo applet, but I can send APDU commands to Applet 1.
    How can I check to see if Applet 1 is selected by default? My thought is that Applet 1, or Global Platform (2.1.1) has locked down selecting another applet.
    Any suggestions are greatly appreciated.
    Thanks,
    Collin

    Ok, but as per specification applet selection should still be handed by the OS before it hands them to the default selected Applet. The default selected Applet should not be able to block SELECT by Name. It does however receive the APDU if no selection could take place.
    If this card has Global Platform installed you could post the output of some GET INFO APDU's to see what is installed on the card. You will need to authenticate to the cardmanager to get permission though.

  • SELECT returns no result when there is a default namespace definition inXML

    Hi,
    I have a problem that my select doesn't return any result when there is a default namespace definition in my XML file.
    I'm using oracle 11g release 1
    XML file stored as a binary XML:
    <SIMS xmlns="http://sims.ics.muni.cz" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://sims.ics.muni.cz jh_sims_matricni_vystupy_or.xsd">
    <Vystup Datum="2006-07-18" Typ="2" Nazev="Poslední etapy" PocetStudentu="1" PocetStudii="2">
    <Student RodneCislo="8001011001">
    <Jmeno>Petr</Jmeno>
    </Student>
    </Vystup>
    </SIMS>
    This select return no result:
    SELECT student.jmeno FROM jh_sims_bin_no_schema s, XMLTable('/SIMS/Vystup/Student' PASSING s.OBJECT_VALUE COLUMNS jmeno VARCHAR2(10) PATH 'Jmeno') student
    When I remove default namespace definition (xmlns="http://sims.ics.muni.cz") everything works fine and the same SELECT returns "Petr". Also when the file is stored in object relational storage everything works fine!
    <SIMS xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://sims.ics.muni.cz jh_sims_matricni_vystupy_or.xsd">
    <Vystup Datum="2006-07-18" Typ="2" Nazev="Poslední etapy" PocetStudentu="1" PocetStudii="2">
    <Student RodneCislo="8001011001">
    <Jmeno>Petr</Jmeno>
    </Student>
    </Vystup>
    </SIMS>
    Thanks for any help!
    Jan Hruby

    Hi Jan,
    You need to specify the default namespace of the document in the XMLNamespaces clause :
    SELECT student.jmeno
    FROM jh_sims_bin_no_schema s,
         XMLTable(
          XMLNamespaces(default 'http://sims.ics.muni.cz'),
          '/SIMS/Vystup/Student'
          PASSING s.OBJECT_VALUE
          COLUMNS jmeno VARCHAR2(10) PATH 'Jmeno'
         ) student
    ;

  • The mkdir() function in java returning false. Why?

    I am trying to create the folder archive under the following directory structure:
    E:/preweb/CATest/DL/Zipra Internal/EventCompletion/html/archive/
    using the boolean mkdir() function in java.
    Though the folder archive does not exist under html folder, still the function is returning false.
    Canm someone let me know why?

    And you have checked that by using
    File file =// E:/preweb/CATest/DL/Zipra Internal/EventCompletion/html/archive/
    Sys.out.println( file.getParentFile().exists() );

  • File.exists() returns false for existing file, help :)

    Hi all,
    I'm having the STRANGEST behavior... I'm working on a simple DNS management system, and before I overwrite a zone file, I want to check if it exists... but exists() is returning false even when the file exists.
    Here is my code snippet:
    finest( "Checking the existance of "+filename ) ;
    File zoneFile = new File( filename ) ;
    if ( zoneFile.exists() ) {
        finest( "Zone File "+zoneFile+" already exists." ) ;
        throw( new ZoneFileExistsException( fqdn ) ) ;
    else {
        finest( "Creating Zone File "+zoneFile ) ;
        ...It's producing this in the log (I cut off the timestamp parts):
    Checking the existance of /opt/DNS/db.testingbutler222.com
    Creating Zone File /opt/DNS/db.testingbutler222.com
    but...
    # ls -l /opt/DNS/db.testingbutler222.com
    -rw-r--r-- 1 root other 733 Aug 27 19:23 /opt/DNS/db.testingbutler222.com
    So... as you can see, the file CLEARLY exists... what the heck am I doing wrong or misunderstanding? This can't really be a bug in File, can it?
    Kenny Smith

    Hi,
    Thanks for your response, but as I showed in my first post, I'm using absolute paths. My log file contains this:
    Checking the existance of /opt/DNS/db.testbutler222.com...
    Existance of /opt/DNS/db.testbutler222.com=false
    # ls -l /opt/DNS/db.testbutler222.com
    -rw-r--r-- 1 root other 695 Aug 29 12:17 /opt/DNS/db.testbutler222.com
    I don't understand what is happening... I wrote a separate class that just tests the existance of a file, and that one is reporting the existance correctly.... (the source code is found in the second post above) I don't understand why my servlet code can see the file.
    I have jakarta-tomcat running as root, and the file I'm checking was created by the same servlet. I've double checked permissions and such, just to make sure it wasn't that.. but it's still not working.
    I even added code to create a FileReader from the file, that way if it throws a FileNotFoundException, I would know the file doesn't exist... and even though the file does exist, it throws the exception. :(
    Kenny

  • File.exists() returns false even when the file exists

    hi,
    the exists() function of java.io.File function returns false even when the file exists on the file system. why is this? i checked the path of the file which gives me the correct path, but exists returns false. can anyone help?

    post some of the code you�re using - then maybe I can help you out
    //Anders

Maybe you are looking for