Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

runnable jar

 
Sagar Deshmukh
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have created a RunnableJar(Jar contain another third party jar like iText ,java class, etc etc ) and i have upload that RunnableJar.jar in oracle database using loadjava
in that jar i have main class GetOffer in that i have one method and the use of this method is to create multiple pdf according to user selection and concat them.
Now i have created Stored procedure


and i have called this stored procedure using following call statement



while Calling the procedure we are getting the below error.

SQL> VARIABLE myString VARCHAR2(20);
SQL> CALL getOffer("XYZ") INTO :myString
2 ;
CALL getOffer("Any String") INTO :myString
*
ERROR at line 1:
ORA-06576: not a valid function or procedure name

Guys how to solve this problem.
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are you trying to do? It looks like you want to use SQL*Plus variables - are you just testing the thing or are you trying to create a script to be run later?

If it's the former, just use If it's the latter, I can only offer the documentation -- I'm not proficient with variables in SQL*Plus myself.

... and welcome to the ranch!
 
Sagar Deshmukh
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thnaks for your reply
I tried this but i m getting following error


i uploaded jar using following command
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the GetOffer class declared in any package?
 
Sagar Deshmukh
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No,
Structure

and i have export the jar In Runnable Jar
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess the problem might be caused by the nested jars. I suppose that the JVM in Oracle cannot find the libraries, which in turn causes errors while loading the GetOffer class, which is then reported as nonexistent.

My advice would be to try to load (using loadjava) all jars individually. Perhaps there are some logs in Oracle where the JVM messages could be found - to verify or disprove my supposition.
 
Sagar Deshmukh
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you are right but i m running this program in eclipse and all this jar are reference libraries and this program work fine outside oracle.
But if we load all jar separately then i don't think it will work
Because if i write this GetOffer.java code in notepad and put all jar in same folder and run this using cmd then its give a lots of error.
So how to do that ...
Really confused

 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as running the application from command line is concerned: putting all jars in a single directory is not enough, you need to add every single jar to the classpath. Then you can run it without bundling all jars together.

However, Oracle's JVM uses different rules to locate classes. I'm really no expert on this, but I believe it should be possible to get it right from the documentation.

Specifically:
Oracle wrote:All Java classes contain references to other classes. A conventional JVM searches for classes in the directories, ZIP files, and JAR files named in the CLASSPATH. In contrast, Oracle JVM searches schemas for class schema objects. Each class in the database has a resolver specification, which is Oracle Database counterpart to CLASSPATH. For example, the resolver specification of a class, alpha, lists the schemas to search for classes that alpha uses. Notice that resolver specifications are per-class, whereas in a classic JVM, CLASSPATH is global to all classes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic