Bug in XMLParserCover Package? - PL/SQL XML Programming

xmlparsercover.parseDTDBuffer in PLSQL is defined as:
PROCEDURE parseDTDBuffer(id number, dtd varchar2, root varchar2, err in out varchar2)
is language java name 'oracle.xml.parser.plsql.XMLParserCover.parseDTDBuffer
(int, java.lang.String, java.lang.String, java.lang.String[])';
in the provided jar file XMLPLSQL.JAR it is defined ad:
parseDTDBuffer(int, oracle.sql.CHAR, java.lang.String, java.lang.String[]);
the second parameter in pl is java.lang.String and in the java source it is oracle.sql.CHAR so i can't call the method.
--------------------
Is the workaround to correct the plsql like this ok?
PROCEDURE parseDTDBuffer(id number, dtd varchar2, root varchar2, err in out varchar2)
is language java name 'oracle.xml.parser.plsql.XMLParserCover.parseDTDBuffer
(int, oracle.sql.CHAR, java.lang.String, java.lang.String[])';
or is there an newer version without this bug? 

Which database do you use? what is the XDK version?

Related

Java Stored proc problem

When I am trying to create a procedure with below details gives the following errors:
create or replace
Procedure test ( id IN NUMBER,
i IN NUMBER,
j IN VARCHAR2,
ret1 OUT NUMBER,
ret2 OUT VARCHAR2,
k IN NUMBER) AS
LANGUAGE JAVA NAME 'com.fn.oracle.proc.trading.TestProcedure.testIt(int, double, java.lang.String, int, java.lang.String, int)';
PL/SQL: Compilation unit analysis terminated
PLS-00235: the external type is not appropriate for the parameter
Please help me on this..
Thank you.... 
The problem is with the OUT parameters. If you read the documentation you will see that OUT parameters
need to be declared as one element arrays. Hence this should compile:
CREATE OR REPLACE PROCEDURE TEST ( id IN NUMBER,
i IN NUMBER,
j IN VARCHAR2,
ret1 OUT NUMBER,
ret2 OUT VARCHAR2,
k IN NUMBER) AS
LANGUAGE JAVA NAME 'com.fn.oracle.proc.trading.TestProcedure.testIt(int, double, java.lang.String, int[], java.lang.String[], int)';Cheers, APC

Calling the Java Method in PL/SQL Java Stored procedure errors out

Hi,
I could not find a suitable thread to post my PL/SQL question so iam posting it here.........
I have written a java class by name XYZ which has a method ABC for which there are 9 arguements being passed and its a VOID method.
This java class has been loaded into ORACLE using DBMS_JAVA.LOADJAVA pkg, Now this class is being called in the oracle as a JAVA Stored procedure...... When ever im trying to call the procedure it throws the following error
ORA-29531: no method
*Cause:    An attempt was made to execute a non-existent method in a
Java class.
*Action:   Adjust the call or create the specified method.
The code snippet as follows
JAVA CODE:
-----------------------
Class xyz
{
public static void Abc (String hostName,
int port,
String serviceURL,
String soapAction,
int timeOut,
String wsUser,
String wsPasWd,
String keyStore,
String keyStorePasWd)
{
//method implementation
}
}
JAVA STORED PROCEDURE:
---------------------------------------------
create OR REPLACE procedure ABC_JAVA_SP_CALL
(p_hostname in varchar2, p_port in number, p_serviceurl in varchar2, p_soapaction in varchar2, p_timeout in number, p_wsuser in varchar2, p_wspasswd in varchar2, p_ks_path in varchar2, p_ks_passwd in varchar2)
as
language java
name 'xyz.Abc(java.lang.String, int, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String, java.lang.String, java.lang.String)';
When i try to call
declare
p_hostname varchar2(100);
p_port number;
p_serviceurl varchar2(100);
p_soapaction varchar2(100);
p_timeout number;
p_wsuser varchar2(100);
p_wspasswd varchar2(100);
p_ks_path varchar2(100);
p_ks_passwd varchar2(100);
begin
//SP which returns the values for the required parameters.
comppkg.getvcsinfo(
p_hostname,
p_port ,
p_serviceurl,
p_soapaction,
p_timeout,
p_wsuser,
p_wspasswd,
p_ks_path,
p_ks_passwd
);
Layer7_icengc_ws_tes(p_hostname,
p_port ,
p_serviceurl,
p_soapaction,
p_timeout,
p_wsuser,
p_wspasswd,
p_ks_path,
p_ks_passwd);
end;
This thing ends up with
29531. 00000 - "no method %s in class %s"
*Cause:    An attempt was made to execute a non-existent method in a
Java class.
*Action:   Adjust the call or create the specified method.
Im not understanding what wrong am i doing
pls help
Edited by: madhusudan on Feb 12, 2013 8:07 PM 
Hello,
there is the forum {forum:id=65} for questions about using Java within Oracle.
Regards
Marcus
Edited by: Marwim on 13.02.2013 07:56
I could not find a suitable thread to post my PL/SQL question so iam posting it here.........You got the hint to the correct forum alread in another thread {message:id=10837976}
And if you think this is not related to Java but PL/SQL, then you should ask in {forum:id=75}

