Error with ARRAY- ArrayDescriptor

Hi!
I've a very weird error with an application built in JDeveloper 10G 10.1.2.2.0 (Build 1929). I need to call an store procedure and pass an ARRAY parameter. To do so, I just
      Connection conn = callStoredProcPST.getConnection();    
      ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor( "NUM_ARRAY", conn );                 
      ARRAY array_to_pass = new ARRAY( descriptor, conn, P_LISTTYPE );    
      callStoredProcPST.setArray(2, array_to_pass);and works perfectly if I run it from JDev. However, if I deploy such application in OAS 10.1.2.0.2 I got an exception:
java.lang.NullPointerException
     at oracle.jdbc.driver.PhysicalConnection.isDescriptorSharable(PhysicalConnection.java:5025)
     at com.evermind.sql.OracleConnectionBCELProxy__oracle_jdbc_driver_T4CConnection__SQLBCELProxy.isDescriptorSharable()
     at oracle.sql.ARRAY.<init>(ARRAY.java:118)I redeploy the ADF installer in the server but that doesn't work. I am sure that this is some kind of problem with the jars between my local JDev and OAS.
Do you have any idea about this?
Best regards,
Gerardo

Ok, I solved the problem.
After the connection opened my code executed the following sql "+ALTER SESSION SET CONSTRAINTS=DEFERRED+", it made all the deferrable constraints deferred.
Yair

