Hi,

I want to generate Universal unique identifer with the java class UUIDGen in a PL/SQL script.
So i load the UUIDGen.class in Oracle database with this command :
loadjava -resolve -user D32RSBX/D32RSBX UUIDGen.class

It seems ok, as i can see with this :

SQL> SELECT count(*) FROM dba_objects WHERE object_type LIKE '%JAVA%';

COUNT(*)
----------
8321

SQL> select count(*), owner from all_objects where object_type like '%JAVA%' group by owner;

COUNT(*) OWNER
---------- ------------------------------
2 D32RSBX
8319 SYS




SQL> SELECT object_name, object_type, status, timestamp
2 FROM user_objects
3 WHERE (object_name NOT LIKE 'SYS_%'
4 AND object_name NOT LIKE 'CREATE$%'
5 AND object_name NOT LIKE 'JAVA$%'
6 AND object_name NOT LIKE 'LOADLOB%')
7 AND object_type LIKE 'JAVA %'
8 ORDER BY object_type, object_name;

OBJECT_NAME
--------------------------------------------------------
OBJECT_TYPE STATUS TIMESTAMP
------------------ ------- -------------------
hello
JAVA CLASS VALID 2004-09-24:14:46:58

/716412b3_UUIDGen
JAVA CLASS VALID 2004-09-24:10:38:19

SQL> SELECT object_name shortname,
2 DBMS_JAVA.LONGNAME (object_name) longname
3 FROM USER_OBJECTS
4 WHERE object_type = 'JAVA CLASS'
5 AND object_name != DBMS_JAVA.LONGNAME (object_name);

SHORTNAME
-------------------------------------------------------------
LONGNAME
-------------------------------------------------------------
/716412b3_UUIDGen
org/apache/axis/components/uuid/UUIDGen

So, it seems to be well configured, but i don't know, why i have oracle errors :
I create package called px_parsifal like this :

First solution :
FUNCTION px_uuidgen RETURN VARCHAR2
IS LANGUAGE JAVA
NAME 'UUIDGen.nextUUID() return java.lang.String';
java.lang.String';

Second solution :
FUNCTION px_uuidgen RETURN VARCHAR2
IS LANGUAGE JAVA
NAME 'org.apache.axis.components.uuid.UUIDGen.nextUUID() return java.lang.String';

With the first solution i have that :
SQL> declare
2 str varchar2(40);
3 begin
4 str := px_parsifal.px_uuidgen;
5 end;
6 /
declare
*
ERREUR à la ligne 1 :
ORA-29540: class UUIDGen does not exist
ORA-06512: at "D32RSBX.PX_PARSIFAL", line 440
ORA-06512: at line 4

With the second solution i have that :
SQL> declare
2 str varchar2(40);
3 begin
4 str := px_parsifal.px_uuidgen;
5 end;
6 /
declare
*
ERREUR à la ligne 1 :
ORA-29531: no method nextUUID in class org/apache/axis/components/uuid/UUIDGen
ORA-06512: at "D32RSBX.PX_PARSIFAL", line 393
ORA-06512: at line 4

On the other hand, the little java class hello works well

function hello return varchar2
is
language java name 'hello.hello()
return java.lang.string';

Here is the result :
SQL> declare
2 str varchar2(40);
3 begin
4 str := hello;
5 dbms_output.put_line(str);
6 end;
7 /
Hello World!

Procédure PL/SQL terminée avec succès.

Thanks for your help.