Calling the Java Method in PL/SQL Java Stored procedure errors out

Hi,
I have written a java class by name XYZ which has a method ABC for which there are 9 arguements being passed and its a VOID method.
This java class has been loaded into ORACLE using DBMS_JAVA.LOADJAVA pkg, Now this class is being called in the oracle as a JAVA Stored procedure...... When ever im trying to call the procedure it throws the following error
ORA-29531: no method
*Cause: An attempt was made to execute a non-existent method in a
Java class.
*Action: Adjust the call or create the specified method.
The code snippet as follows
JAVA CODE:
Class xyz
{
public static void Abc (String hostName,
int port,
String serviceURL,
String soapAction,
int timeOut,
String wsUser,
String wsPasWd,
String keyStore,
String keyStorePasWd)
{
//method implementation
}
}
JAVA STORED PROCEDURE:
create OR REPLACE procedure ABC_JAVA_SP_CALL
(p_hostname in varchar2, p_port in number, p_serviceurl in varchar2, p_soapaction in varchar2, p_timeout in number, p_wsuser in varchar2, p_wspasswd in varchar2, p_ks_path in varchar2, p_ks_passwd in varchar2)
as
language java
name 'xyz.Abc(java.lang.String, int, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String, java.lang.String, java.lang.String)';
When i try to call
declare
p_hostname varchar2(100);
p_port number;
p_serviceurl varchar2(100);
p_soapaction varchar2(100);
p_timeout number;
p_wsuser varchar2(100);
p_wspasswd varchar2(100);
p_ks_path varchar2(100);
p_ks_passwd varchar2(100);
begin
//SP which returns the values for the required parameters.
comppkg.getvcsinfo(
p_hostname,
p_port ,
p_serviceurl,
p_soapaction,
p_timeout,
p_wsuser,
p_wspasswd,
p_ks_path,
p_ks_passwd
);
Layer7_icengc_ws_tes(p_hostname,
p_port ,
p_serviceurl,
p_soapaction,
p_timeout,
p_wsuser,
p_wspasswd,
p_ks_path,
p_ks_passwd);
end;
This thing ends up with
29531. 00000 - "no method %s in class %s"
*Cause: An attempt was made to execute a non-existent method in a
Java class.
*Action: Adjust the call or create the specified method.
Im not understanding what wrong am i doing
pls help 
try to use varchar2 and java.lang.String instead of number and int

Weird exception running ODCIINDEXCREATE implemented in java