Similar Messages

  • Java.sql.SQLException: Internal Error with oracle.sql.ARRAY getArray()

    hi,
    I am having having problems with the getArray() of oracle.sql.ARRAY.
    Here are the details:
    Oracle Database - 9.2.0.6. The JDBC driver used -10.2.0.1 jar.(the latest available).
    I am calling a stored procedure from java, that has out param as a collection (VARRAY) of a user defined type.
    The stored procedure works fine, if the user/schema used to connect,contains actual type, and i am able to extract the user defined object from the oracle.sql.ARRAY, via getArray().
    But if i use a different user to connect which has public synonyms and execute rights to the actual type, i get the following error:
    java.sql.SQLException: Internal Error
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName(OracleTypeCOLLECTION.java:1026)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttributeType(OracleTypeCOLLECTION.java:1056)
         at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:110)
         at oracle.jdbc.oracore.OracleTypeADT.createStructDescriptor(OracleTypeADT.java:2262)
         at oracle.jdbc.oracore.OracleTypeADT.unpickle81(OracleTypeADT.java:1656)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81UPT(OracleTypeUPT.java:466)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81rec(OracleTypeUPT.java:416)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody_elems(OracleTypeCOLLECTION.java:979)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody(OracleTypeCOLLECTION.java:923)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81(OracleTypeCOLLECTION.java:743)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION._unlinearize(OracleTypeCOLLECTION.java:242)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize(OracleTypeCOLLECTION.java:208)
         at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescriptor.java:963)
         at oracle.sql.ARRAY.getArray(ARRAY.java:370)
    The problem is happening because we have 2 different users to connect to the database. one is the dba user, which contains all the types, packages and other one the application user, which we are supposed to use, to connect via java. This application user does have access to types via public synonym, but it gives the above mentioned error.
    Please help :(.
    Regards,
    Gaurav.

    Hi avi,
    Even I am getting the same error inspite of preceding the type name with the same user who has created the type.
    It has displayed the array length.When I am trying to fetch each array, I am getting the error.
    ARRAY simpleArray = (ARRAY) cs.getObject(3);          
    System.out.println("Array is of length " + simpleArray.length());          ********************** The above stmt prints 2 records ******************
    But it goes to exception in the foll stmt..
    Object [] objArrStructArray = null;
    try{
         objArrStructArray = (Object[]) simpleArray.getArray();
    }catch(SQLException e){
         e.printStackTrace();
    Do u know abt this?
    The foll is the error which I am getting.
    java.sql.SQLException: Internal Error
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName(OracleTypeCOLLECTION.java:1026)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttributeType(OracleTypeCOLLECTION.java:1056)
         at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:110)
         at oracle.jdbc.oracore.OracleTypeADT.createStructDescriptor(OracleTypeADT.java:2262)
         at oracle.jdbc.oracore.OracleTypeADT.unpickle81(OracleTypeADT.java:1656)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81UPT(OracleTypeUPT.java:466)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81rec(OracleTypeUPT.java:416)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody_elems(OracleTypeCOLLECTION.java:979)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody(OracleTypeCOLLECTION.java:923)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81(OracleTypeCOLLECTION.java:743)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION._unlinearize(OracleTypeCOLLECTION.java:242)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize(OracleTypeCOLLECTION.java:208)
         at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescriptor.java:963)
         at oracle.sql.ARRAY.getArray(ARRAY.java:353)
         at com.telstra.plo.data.NetworkDAO.findCablesInBuffer(NetworkDAO.java:730)
         at com.telstra.plo.data.NetworkDAOTest.testFindCablesInBuffer(NetworkDAOTest.java:45)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    Thanks
    Archana

  • Property List error: Unexpected character b at line 1 / JSON error: JSON text did not start with array or object and option to allow fragments not set.

    Hi,
    I have a MBP 13' Late 2011 and Yosemite 10.10.2 (14C1514).
    Until yesterday, I was using Garmin ConnectIQ SDK and all was working fine.
    Yesterday, I've updated my system with latest security updates and Xcode updates too (Version 6.2 (6C131e)).
    Since, I can't launch the ConnectIQ simulator app, I have this message in console :
    8/04/2015 15:19:04,103 mds[38]: There was an error parsing the Info.plist for the bundle at URL Info.plist -- file:///Volumes/Leto/connectiq-sdk-mac-1.1.0_2/ios/ConnectIQ.bundle/
    The data couldn’t be read because it isn’t in the correct format.
    <CFBasicHash 0x7fa64f44e9a0 [0x7fff7dfc7cf0]>{type = immutable dict, count = 2,
    entries =>
      0 : <CFString 0x7fff7df92580 [0x7fff7dfc7cf0]>{contents = "NSDebugDescription"} = <CFString 0x7fa64f44f0a0 [0x7fff7dfc7cf0]>{contents = "Unexpected character b at line 1"}
      1 : <CFString 0x7fff7df9f5e0 [0x7fff7dfc7cf0]>{contents = "kCFPropertyListOldStyleParsingError"} = Error Domain=NSCocoaErrorDomain Code=3840 "The data couldn’t be read because it isn’t in the correct format." (Conversion of string failed.) UserInfo=0x7fa64f44eda0 {NSDebugDescription=Conversion of string failed.}
    I have looked at this file and it looks like a binary plist
    bplist00ß^P^V^A^B^C^D^E^F^G^H
    ^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_ !"$%&'()'+,^[\CFBundleNameWDTXcodeYDTSDKName_^P^XNSHumanReadableCopyrightZDTSDKBuild_^P^YCFBundleDevelopmentRegion_^P^OCFBundleVersi    on_^P^SBuildMachineOSBuild^DTPlatformName_^P^SCFBundlePackageType_^P^ZCFBundleShortVersionString_^P^ZCFBundleSupportedPlatforms_^P^]CFBundleInfoDictionaryVersion_^P^RCFBundleE    xecutableZDTCompiler_^P^PMinimumOSVersion_^P^RCFBundleIdentifier^UIDeviceFamily_^P^QDTPlatformVersion\DTXcodeBuild_^P^QCFBundleSignature_^P^ODTPlatformBuildYConnectIQT0611[iph    oneos8.1o^P-^@C^@o^@p^@y^@r^@i^@g^@h^@t^@ ^@©^@ ^@2^@0^@1^@5^@ ^@G^@a^@r^@m^@i^@n^@.^@ ^@A^@l^@l^@ ^@r^@i^@g^@h^@t^@s^@ ^@r^@e^@s^@e^@r^@v^@e^@d^@.V12B411RenQ1V14C109Xiphoneos    TBNDLS1.0¡#XiPhoneOSS6.0YConnectIQ_^P"com.apple.compilers.llvm.clang.1_0S8.1_^P^Tcom.garmin.ConnectIQ¡*^P^AW6A2008aT????^@^H^@7^@D^@L^@V^@q^@|^@<98>^@ª^@À^@Ï^@å^A^B^A^_^A?^AT^    A_^Ar^A<87>^A<96>^Aª^A·^AË^AÝ^Aç^Aì^Aø^BU^B\^B_^Ba^Bh^Bq^Bv^Bz^B|^B<85>^B<89>^B<93>^B¸^B¼^BÓ^BÕ^B×^Bß^@^@^@^@^@^@^B^A^@^@^@^@^@^@^@-^@^@^@^@^@^@^@^@^@^@^@^@^@^@^Bä
    I guess it is a normal format but my system seems to be unable to read binary plist ?
    I tried some stuff with plutil
    plutil -lint Info.plist
    Info.plist: Unexpected character b at line 1
    Same for convert
    plutil -convert xml1 Info.plist
    Info.plist: Property List error: Unexpected character b at line 1 / JSON error: JSON text did not start with array or object and option to allow fragments not set.
    I also try to download a fresh version of the connectIQ SDK and no changes.
    Any idea ?
    Thanks

    Step by step, how did you arrive at seeing this agreement?

  • What are right parameter types of ODCIIndexInsert in case of creating indextype WITH ARRAY DML option (documentation mismatch)

    Hello.
    During developing Domain Index for Oracle 11.2.0.1.0 (problem also appears in 12с) i was faced with misunderstanding of parameter types of function
    ODCIIndexInsert in case of creating indextype  WITH ARRAY DML option
    According to Oracle documentation
    http://docs.oracle.com/cd/E11882_01/appdev.112/e10765/ext_idx_ref.htm#i76892
    In case of  WITH ARRAY DML option Oracle will invoke ODCIIndexInsert with following signature
    FUNCTION ODCIIndexInsert(
      ia ODCIIndexInfo,
      ridlist ODCIRidList,
      newvallist varray_of_column_type,
      env ODCIEnv)
    RETURN NUMBER
    In my case indexed column has datatype NUMBER so i defined varray_of_column_type as SYS.ODCINumberList
    STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, ridlist in sys.ODCIRidList,  newvallist in sys.ODCINumberList, env in SYS.ODCIEnv) RETURN NUMBER
    Indextype was created as
    CREATE INDEXTYPE test_index_type
    FOR
    test_eq(number, number)
    USING index_methods
    WITH ARRAY DML(number, sys.ODCINumberList)
    WITH LOCAL RANGE PARTITION
    WITH SYSTEM MANAGED STORAGE TABLES;
    or
    CREATE INDEXTYPE test_index_type
    FOR
    test_eq(number, number)
    USING index_methods
    WITH ARRAY DML
    WITH LOCAL RANGE PARTITION
    WITH SYSTEM MANAGED STORAGE TABLES;
    (problem occurs in all cases)
    CREATE TABLE test_table (id NUMBER (19,0));
    CREATE INDEX test_index ON test_table(id) INDEXTYPE IS test_index_type;
    When attempting to insert data in the table
    insert into test_table values (1);
    oracle raise exception
    Error starting at line 53 in command:
    insert into test_table values (1)
    Error at Command Line:53 Column:1
    Error report:
    SQL Error: ORA-29925: cannot execute SCOTT.INDEX_METHODS.ODCIINDEXINSERT
    ORA-06553: PLS-306: wrong number or types of arguments in call to 'ODCIINDEXINSERT'
    ORA-06553: PLS-306: wrong number or types of arguments in call to 'ODCIINDEXINSERT'
    29925. 00000 -  "cannot execute %s"
    *Cause:    The specified function does not exist or does not have an
               appropriate signature.
    *Action:   Implement the function with the appropriate signature.
    So my question is.
    Is it normal behavior  of oracle (according to documentation)?
    What is correct signature of ODCIIndexInsert function in case of INDEXTYPE creation with 'WITH ARRAY DML' option and fact that indexed column has NUMBER datatype?
    By the way if i define indextype without 'WITH ARRAY DML' option signature is clear, and working. But this approach doesn't satisfies our performance needs.
    Also if i define index type with option 'WITH ARRAY DML WITHOUT COLUMN DATA' and use signature
    static function ODCIIndexInsert(ia sys.odciindexinfo,   ridlist sys.odciridlist, env sys.ODCIEnv) return number
    Everything works too. But this approach doesn't satisfies our business needs.
    Is it a way to define ODCIIndexInsert  parameter types (in case of indexing number column)  so that batch inserting works according to documentation ?
    FUNCTION ODCIIndexInsert(
          ia ODCIIndexInfo,
          ridlist ODCIRidList,
          newvallist varray_of_column_type,
          env ODCIEnv)
    I am attaching full sql script to recreate environment and reproduce the problem.
    Type definition:
    CREATE OR REPLACE TYPE index_methods AS OBJECT
      step number,
      STATIC FUNCTION ODCIGetInterfaces(ifclist OUT SYS.ODCIObjectList) RETURN NUMBER,
      STATIC FUNCTION ODCIIndexCreate (ia SYS.ODCIIndexInfo, parms VARCHAR2, env SYS.ODCIEnv) RETURN NUMBER,
      STATIC FUNCTION ODCIIndexAlter (ia sys.ODCIIndexInfo, parms IN OUT VARCHAR2, altopt number, env sys.ODCIEnv) RETURN NUMBER,
      STATIC FUNCTION ODCIIndexDrop(ia SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
      STATIC FUNCTION ODCIIndexExchangePartition(ia SYS.ODCIIndexInfo, ia1 SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
      STATIC FUNCTION ODCIIndexUpdPartMetadata(ia sys.ODCIIndexInfo, palist sys.ODCIPartInfoList, env sys.ODCIEnv) RETURN NUMBER,
      STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, ridlist in sys.ODCIRidList,  newvallist in sys.ODCINumberList, env in SYS.ODCIEnv) RETURN NUMBER,
      STATIC FUNCTION ODCIIndexDelete(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, env SYS.ODCIEnv) RETURN NUMBER,
      STATIC FUNCTION ODCIIndexUpdate(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, newval number, env SYS.ODCIEnv) RETURN NUMBER,
      STATIC FUNCTION ODCIIndexStart(sctx IN OUT index_methods, ia SYS.ODCIIndexInfo,
        op SYS.ODCIPredInfo, qi sys.ODCIQueryInfo, strt number, stop number, cmpval number, env SYS.ODCIEnv) RETURN NUMBER,
      MEMBER FUNCTION ODCIIndexFetch(self IN OUT index_methods, nrows NUMBER, rids OUT SYS.ODCIridlist, env SYS.ODCIEnv) RETURN NUMBER,
      MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER
    CREATE OR REPLACE TYPE BODY index_methods IS
    STATIC FUNCTION ODCIGetInterfaces(ifclist OUT sys.ODCIObjectList) RETURN NUMBER IS
    BEGIN
      ifclist := sys.ODCIObjectList(sys.ODCIObject('SYS','ODCIINDEX2'));
      RETURN ODCIConst.Success;
    END ODCIGetInterfaces;
    STATIC FUNCTION ODCIIndexCreate (ia sys.ODCIIndexInfo, parms VARCHAR2,  env sys.ODCIEnv) RETURN NUMBER IS
    BEGIN
      RETURN ODCIConst.Success;
    END ODCIIndexCreate;
    STATIC FUNCTION ODCIIndexDrop(ia sys.ODCIIndexInfo, env sys.ODCIEnv) RETURN NUMBER IS
    BEGIN
      RETURN ODCIConst.Success;
    END ODCIIndexDrop;
    STATIC FUNCTION ODCIIndexAlter (
      ia sys.ODCIIndexInfo,
      parms IN OUT VARCHAR2,
      altopt NUMBER,
      env sys.ODCIEnv)
    RETURN NUMBER IS
    BEGIN
      RETURN ODCIConst.Success;
    END ODCIIndexAlter;
    STATIC FUNCTION ODCIIndexUpdPartMetadata(
      ia sys.ODCIIndexInfo,
      palist sys.ODCIPartInfoList,
      env sys.ODCIEnv)
    RETURN NUMBER IS
    BEGIN
      RETURN ODCIConst.Success;
    END ODCIIndexUpdPartMetadata;
    STATIC FUNCTION ODCIIndexExchangePartition(
      ia sys.ODCIIndexInfo,
      ia1 sys.ODCIIndexInfo,
      env sys.ODCIEnv)
    RETURN NUMBER IS
    BEGIN
      RETURN ODCIConst.Success;
    END ODCIIndexExchangePartition;
    STATIC FUNCTION ODCIIndexInsert(
       ia sys.ODCIIndexInfo,
       ridlist sys.ODCIRidList,
       newvallist sys.ODCINumberList,
       env sys.ODCIEnv)
    RETURN NUMBER IS
    BEGIN
      return ODCIConst.Success;
    END;
    STATIC FUNCTION ODCIIndexDelete(
       ia SYS.ODCIIndexInfo,
       rid VARCHAR2,
       oldval number,
       env SYS.ODCIEnv)
    RETURN NUMBER IS
    BEGIN
      return ODCIConst.Success;
    END;
    STATIC FUNCTION ODCIIndexUpdate(
       ia SYS.ODCIIndexInfo,
       rid VARCHAR2,
       oldval number,
       newval number,
       env SYS.ODCIEnv)
    RETURN NUMBER AS
    BEGIN
      return ODCIConst.Success;
    END;
    STATIC FUNCTION ODCIIndexStart(
      sctx IN OUT index_methods,
      ia SYS.ODCIIndexInfo,
      op SYS.ODCIPredInfo,
      qi sys.ODCIQueryInfo,
      strt number,
      stop number,
      cmpval  number,
      env SYS.ODCIEnv)
    RETURN NUMBER AS
    BEGIN
      sctx := index_methods(1);
      return ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIIndexFetch(
      self IN OUT index_methods,
      nrows NUMBER,
      rids OUT SYS.ODCIridlist,
      env SYS.ODCIEnv)
    RETURN NUMBER AS
    BEGIN
      return ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER AS
    BEGIN
      return ODCIConst.Success;
    END;
    end;
    Problem workaround:
    --drop function test_eq_fun;
    CREATE FUNCTION test_eq_fun(a number, b number) RETURN NUMBER AS
    BEGIN
      IF a = b then
        RETURN 1;
      ELSE
        RETURN 0;
      END IF;
    END;
    --drop operator test_eq;
    CREATE OPERATOR test_eq
    BINDING (number, number) RETURN NUMBER
    USING test_eq_fun;
    --drop indextype test_index_type;
    CREATE INDEXTYPE test_index_type
    FOR
    test_eq(number, number)
    USING index_methods
    WITH ARRAY DML(number, sys.ODCINumberList)
    WITH LOCAL RANGE PARTITION
    WITH SYSTEM MANAGED STORAGE TABLES;
    CREATE INDEXTYPE test_index_type
    FOR
    test_eq(number, number)
    USING index_methods
    WITH ARRAY DML
    WITH LOCAL RANGE PARTITION
    WITH SYSTEM MANAGED STORAGE TABLES;
    --drop table test_table;
    CREATE TABLE test_table (id NUMBER (19,0));
    CREATE INDEX test_index ON test_table(id) INDEXTYPE IS test_index_type;
    insert into test_table values (1);

    I get single for 1 row and batch for 2 or more rows in the following simplified simulation.
    SCOTT@orcl12c> DESC SYS.ODCINUMBERLIST
    SYS.ODCINUMBERLIST VARRAY(32767) OF NUMBER
    SCOTT@orcl12c> CREATE OR REPLACE TYPE index_methods AS OBJECT
      2  (
      3    step number,
      4    STATIC FUNCTION ODCIGetInterfaces(ifclist OUT SYS.ODCIObjectList) RETURN NUMBER,
      5    STATIC FUNCTION ODCIIndexCreate (ia SYS.ODCIIndexInfo, parms VARCHAR2, env SYS.ODCIEnv) RETURN NUMBER,
      6    STATIC FUNCTION ODCIIndexAlter (ia sys.ODCIIndexInfo, parms IN OUT VARCHAR2, altopt number, env sys.ODCIEnv) RETURN NUMBER,
      7    STATIC FUNCTION ODCIIndexDrop(ia SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
      8    STATIC FUNCTION ODCIIndexExchangePartition(ia SYS.ODCIIndexInfo, ia1 SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
      9    STATIC FUNCTION ODCIIndexUpdPartMetadata(ia sys.ODCIIndexInfo, palist sys.ODCIPartInfoList, env sys.ODCIEnv) RETURN NUMBER,
    10    STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, rid in VARCHAR2,  newval in NUMBER, env in SYS.ODCIEnv) RETURN NUMBER,
    11    STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, ridlist in sys.ODCIRidList,  newvallist in your_type, env in SYS.ODCIEnv) RETURN NUMBER,
    12    STATIC FUNCTION ODCIIndexDelete(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, env SYS.ODCIEnv) RETURN NUMBER,
    13    STATIC FUNCTION ODCIIndexUpdate(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, newval number, env SYS.ODCIEnv) RETURN NUMBER,
    14    STATIC FUNCTION ODCIIndexStart(sctx IN OUT index_methods, ia SYS.ODCIIndexInfo,
    15       op SYS.ODCIPredInfo, qi sys.ODCIQueryInfo, strt number, stop number, cmpval number, env SYS.ODCIEnv) RETURN NUMBER,
    16    MEMBER FUNCTION ODCIIndexFetch(self IN OUT index_methods, nrows NUMBER, rids OUT SYS.ODCIridlist, env SYS.ODCIEnv) RETURN NUMBER,
    17    MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER
    18  );
    19  /
    Type created.
    SCOTT@orcl12c> CREATE OR REPLACE TYPE BODY index_methods IS
      2  STATIC FUNCTION ODCIGetInterfaces(ifclist OUT sys.ODCIObjectList) RETURN NUMBER IS
      3  BEGIN
      4    ifclist := sys.ODCIObjectList(sys.ODCIObject('SYS','ODCIINDEX2'));
      5    RETURN ODCIConst.Success;
      6  END ODCIGetInterfaces;
      7
      8  STATIC FUNCTION ODCIIndexCreate (ia sys.ODCIIndexInfo, parms VARCHAR2,  env sys.ODCIEnv) RETURN NUMBER IS
      9  BEGIN
    10    RETURN ODCIConst.Success;
    11  END ODCIIndexCreate;
    12
    13  STATIC FUNCTION ODCIIndexDrop(ia sys.ODCIIndexInfo, env sys.ODCIEnv) RETURN NUMBER IS
    14  BEGIN
    15    RETURN ODCIConst.Success;
    16  END ODCIIndexDrop;
    17
    18  STATIC FUNCTION ODCIIndexAlter (
    19    ia sys.ODCIIndexInfo,
    20    parms IN OUT VARCHAR2,
    21    altopt NUMBER,
    22    env sys.ODCIEnv)
    23  RETURN NUMBER IS
    24  BEGIN
    25    RETURN ODCIConst.Success;
    26  END ODCIIndexAlter;
    27
    28  STATIC FUNCTION ODCIIndexUpdPartMetadata(
    29    ia sys.ODCIIndexInfo,
    30    palist sys.ODCIPartInfoList,
    31    env sys.ODCIEnv)
    32  RETURN NUMBER IS
    33  BEGIN
    34    RETURN ODCIConst.Success;
    35  END ODCIIndexUpdPartMetadata;
    36
    37  STATIC FUNCTION ODCIIndexExchangePartition(
    38    ia sys.ODCIIndexInfo,
    39    ia1 sys.ODCIIndexInfo,
    40    env sys.ODCIEnv)
    41  RETURN NUMBER IS
    42  BEGIN
    43    RETURN ODCIConst.Success;
    44  END ODCIIndexExchangePartition;
    45
    46  STATIC FUNCTION ODCIIndexInsert(
    47      ia sys.ODCIIndexInfo,
    48      rid VARCHAR2,
    49      newval NUMBER,
    50      env sys.ODCIEnv)
    51  RETURN NUMBER IS
    52  BEGIN
    53    dbms_output.put_line ('single');
    54    return ODCIConst.Success;
    55  END;
    56
    57  STATIC FUNCTION ODCIIndexInsert(
    58      ia sys.ODCIIndexInfo,
    59      ridlist sys.ODCIRidList,
    60      newvallist your_type,
    61      env sys.ODCIEnv)
    62  RETURN NUMBER IS
    63  BEGIN
    64    dbms_output.put_line ('batch');
    65    return ODCIConst.Success;
    66  END;
    67
    68  STATIC FUNCTION ODCIIndexDelete(
    69      ia SYS.ODCIIndexInfo,
    70      rid VARCHAR2,
    71      oldval number,
    72      env SYS.ODCIEnv)
    73  RETURN NUMBER IS
    74  BEGIN
    75    return ODCIConst.Success;
    76  END;
    77
    78  STATIC FUNCTION ODCIIndexUpdate(
    79      ia SYS.ODCIIndexInfo,
    80      rid VARCHAR2,
    81      oldval number,
    82      newval number,
    83      env SYS.ODCIEnv)
    84  RETURN NUMBER AS
    85  BEGIN
    86    return ODCIConst.Success;
    87  END;
    88
    89  STATIC FUNCTION ODCIIndexStart(
    90    sctx IN OUT index_methods,
    91    ia SYS.ODCIIndexInfo,
    92    op SYS.ODCIPredInfo,
    93    qi sys.ODCIQueryInfo,
    94    strt number,
    95    stop number,
    96    cmpval  number,
    97    env SYS.ODCIEnv)
    98  RETURN NUMBER AS
    99  BEGIN
    100    sctx := index_methods(1);
    101    return ODCIConst.Success;
    102  END;
    103
    104  MEMBER FUNCTION ODCIIndexFetch(
    105    self IN OUT index_methods,
    106    nrows NUMBER,
    107    rids OUT SYS.ODCIridlist,
    108    env SYS.ODCIEnv)
    109  RETURN NUMBER AS
    110  BEGIN
    111    return ODCIConst.Success;
    112  END;
    113
    114  MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER AS
    115  BEGIN
    116    return ODCIConst.Success;
    117  END;
    118  end;
    119  /
    Type body created.
    SCOTT@orcl12c> CREATE FUNCTION test_eq_fun(a number, b number) RETURN NUMBER AS
      2  BEGIN
      3    IF a = b then
      4       RETURN 1;
      5    ELSE
      6       RETURN 0;
      7    END IF;
      8  END;
      9  /
    Function created.
    SCOTT@orcl12c> CREATE OPERATOR test_eq
      2  BINDING (number, number) RETURN NUMBER
      3  USING test_eq_fun
      4  /
    Operator created.
    SCOTT@orcl12c> CREATE INDEXTYPE test_index_type
      2  FOR
      3  test_eq(number, number)
      4  USING index_methods
      5  WITH ARRAY DML(number, your_type)
      6  WITH LOCAL RANGE PARTITION
      7  WITH SYSTEM MANAGED STORAGE TABLES
      8  /
    Indextype created.
    SCOTT@orcl12c> CREATE TABLE test_table (id NUMBER (19,0))
      2  /
    Table created.
    SCOTT@orcl12c> CREATE INDEX test_index ON test_table(id) INDEXTYPE IS test_index_type
      2  /
    Index created.
    SCOTT@orcl12c> insert into test_table values (1)
      2  /
    single
    1 row created.
    SCOTT@orcl12c> insert into test_table
      2  select 2 from dual union all
      3  select 3 from dual
      4  /
    batch
    2 rows created.
    SCOTT@orcl12c> insert into test_table select deptno from dept
      2  /
    batch
    4 rows created.
    SCOTT@orcl12c> insert into test_table select object_id from user_objects
      2  /
    batch
    34 rows created.
    SCOTT@orcl12c>

  • Trouble with arrays

    Hi!
    I have to write a program where you enter a name of a person and his points in a game using arrays. The program stops when you enter -99
    Then the output should be like this
    Person 1 45
    Person 2 89
    Person 30 X
    We have just begun with arrays and i am not so good at it, i don't know what to enter in the brackets []. Can somebody help me? It has a lot of errors
    Here is my program:
    public class GradeArray {
         public static void main(String args[]) {
         String NameArray[] = new String [ 30 ];
         String NumberString;
         int NumberArray[] = new int [ 30 ];
         int ControlExit = 0;
         String output = "Name\t\tPoints\n";
         while (ControlExit == 0) { // start while
         NameArray[] = JOptionPane.showInputDialog(
    null, "Enter the name of the person");
         NumberString = JOptionPane.showInputDialog(
         null, "Enter "+NameArray[]+"'s points(0-100) Enter -99 toExit");
         NumberArray[] = Integer.parseInt(NumberString);
         if (NumberArray[] == -99)
         ControlExit = 1;
         } // end while
         for (int Control = 1; Control <= NumberArray.length; Control++)
         output += NameArray[] + "\t\t" + NumberArray[] + "\n";     
              JTextArea outputArea = new JTextArea();
              outputArea.setText( output );
    JOptionPane.showMessageDialog(null,
    outputArea);
    System.exit( 0 );

    ok, i understand it better but my modified program has still errors
    import javax.swing.*;
    public class GradeArray2 {
    public static void main(String args[]) {
    String NameArray[] = new String [ 30 ];
    String NumberString;
    int Number;
    int NumberArray[] = new int [ 30 ];
    int ControlExit = 0;
    String output = "Name\t\tGrade\n";
    while (ControlExit == 0) { // start while
    Name = JOptionPane.showInputDialog(
    null, "Enter the name of the person");
    Name = NameArray[Name];
    NumberString = JOptionPane.showInputDialog(
    null, "Enter "+NameArray+"'s points(0-100) Enter -99 to Exit");
    Number = Integer.parseInt(NumberString);
    NumberArray[Number] = Number;
    if (NumberArray[Number] == -99)
    ControlExit = 1;
    } // end while
    for (int Control = 1; Control <= NumberArray.length; Control++)
    output += NameArray[Name] + "\t\t" + NumberArray[Number] + "\n";
    JTextArea outputArea = new JTextArea();
    outputArea.setText( output );
    JOptionPane.showMessageDialog(null,
    outputArea);
    System.exit( 0 );
    [\CODE]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Need help with Arrays

    Hey guys, I'm a beginner programmer and I'm having a bit of a tough time with arrays. I could really use some help!
    What I'm trying to do is roll one die and then record the rolls.
    Here is my sample I/O:
    How many times should I roll a die?
    -> 8
    rolling 8 times
    2, 1, 5, 6, 2, 3, 6, 5
    number of 1's: 1
    number of 2's: 2
    and so on....
    Here is my incomplete code at this moment:
    //CountDieFaces.java
    import java.util.Scanner;
    import java.io.*;
    import library.Gamble;
    public class CountDieFaces
        //prompt for and read in: number of times user wants to roll one die
        //simulate rolling a die that many times, counting how many times each face 1 thru 6 comes up
        //print out: each roll
        //AND the total number of times each face occured and the percentage of the time each face occured.
        Scanner scan = new Scanner(System.in);
        int[] faceCount= {0,0,0,0,0,0,0};
        int dice;
        System.out.println("How many times would you like to roll the die?");
        int dieCount = scan.nextInt();
        int dieRoll = Gamble.rollDie(); // Main calling class method
        int count = 1;
        while(count < dieCount)
            System.out.println(faceCount[count]);
            count++;
    }Here is the gamble library:
    //Gamble.java
    package library;
    public class Gamble
         // returns 1, 2, 3, 4, 5, or 6
         public static int rollDie()
              int dieRoll = (int)(Math.random()*6)+1;
              return dieRoll;
    }and here are the errors I have so far:
    ----jGRASP exec: javac -g CountDieFaces.java
    CountDieFaces.java:19: <identifier> expected
         System.out.println("How many times would you like to roll the die?");
         ^
    CountDieFaces.java:19: illegal start of type
         System.out.println("How many times would you like to roll the die?");
         ^
    CountDieFaces.java:25: illegal start of type
         while(count < dieCount)
         ^
    CountDieFaces.java:25: > expected
         while(count < dieCount)
         ^
    CountDieFaces.java:25: ')' expected
         while(count < dieCount)
         ^
    CountDieFaces.java:26: ';' expected
         ^
    CountDieFaces.java:27: illegal start of type
              System.out.println(faceCount[count]);
              ^
    CountDieFaces.java:27: ';' expected
              System.out.println(faceCount[count]);
              ^
    CountDieFaces.java:27: invalid method declaration; return type required
              System.out.println(faceCount[count]);
              ^
    CountDieFaces.java:27: ']' expected
              System.out.println(faceCount[count]);
              ^
    CountDieFaces.java:27: ')' expected
              System.out.println(faceCount[count]);
    I'm really confused with how a the gamble library gets put into the array, so any help is appreciated! Also if anyone could explain the errors to me, I would really appreciate it.
    thanks in advance,
    wootens
    Edited by: Wootens on Oct 18, 2010 8:55 PM

    D'oh!
    Thanks you guys, fixed that. Although I'm having trouble with storing the die roll in the array. Any suggestions?
    java.io.*;
    public class CountDieFaces
        //prompt for and read in: number of times user wants to roll one die
        //simulate rolling a die that many times, counting how many times each face 1 thru 6 comes up
        //print out: each roll
        //AND the total number of times each face occured and the percentage of the time each face occured.
        public static void main(String[] args)
            Scanner scan = new Scanner(System.in);
            int[] faceCount= {0,0,0,0,0,0};
            int dice;
            System.out.println("How many times would you like to roll the die?");
            int dieCount = scan.nextInt();
            int dieRoll = rollDie(); // Main calling class method
            int count = 0;
            while(count < dieCount)
                System.out.println(faceCount[dieRoll]);
                count++;
        public static int rollDie()
            int dieRoll = (int)(Math.random()*6)+1;
            return dieRoll;
    }Wootens

  • Random FB build errors with FXGs

    I'm having issues with random build errors.  When one of these errors occurs, it always says it has trouble with an FXG class. 
    Error text is this:
    "In initializer for 'mxmlContent', type FXGClass is not assignable to target Array element type mx.core.IVisualElement."
    This seems to be a similar problem that someone else posted: http://forums.adobe.com/thread/929171 but their solution didn't work for me.
    The solution from the linked thread, renaming/creating a duplicate of the file with the FXGs in it, didn't work.  Renaming ANOTHER file in my code base did.  One that did not contain FXGs.  (We use subversion and I systematically rolled back until the code base built error free and slowly deduced the affecting file).
    Now occasionally we are having the errors with a completely new file with an FXG icon.  The first file had FXGs delared in MXML, this new one declares it in AS.  Both FXGs are put into the layout via MXML.  Sometimes commenting it out, building, commenting back in, building works....but not always.  If we go edit some code in another file elsewhere, it will sometimes clear the error and build fine. 
    This error is driving us nuts as we have no idea what the trigger is.  We have a fair number of FXGs in the code base for visual elements.  We use common code accross Web, Desktop and Mobile projects.  Sometimes they all build fine, sometimes they all error, sometimes only some projects error.  There seems to be no consistancy when the build errors occur.
    Using Flash Builder 4.6 (on Windows 7)
    Flex SDK 4.6
    AIR SDK 3.3 (though errors occur on a Web build too)
    We've made new Workspaces and brought in the sub-versioned code and it still occurs (on two seperate machines), so it seems to point to a code base trigger.  I'm stumped where to start.  When it first started occuring, no extra FXG files or classes that refer to them were created.
    Any help would be greatly appreciated.

    I've seemed to have narrowed it down the file with the FXG Icon in it.  It seems that when I disclude the file from the project it renders correctly.  If used I get the weird compile errors.  I'm not sure why this specific file is causing this.  I'm concluding it may be a corrupted in some way and I will have to rebuild it from scratch to narrow down the issues.
    Removing the FXG from  the file itself doesn't help. 

  • ADF Mobile: WebService data control method call with array

    JDev 11.1.2.3
    ADF Mobile deployed to Android emulator
    Hello All,
    I am trying to invoke a method in my Web Service data control and get the following exception
    Caused by: ERROR [oracle.adfmf.framework.exception.AdfInvocationRuntimeException] - Cannot serialize: [I@1dbae822
            at oracle.adfmf.dc.ws.soap.SoapTransportLayer.invokeSoapRequest(Lorg/ksoap2/SoapEnvelope;)Ljava/lang/Object;(Unknown Source)
            at oracle.adfmf.dc.ws.soap.SoapWebServiceOperation.invoke(Ljava/lang/String;Loracle/adfmf/dc/ws/soap/SoapGenericType;)Ljava/lang/Object;(Unknown Source)
            at oracle.adfmf.dc.ws.soap.SoapWebServiceOperation.invoke(Ljava/lang/String;Ljava/util/Map;)Ljava/lang/Object;(Unknown Source)
            at oracle.adfmf.dc.JavaBeanOperation.execute(Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;(Unknown Source)
            at oracle.adfmf.dc.ws.WebServiceDataControlAdapter.invokeOperation(Ljava/util/Map;Loracle/adfmf/bindings/OperationBinding;)Z(Unknown Source)
            at oracle.adfmf.bindings.dbf.AmxMethodActionBinding.execute()Ljava/lang/Object;(Unknown Source) This method is an AppModule method exposed as a service interface and the parameter for this method is a List<oracle.jbo.domain.Number>. The schema definition for the input is as follows:
    <element name="acceptTask">
       <complexType>
         <sequence>
                <element maxOccurs="unbounded" minOccurs="0" name="taskID" type="decimal"/>
         </sequence>
       </complexType>
    </element>For the input to my binding, I have tried int[], Integer[] and List<Integer>. All of these result in similar errors.
    I have also tried invoking this through a regular ADF application and that works fine with an int[]. It looks like something specific to the ADF Mobile SOAP layer.
    Is this a bug or a restriction in the framework? Any workarounds that has worked for anyone?

    No luck. A WS DC method call with a simple parameter (java.lang.String or java.lang.Integer) works fine but I can't get it to work when there is an array input.
    I have tried WS methods with int arrays and simple string arrays without any luck. All of them result in a cannot serialize error.
    I can't figure out what I am doing wrong. Are there any working WS Datacontrol samples with array inputs?

  • Problem is detected with Array : 01

    I was backing up my server when it suddenly turned off. When it restarted it showed a critical error message saying "Problem is detected with Array : 01".
    Windows tried starting and kept rebooting so I just turned it off.
    When I launch the RAID utility I clearly see that the drive 02:01 seems ok but the other one is marked as "failed orisconnected" (it is connected ans spinning).
    This is the spec: On the server I have windows 2012R2 installed on two HD 1TB on RAID1.
    I habe an unused NAS, so I decided to create an iSCSI drive as a Target, and run the windows backup utility to do a Full Backup on it.hat may I have done wrong and how could I resolve this issue?
    This clearly is related to the windows backup utility since this server was working fine until then.
    Thanks.

    Hi,
    The issue could be due to that one of the two drive is failed in the RAID 1. You need to replace the failed drive and rebuild the array automatically.
    Best Regards,
    Mandy 
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Run TIme Error Message- Array Out of Bounds Exception

    Good evening all,
    I seem to have a run time error with the below segment of code. I've changed the (args[0]) a variety of ways but still get the same message.
    I have a few questions regarding my methodology. First, am I headed down the right path (no spoonfeeding allowed please! I need to grasp and learn this myself). Second, would it be something causing error that is on another line and I'm not seeing it. Third, should I have added the entire class file?
    public static void main(String [] args) throws IOException
       Inventory store = new Inventory ( 15);  // Sets store inventory
       Scanner inFile = new Scanner(new File(args [0])); // _Line 27 in the program_
       PrintWriter outfile = new PrintWriter(args [1]); 
       String temp; .
       double price; 
       int quantity; .
       inFile.next();
       int x = 0; Run time error received:
    java.lang.ArrayIndexOutOfBoundsException: 0
         at StoreBusiness.main(StoreBusiness.java:27)
    Thank you in advance everyone.

    WarriorGeek wrote:
    Thanks Flounder,
    I feel pretty dumb after posting my answer.
    I read the arrays tutorial and understand all that's described there but with what I've learned you have to start your array out at zero like I did. Should I use the variable name that I gave it in lieu of zero?No. The point is that since you didn't provide any arguments when you started your program, there is no arr[0] or arr[anything else]. It doesn't matter if you put an int literal between the brackets or a variable or a method that returns int. You can't access elements that don't exist.
    So instead of java MyClass you need to do java MyClass something The "something" becomes args[0]. If you're using an IDE instead of the command line, there will be a place to configure what arguments you want to pass when you run your program.

  • Error with - addStylesToDocument(doc); please help

    Hello, this is my unfinished code for a simple program I am writing. Basically I have a menu and buttons, and am looking to add a JTextPane. I think I have all the code there, except when compiling I am having an error with line addStylesToDocument(doc); if I comment this out then nothing happens but the program runs as normal (before I added the JTextPane code) the error I am getting is "non-static method addStylesToDocument(javax.swing.text.StyledDocument) cannot be referenced from a static context" this makes a little sence to me but not enough to be able to correct it as I am pretty much a beginner...
    If anyone has any suggestions to fix this I would appreciate your input.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    public class ShoppingCart extends JPanel
                            implements ActionListener {
        protected JButton bapple, borange, bbanana, bstrawberry, blemon, bgrape, b7, b8, b9, b10;
        public JMenuBar createMenuBar() {
         JMenuBar menuBar;
         JMenu menu, submenu;
         JMenuItem menuItem;
         JRadioButtonMenuItem rbMenuItem;
         JCheckBoxMenuItem cbMenuItem;
    menuBar = new JMenuBar();
    menuBar.setBackground(Color.white);
          menu = new JMenu("A Menu");
          menu.setBackground(Color.white);
            menu.setMnemonic(KeyEvent.VK_A);
            menu.getAccessibleContext().setAccessibleDescription(
                    "The only menu in this program that has menu items");
            menuBar.add(menu);
          //a group of JMenuItems
          menuItem = new JMenuItem("A text-only menu item",
                                     KeyEvent.VK_T);
            //menuItem.setMnemonic(KeyEvent.VK_T); //used constructor instead
             menuItem.setBackground(Color.white);
             menuItem.setAccelerator(KeyStroke.getKeyStroke(
                KeyEvent.VK_1, ActionEvent.ALT_MASK));
           menuItem.getAccessibleContext().setAccessibleDescription(
           "This doesn't really do anything");
            menu.add(menuItem);
            ImageIcon icon = createImageIcon("/orange.gif");
            menuItem = new JMenuItem ("Both text and icon", icon);
            menuItem.setMnemonic(KeyEvent.VK_B);
            menuItem.setBackground(Color.white);
          menu.add(menuItem);
          menuItem = new JMenuItem(icon);
          menuItem.setMnemonic(KeyEvent.VK_D);
          menuItem.setBackground(Color.white);
          menu.add(menuItem);
          //a group of radio button menu items
          menu.addSeparator();
          ButtonGroup group = new ButtonGroup();
          rbMenuItem = new JRadioButtonMenuItem("A radio button menu item");
          rbMenuItem.setSelected(true);
          rbMenuItem.setMnemonic(KeyEvent.VK_R);
          rbMenuItem.setBackground(Color.white);
          group.add(rbMenuItem);
          menu.add(rbMenuItem);
          //a group if check box menu items
          menu.addSeparator();
          cbMenuItem = new JCheckBoxMenuItem("A check box menu item");
          cbMenuItem.setMnemonic(KeyEvent.VK_C);
          cbMenuItem.setBackground(Color.white);
          menu.add(cbMenuItem);
          cbMenuItem = new JCheckBoxMenuItem("Another one");
          cbMenuItem.setMnemonic(KeyEvent.VK_H);
          cbMenuItem.setBackground(Color.white);
          menu.add(cbMenuItem);
          //a submenu
          menu.addSeparator();
          submenu = new JMenu("A submenu");
          submenu.setBackground(Color.white);
          submenu.setMnemonic(KeyEvent.VK_S);
          menuItem = new JMenuItem("An  item in the submenu");
          menuItem.setAccelerator(KeyStroke.getKeyStroke(
          KeyEvent.VK_2, ActionEvent.ALT_MASK));
          menuItem.setBackground(Color.white);
          submenu.add(menuItem);
          menuItem = new JMenuItem("Another item");
          menuItem.setBackground(Color.white);
          submenu.add(menuItem);
          menu.add(submenu);
          //Build second menu in the menu bar
          menu = new JMenu("Another Menu");
          menu.setBackground(Color.white);
          menu.setMnemonic(KeyEvent.VK_N);
          menu.getAccessibleContext().setAccessibleDescription(
          "This menu does nothing");
          menuBar.add(menu); 
    return menuBar;
        public ShoppingCart() {
            ImageIcon appleButtonIcon = createImageIcon("/apple.gif");
            ImageIcon orangeButtonIcon = createImageIcon("/orange.gif");
            ImageIcon bananaButtonIcon = createImageIcon("/banana.gif");
            ImageIcon strawberryButtonIcon = createImageIcon("/strawberry.gif");
            ImageIcon lemonButtonIcon = createImageIcon("/lemon.gif");
            ImageIcon grapeButtonIcon = createImageIcon("/grape.gif");
            bapple = new JButton(null,  appleButtonIcon);
            bapple.setVerticalTextPosition(AbstractButton.CENTER);
            bapple.setBackground(Color.white);
            bapple.setHorizontalTextPosition(AbstractButton.LEADING);
            bapple.setMnemonic(KeyEvent.VK_D);
            bapple.setActionCommand("apple");
            borange = new JButton(null, orangeButtonIcon);
            borange.setVerticalTextPosition(AbstractButton.BOTTOM);
            borange.setBackground(Color.white);
            borange.setHorizontalTextPosition(AbstractButton.CENTER);
            borange.setMnemonic(KeyEvent.VK_M);
            borange.setActionCommand("orange");
            bbanana = new JButton(null, bananaButtonIcon);
            bbanana.setBackground(Color.white);
            bbanana.setMnemonic(KeyEvent.VK_E);
            bbanana.setActionCommand("banana");
            bstrawberry = new JButton(null,  strawberryButtonIcon);
            bstrawberry.setVerticalTextPosition(AbstractButton.CENTER);
            bstrawberry.setBackground(Color.white);
            bstrawberry.setHorizontalTextPosition(AbstractButton.LEADING); //aka LEFT, for left-to-right locales
            bstrawberry.setActionCommand("strawberry");
            blemon = new JButton(null,  lemonButtonIcon);
            blemon.setBackground(Color.white);
            blemon.setVerticalTextPosition(AbstractButton.CENTER);
            blemon.setHorizontalTextPosition(AbstractButton.LEADING); //aka LEFT, for left-to-right locales
            blemon.setActionCommand("lemon");
            bgrape = new JButton(null,  grapeButtonIcon);
            bgrape.setBackground(Color.white);
            bgrape.setVerticalTextPosition(AbstractButton.CENTER);
            bgrape.setHorizontalTextPosition(AbstractButton.LEADING); //aka LEFT, for left-to-right locales
            bgrape.setActionCommand("grape");
            /*b7 = new JButton(null,  leftButtonIcon);
            b7.setVerticalTextPosition(AbstractButton.CENTER);
            b7.setHorizontalTextPosition(AbstractButton.LEADING); //aka LEFT, for left-to-right locales
            b8 = new JButton(null,  leftButtonIcon);
            b8.setVerticalTextPosition(AbstractButton.CENTER);
            b8.setHorizontalTextPosition(AbstractButton.LEADING); //aka LEFT, for left-to-right locales
            b9 = new JButton(null,  leftButtonIcon);
            b9.setVerticalTextPosition(AbstractButton.CENTER);
            b9.setHorizontalTextPosition(AbstractButton.LEADING); //aka LEFT, for left-to-right locales
            b10 = new JButton(null,  leftButtonIcon);
            b10.setVerticalTextPosition(AbstractButton.CENTER);
            b10.setHorizontalTextPosition(AbstractButton.LEADING); //aka LEFT, for left-to-right locales
            //Listen for actions on buttons
            bapple.addActionListener(this);
            borange.addActionListener(this);
            bbanana.addActionListener(this);
            bstrawberry.addActionListener(this);
            blemon.addActionListener(this);
            bgrape.addActionListener(this);
            bapple.setToolTipText("Apple.");
            borange.setToolTipText("Orange.");
            bbanana.setToolTipText("Banana.");
            bstrawberry.setToolTipText("Strawberry.");
            blemon.setToolTipText("Lemon.");
            bgrape.setToolTipText("Grape.");
           /* b7.setToolTipText("7");
            b8.setToolTipText("8");
            b9.setToolTipText("9");
            b10.setToolTipText("10");
            //Add Components to this container, using the default FlowLayout.
            add(bapple);
            add(borange);
            add(bbanana);
            add(bstrawberry);
            add(blemon);
            add(bgrape);
           /* add(b7);
            add(b8);
            add(b9);
            add(b10);*/
        public void actionPerformed(ActionEvent e) {
            if ("apple".equals(e.getActionCommand())) {
           String  input1 =  JOptionPane.showInputDialog( "How many apples would you like to purchase?" );
            int  number1 = Integer.parseInt( input1 );
             if ("orange".equals(e.getActionCommand())) {
           String  input2 =  JOptionPane.showInputDialog( "How many oranges would you like to purchase?" );
           int  number2 = Integer.parseInt( input2 );
               if ("banana".equals(e.getActionCommand())) {
           String  input3 =  JOptionPane.showInputDialog( "How many bananas would you like to purchase?" );
           int  number3 = Integer.parseInt( input3 );
             if ("strawberry".equals(e.getActionCommand())) {
           String  input4 =  JOptionPane.showInputDialog( "Enter weight of strawberries : " );
           int  number4 = Integer.parseInt( input4 );
             if ("lemon".equals(e.getActionCommand())) {
           String  input5 =  JOptionPane.showInputDialog( "How many lemons would you like to purchase?" );
           int  number5 = Integer.parseInt( input5 );
             if ("grape".equals(e.getActionCommand())) {
           String  input6 =  JOptionPane.showInputDialog( "Enter weight of grapes : " );
           int  number6 = Integer.parseInt( input6 );
        /** Returns an ImageIcon, or null if the path was invalid. */
        protected static ImageIcon createImageIcon(String path) {
            java.net.URL imgURL = ShoppingCart.class.getResource(path);
            if (imgURL != null) {
                return new ImageIcon(imgURL);
            } else {
                System.err.println("Couldn't find file: " + path);
                return null;
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
        private static void createAndShowGUI() {
    //Create and set up the window.
            JFrame frame = new JFrame("Shopping Cart");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            ShoppingCart newContentPane = new ShoppingCart();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            newContentPane.setBackground(Color.white);
           frame.setJMenuBar(newContentPane.createMenuBar());
            //Display the window.
            frame.pack();
            frame.setVisible(true);
            String[] initString =
            { /* ...  fill array with initial text  ... */ };
            String[] initStyles =
            { /* ...  fill array with names of styles  ... */ };
            JTextPane textPane = new JTextPane();
            StyledDocument doc = textPane.getStyledDocument();
            addStylesToDocument(doc);
            //Load the text pane with styled text.
            try {
            for (int i=0; i < initString.length; i++) {
            doc.insertString(doc.getLength(), initString,
    doc.getStyle(initStyles[i]));
    } catch (BadLocationException ble) {
    System.err.println("Couldn't insert initial text into text pane.");
    }protected void addStylesToDocument (StyledDocument doc) {
    Style def=new StyleContext ().getStyle (StyleContext.DEFAULT_STYLE);
    Style heading = doc.addStyle ("bold", null);
    StyleConstants.setFontFamily (heading, "SansSerif");
    StyleConstants.setBold (heading, true);
    StyleConstants.setFontSize (heading,30);
    // * The next 3 don't work if that line is commented out
    StyleConstants.setAlignment (heading, StyleConstants.ALIGN_CENTER);
    StyleConstants.setSpaceAbove (heading, 10);
    StyleConstants.setSpaceBelow (heading, 10);
    public static void main() {
    //Schedule a job for the event-dispatching thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();

    CPie wrote:
    o..k.
    I see that you have run out of helpfulness for this session, What the ....? I just told you to add your jtextfield to a jpanel or some other visible component to be seen.
    it is getting late here I will take my business elsewhere tomorrow rather than waiting up for a response which shows you realllly need to find something better to do! And thanks for the help earlier. That was actually useful whereas this wasn't, I'm sure you knew that already,You know that we are all volunteers here. Any time spent here helping you is time away from our friends and families. A little more appreciation is definitely in order or go somewhere else and pay for your help.

  • Error: Non-array passed to JNI array operations

    Can anyone see what I am doing wrong? I am trying to go through the array of objects example in the online JNI text book "The Java Native Interface Programmer's Guide and Specification" by Sheng Liang. The book and pertinent chapter can be found here:
    http://java.sun.com/docs/books/jni/html/objtypes.html#27791
    The error I received on running the program with the -Xcheck:jni switch is this:
    FATAL ERROR in native method: Non-array passed to JNI array operations
         at petes.JNI.ObjectArrayTest.initInt2DArray(Native Method)
         at petes.JNI.ObjectArrayTest.main(ObjectArrayTest.java:14)Without the xcheck switch, I get a huge error log file that I can reproduce here if needed.
    My c code with #ifdef _Debug statements removed for readability is listed below.  The location of the error (I believe) is marked:
    #include <jni.h>
    #include <stdio.h>
    #include "petes_JNI_ObjectArrayTest.h"
    //#define _Debug
    // error found running the program with the -Xcheck:jni switch
    //page 38 and 39 of The Java Native Interface Guide by Sheng Liang
    JNIEXPORT jobjectArray JNICALL Java_petes_JNI_ObjectArrayTest_initInt2DArray
      (JNIEnv *env, jclass class, jint size)
         jobjectArray result;
         jint i;
         jclass intArrCls = (*env)->FindClass(env, "[I");
         if (intArrCls == NULL)
              return NULL;
         result = (*env)->NewObjectArray(env, size, intArrCls, NULL);
         if (result = NULL)
              return NULL; 
         for (i = 0; i < size; i++)
              jint tmp[256]; // make sure it is large enough
              jint j;
              jintArray iarr = (*env)->NewIntArray(env, size);
              if (iarr == NULL)
                   return NULL; 
              for (j = 0; j < size; j++)
                   tmp[j] = i + j;
              (*env)->SetIntArrayRegion(env, iarr, 0, size, tmp);
              (*env)->SetObjectArrayElement(env, result, i, iarr); // ***** ERROR:  Non-array passed to JNI array operations
              (*env)->DeleteLocalRef(env, iarr);
         return result;
    }Here is my java code
    package petes.JNI;
    public class ObjectArrayTest
        private static native int[][] initInt2DArray(int size);
        static
            System.loadLibrary("petes_JNI_ObjectArrayTest");
        public static void main(String[] args)
            int[][] i2arr = initInt2DArray(3);
            if (i2arr != null)
                for (int i = 0; i < i2arr.length; i++)
                    for (int j = 0; j < i2arr[0].length; j++)
                        System.out.println(" " + i2arr[i][j]);
                    System.out.println();
            else
                System.out.println("i2arr is null");
    }Thanks in advance!
    Pete

    Niceguy1: Thanks for the quick reply!
    So far, I mainly see the usual differences between C and C++ JNI calls. Also, in the example you gave, they use a lot of casts, but that doesn't seem to make much difference to my output. Also, in the example, they create a 0-initilized int array, and use this class to initialze the class type of the Object array. I get the class type by a call to FindClass for a class type of "[I".  I'll try this their way and see what happens...
    Edit:  Changing the way I find the array element Object type did not help.  I still get the same error as previous.  Any other ideas would be greatly appreciated.
    Message was edited by:
            petes1234                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • RE: [Adobe Reader] when i open pdf file it open all the pages but some pages give error massage (there was error processing a page,there was a problem reading this document 110) but if i open this page which give me error with google chrome it's work ? i

    HelloThank's for your helpsI hope this document is helpfulBest Regards,
    Date: Sun, 22 Jun 2014 17:10:17 -0700
    From: [email protected]
    To: [email protected]
    Subject:  when i open pdf file it open all the pages but some pages give error massage (there was error processing a page,there was a problem reading this document 110) but if i open this page which give me error with google chrome it's work ? if you can help me th
        when i open pdf file it open all the pages but some pages give error massage (there was error processing a page,there was a problem reading this document 110) but if i open this page which give me error with google chrome it's work ? if you can help m
        created by Anoop9178 in Adobe Reader - View the full discussion
    Hi,
    Would it be possible for you to share the document?
    Regards,
    Anoop
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at https://forums.adobe.com/message/6485431#6485431
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
         To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Adobe Reader by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

    thank's for reply and your help
    i did the step's that you told me but  i still have the same problem
                                     i have the latest v.11.0.7
    i
    i disable the protected mode

  • Odd Error with decode function in Order By Clause

    I am trying to compile a procedure and can't get around an error with a dynamic order by that doesn't make much sense to me. I can repoduce the error with a plain select statment in sql plus so I can rule out a declaration error. Here is an example with 2 numeric columns and a date column.
    select task_id, display_date, remark_id from task_list
    where task_id > 1000
    order by decode('Task_ID', 'Task_ID',Task_ID, 'Display_Date', Display_Date, 'Remark_ID',Remark_ID)
    returns the error:
    select task_id, display_date, remark_id from task_list
    ERROR at line 1:
    ORA-00932: inconsistent datatypes: expected NUMBER got DATE
    I'm not sure why this error is occuring, because it doesn't even hit the Display_Date field in the Decode statment. If I take the Display_date out of the statement, it runs properly. If I change Display_Date to To_Char(Display_Date) it also runs fine, but the sorting is incorrect. Also I'm running 9.2, and do not want to use dynamic sql to build my query. Any Ideas out there as to the cause of this error?

    I did find a workaround to this issue by breaking the decode statment into three separate statement, but I still think that the way it is written above should work, and may be a bug, or an error that I don't understand fully.
    The Order by was rewritten like this:
    order by decode(pSort, 'Task_ID',Task_ID), decode(pSort, 'Display_Date', Display_Date),
    decode(pSort, 'Remark_ID',Remark_ID);
    Thanks

  • XML Publisher Error with reports published in XML publisher

    Hi All,
    I am geting the following error with a report published using XML Publisher
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    The system cannot locate the resource specified. Error processing resource 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.d...
    How can i Rectify this?

    Hi Ark,
    In order to generate a report using xml publisher. we need the following.
    1. XML Data
    2. Template file (RTF/PDF/..)
    XML data will not be created by the template file.
    We will be required to create XML data. One of the easiest way to create xml output is using the RDF. We can change the rdf output type in the concurrent program to XML.
    Once the xml and the template is available, "XML Report Publisher" will be able to generate the output in the required format.
    Thanks,
    K.Nataraja Suthan,

Maybe you are looking for

  • Unable to import with Sony HDV

    I am using the Sony HDV 1080 recorder Model HDR-HC5. I have tried every possible setting, read hours worth of forums, read the user manuals and Googled everything I can think of but I can't get Final cut pro 7.0.1 to log and capture or even see my ca

  • Unrealized Gain/loss from exchange rate

    Hi all, Please i need help , exchange rate fixed is checked in PO ,at the point of MIGO system use  exchange rate in PO.When i check Accounting document in MIGO system Debit Stock account and Credit GR/IR account using exchange rate in PO ,but the di

  • Automatic creation of Transfer Order when a delivery is created

    Hi all , I wanted to have Automatic creation of Transfer Order when a delivery is created , what are the configuration activities that needs to be carried out . Thanks , KSR

  • My macbook pro sat for two days

    It was plugged in, but now will not go past spinning gear. tried safe boot but same thing. tried fsck -fy and same thing. can hear things moving, but seems like the fan is kicking in a lot. any help would be appreciated.

  • SRM monitors

    Hi, For som odd reson we are getting this error in out monitors, but we cant seem to find anything wrong in the system. "Error reading the export data for transfer of purchase order     " Anybody know what is causing this error in the monitor? SRM 5.