| Author |
Loadjava and user_objects table
|
Matthew Kaiser
Greenhorn
Joined: Aug 23, 2005
Posts: 15
|
|
I'm loading a vendor's jar file in oracle with loadjava with the -v -f -r flags and the classes I need and I see them either getting resolved or skipped:
c:\loadjava -r -f -v -genmissing -u "uid/pwd@mydbatrain" ekahau-engine-sdk.jar
...
resolving: class com/ekahau/common/sdk/EConnection
skipping : class com/ekahau/common/sdk/EErrorCodes
skipping : class com/ekahau/common/sdk/EException
...
Classes Loaded: 114
Resources Loaded: 1
Sources Loaded: 0
Published Interfaces: 0
Classes generated: 0
Classes skipped: 0
Synonyms Created: 0
Errors: 0
but when I query user_objects to see if EConnection is in there,
SQL> column object_name format a30
SQL> column object_type format a20
SQL> select object_name,object_type, status from user_objects where object_name like '%ekahau%';
OBJECT_NAME OBJECT_TYPE STATUS
------------------------------ -------------------- -------
com/ekahau/common/sdk/EMsg JAVA CLASS VALID
com/ekahau/common/sdk/IMsg JAVA CLASS VALID
com/ekahau/engine/sdk/Asset JAVA CLASS VALID
com/ekahau/engine/sdk/Device JAVA CLASS VALID
com/ekahau/engine/sdk/Event JAVA CLASS VALID
com/ekahau/engine/sdk/Location JAVA CLASS VALID
com/ekahau/engine/sdk/Model JAVA CLASS VALID
com/ekahau/engine/sdk/ModelMap JAVA CLASS VALID
com/ekahau/engine/sdk/TagMenu JAVA CLASS VALID
9 rows selected.
SQL>
it's not there -
can anyone help an oracle noob?
Matthew
|
 |
Fatih Keles
Ranch Hand
Joined: Sep 01, 2005
Posts: 177
|
|
Hi Mathew,
Something like this will show your java classes
|
 |
Matthew Kaiser
Greenhorn
Joined: Aug 23, 2005
Posts: 15
|
|
Okay, I found the class in all_objects.
But, why can't I find it in user_objects and why can't Oracle's jvm see it?
And when I run my routine it can't find the class (after figuring out how to get java errors to show up in the first place):
My entire code is the following:
I've verfied all the classes are loaded, all the jar files are resolved and valid. Is there something else I'm missing?
|
 |
Fatih Keles
Ranch Hand
Joined: Sep 01, 2005
Posts: 177
|
|
Good you have loaded your java classes. Why you can't see under user_objects view? Because you don't own them. What you see as owner in all_objects for your classes? That is the owner.
While dealing with java classes within database you have to keep it simple. Let us re-check what you have done so far.
1) loaded your jar file with loadjava command line utility tool.
2) Verified that your classes are loaded
3) created a java source to use the third party java classes as follows
4) Created a pl/sql wrapper procedure to invoke your own java class as
create or replace procedure xxdosmth (p_id in number) as
language java name 'xxsmth.Xxsmth.doSmth(int id)';
5) test it
declare
begin
xxdosmth(12);
end;
Can you check these steps?
|
 |
Matthew Kaiser
Greenhorn
Joined: Aug 23, 2005
Posts: 15
|
|
I tried entering the java code via sqlplus as your suggested with the "create or replace and compile" using a package name and curiously enough when I try to create the wrapper
It reports it can't find the class even though I can query all_objects and see the source and class java objects
I don't seem to understand how oracle resolves the java names.
|
 |
Fatih Keles
Ranch Hand
Joined: Sep 01, 2005
Posts: 177
|
|
Hi Matthew,
The problem is "throwAnError.ThrowAnError.testEkahau(java.lang.Integer).showMessage()". According to your previous java code it should be
ThrowAnError.testEkahau(java.lang.Integer)
which is in <package>.<class name>.<method name>(<method arguments>) format.
|
 |
Matthew Kaiser
Greenhorn
Joined: Aug 23, 2005
Posts: 15
|
|
okay
works (making sure I dropped the previous "ThrowAnError" class in favor of "throwAnError/ThrowAnError" beforehand)
I'm still unclear as to how to call it as it get the following results trying to use it
the code (to recap) being
i'm still missing the proper syntax
|
 |
Fatih Keles
Ranch Hand
Joined: Sep 01, 2005
Posts: 177
|
|
Since you created the pl/sql procedure java_contact_t4, now you can use it to invoke your java code.
|
 |
Matthew Kaiser
Greenhorn
Joined: Aug 23, 2005
Posts: 15
|
|
I'm afraid not:
|
 |
Fatih Keles
Ranch Hand
Joined: Sep 01, 2005
Posts: 177
|
|
|
Is your java class in a package? Can you just put exact java source here?
|
 |
Matthew Kaiser
Greenhorn
Joined: Aug 23, 2005
Posts: 15
|
|
yep, already did,
The exact code is as above in the Tuesday, August 09, 2011 14:53:36 post
|
 |
Matthew Kaiser
Greenhorn
Joined: Aug 23, 2005
Posts: 15
|
|
minus line 15
|
 |
Fatih Keles
Ranch Hand
Joined: Sep 01, 2005
Posts: 177
|
|
|
|
 |
 |
|
|
subject: Loadjava and user_objects table
|
|
|