Dear all,
I am implementing an index in the ODCI interface where the methods are implemented in java.
During the execution of the following command:
CREATE INDEX secure_index ON secure_table(secure) INDEXTYPE IS BTreeIndexType;
I get a weird exception:
ORA-29855: followed by
ORA-29532: Java call terminated by uncaught Java exception: java.lang.NoSuchMethodError
1. how can I get this exception after compiling the classes and resolving them all in the database?
2. how can I get the complete stack trace to the exact line and file caused the exception?
3. do you have any ideas as to what could cause this kind of error?
Cheers,
Ronen. 
Hi,
Try this:
CREATE INDEX secure_index ON secure_table(secure);
This will create B-Tree index by default. 
Is the index type BTreeIndexType created by you?
What is the definition of this type? 
Hi,
Thanks for the replys.
The index is an encrypted B-tree index coded in Java by me.
while the source files are compiled without any problem in Eclipe and I can create the Class files and resolve them in Oracle, I cannot create the Index since I get an exception about some method that is missing. (obiously there is something wrong with the deployment of the java in the oracle since it compiles and links in Eclipse).
The Jars that I'm using are:
CartridgeServices.jar
classes12.jar
ODCI.jar
runtime12.jar
and one of the classes is created using jpub V.102 according to an Oracle object type in PL/SQL.
Thanks,
Ronen. 
Can you post the definition of BTreeIndexType? 
CREATE TYPE BTreeIndex AS OBJECT(
     ctxID INTEGER,
     STATIC FUNCTION ODCIGetInterfaces(
          ifclist OUT sys.ODCIObjectList
     ) RETURN NUMBER AS
     LANGUAGE JAVA NAME 'index.BTreeIndex.ODCIGetInterfaces(oracle.ODCI.ODCIObjectList[]) return java.math.BigDecimal',
     
     STATIC FUNCTION ODCIIndexCreate(
          ia sys.ODCIIndexInfo,
          parms VARCHAR2,
          env sys.ODCIEnv
     ) RETURN NUMBER AS
     LANGUAGE JAVA NAME 'index.BTreeIndex.ODCIIndexCreate(oracle.ODCI.ODCIIndexInfo, java.lang.String, oracle.ODCI.ODCIEnv) return java.math.BigDecimal',
     STATIC FUNCTION ODCIIndexDrop(
          ia sys.ODCIIndexInfo,
          env sys.ODCIEnv
     ) RETURN NUMBER AS
     LANGUAGE JAVA NAME 'index.BTreeIndex.ODCIIndexDrop(oracle.ODCI.ODCIIndexInfo, oracle.ODCI.ODCIEnv) return java.math.BigDecimal',
     STATIC FUNCTION ODCIIndexStart(
          sctx IN OUT BTreeIndex,
          ia sys.ODCIIndexInfo,
          op sys.ODCIPredInfo,
          qi sys.ODCIQueryInfo,
          strt NUMBER,
          stop NUMBER,
          cmpval secobj,
          env sys.ODCIEnv
     ) RETURN NUMBER AS
     LANGUAGE JAVA NAME 'index.BTreeIndex.ODCIIndexStart(index.BTreeIndex[], oracle.ODCI.ODCIIndexInfo, oracle.ODCI.ODCIPredInfo, oracle.ODCI.ODCIQueryInfo, java.math.BigDecimal, java.math.BigDecimal, index.secobj, oracle.ODCI.ODCIEnv) return java.math.BigDecimal',
     MEMBER FUNCTION ODCIIndexFetch(
          nrows NUMBER,
          rids OUT sys.ODCIRidList,
          env sys.ODCIEnv
     ) RETURN NUMBER AS
     LANGUAGE JAVA NAME 'index.BTreeIndex.ODCIIndexFetch(java.math.BigDecimal, oracle.ODCI.ODCIRidList[], oracle.ODCI.ODCIEnv) return java.math.BigDecimal',
     
     MEMBER FUNCTION ODCIIndexClose(
          env sys.ODCIEnv
     ) RETURN NUMBER AS
     LANGUAGE JAVA NAME 'index.BTreeIndex.ODCIIndexClose(oracle.ODCI.ODCIEnv) return java.math.BigDecimal',
     
     STATIC FUNCTION ODCIIndexInsert(
          ia sys.ODCIIndexInfo,
          rid VARCHAR2,
          newval secobj,
          env sys.ODCIEnv
     ) RETURN NUMBER AS
     LANGUAGE JAVA NAME 'index.BTreeIndex.ODCIIndexInsert(oracle.ODCI.ODCIIndexInfo, java.lang.String, index.secobj, oracle.ODCI.ODCIEnv) return java.math.BigDecimal',
     
     STATIC FUNCTION ODCIIndexDelete(
          ia sys.ODCIIndexInfo,
          rid VARCHAR2,
          oldval secobj,
          env sys.ODCIEnv
     ) RETURN NUMBER AS
     LANGUAGE JAVA NAME 'index.BTreeIndex.ODCIIndexDelete(oracle.ODCI.ODCIIndexInfo, java.lang.String, index.secobj, oracle.ODCI.ODCIEnv) return java.math.BigDecimal',
     
     STATIC FUNCTION ODCIIndexUpdate(
          ia sys.ODCIIndexInfo,
          rid VARCHAR2,
          oldval secobj,
          newval secobj,
          env sys.ODCIEnv
     ) RETURN NUMBER AS
     LANGUAGE JAVA NAME 'index.BTreeIndex.ODCIIndexUpdate(oracle.ODCI.ODCIIndexInfo, java.lang.String, index.secobj, index.secobj, oracle.ODCI.ODCIEnv) return java.math.BigDecimal',
     
     STATIC FUNCTION ODCIIndexGetMetadata(
          ia sys.ODCIIndexInfo,
          expversion VARCHAR2,
          newblock OUT PLS_INTEGER,
          env sys.ODCIEnv
     ) RETURN VARCHAR2 AS
     LANGUAGE JAVA NAME 'index.BTreeIndex.ODCIIndexGetMetadata(oracle.ODCI.ODCIIndexInfo, java.lang.String, java.lang.Integer[], oracle.ODCI.ODCIEnv) return java.lang.String'
);

Pro*c compilation Err:"Wrong number or types of argument"  for Object Type

While calling stored procedure i am getting following error
PLS-S-00306, wrong number or types of arguments in call to PR_PROCESS_BASKET
specifications of package are as follow
PROCEDURE PR_PROCESS_BASKET(PI1 IN NUMBER,
PI2 IN VARCHAR2,
PI3 IN VARCHAR2,
PI4 IN VARCHAR2,
PI5 IN DATE,
PI_6 IN VARCHAR2,
PI7 IN NUMBER,
PI_8 IN VARCHAR2,
PI_9 IN VARCHAR2,
PI_11 IN VARCHAR2,
PI_12 IN NUMBER,
PI_13 IN VARCHAR2,
PI_14 IN VARCHAR2,
PI_15 IN VARCHAR2,
PI_dtsl IN BASKET_RECORD_ARRAY,
PI_17 IN VARCHAR2,
PO_18 OUT VARCHAR2,
PO_19 OUT VARCHAR2);
I am getting error for BasketRecordArray input.
definition of BASKET_RECORD_ARRAY is
CREATE OR REPLACE TYPE "TYPE_BASKET_RECORD" AS OBJECT
(
EXCH_ID VARCHAR2(6),
SEQ_NO NUMBER(2),
SECID VARCHAR2(30),
QUANTITY NUMBER(20),
VAL NUMBER(20,5),
ACTION VARCHAR2(1)
)
Using ott i have created OCI structure of the same and included in my proc application.
I have provided INTYPE as file generated by ott.
I have declared pointer of OCI structure and passed it to stored procedure .
But still I am getting error "PLS-S-00306, wrong number or types of arguments in call to 'PR_PROCESS_BASKET'"
proc compilation.
my make command is as follwos :
proc define=SIZ200 define=BIGENDIAN define=BIT32 define=DBG define=BMARK sqlcheck=full define=RMS userid=scott/tiger#11gdb unsafe_null=yes dbms=v8 mode=oracle include=/usr/vacpp/include include=Source/Header duration=session select_error=yes code=kr_c maxopencursors=100 release_cursor=no hold_cursor=yes char_map=varchar2 define=-DOMS INTYPE=Source/Header/TYPE_BASKET_RECORD1.typ iname=Source/Sip/Proc/dummy.cpp oname=Source/Sip/C/Queries.c

Categories

Resources