Home » Developer & Programmer » JDeveloper, Java & XML » Problem With Java Stored Procedure invoking Windows runtime process (Oracle 11g, Windows 7)
Problem With Java Stored Procedure invoking Windows runtime process [message #555246] Tue, 22 May 2012 11:38 Go to next message
p_pml
Messages: 15
Registered: February 2012
Junior Member
Hello,

I am trying to invoke program from my local Windows machine (exactly java executor, which is in my environment on c:\java\jdk\bin\java) using database package with Java stored procedure.

Everything is fired by SQLPLUS script, this script invokes package with Java stored procedure (jar loaded into Oracle) and that procedure is trying to invoke runtime process (syntax: c:\java\jdk\bin\java -cp and here arae my classes and main jar) using my local java executor. I added all permissions using dbms_java.grant_permisions (execution forced me to give permissions java.io.FilePermission to <<ALL_FILES>> for execute), moreover I added to my database user JAVASYSPRIV and JAVAUSERPRIV role. Unfortunately, beside this I am still getingg error: C:\java\jdk\bin\java not found (Note that lookup with PATH isn't done due to the oracle executable being setuid.)

I have no idea what can I do more, every advice would be very helpful.
Re: Problem With Java Stored Procedure invoking Windows runtime process [message #555247 is a reply to message #555246] Tue, 22 May 2012 11:42 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/

as a general rule package running inside RDBMS has NO access to remote client system
Re: Problem With Java Stored Procedure invoking Windows runtime process [message #555248 is a reply to message #555247] Tue, 22 May 2012 12:39 Go to previous messageGo to next message
p_pml
Messages: 15
Registered: February 2012
Junior Member
Let me disagree with you. I searched some web sites related to this topic and I found that this is quite often activity, on Windows and Linux OS.

Maybe I should create oracle directory pointing onto my path with java ?
Re: Problem With Java Stored Procedure invoking Windows runtime process [message #555249 is a reply to message #555248] Tue, 22 May 2012 12:40 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
p_pml wrote on Tue, 22 May 2012 13:39

Maybe I should create oracle directory pointing onto my path with java ?


And an Oracle directory resides on the server only.
Re: Problem With Java Stored Procedure invoking Windows runtime process [message #555250 is a reply to message #555246] Tue, 22 May 2012 12:48 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Do NOT just explain what you did and got, SHOW US.

Use SQL*Plus and copy and paste your session, the WHOLE session.

Before, Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.

Regards
Michel
Re: Problem With Java Stored Procedure invoking Windows runtime process [message #555253 is a reply to message #555250] Tue, 22 May 2012 12:53 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
I don't know what you have.
I don't know what you do.
I don't know what you see.
It is really, Really, REALLY difficult to fix a problem that can not be seen.
use COPY & PASTE so we can see what you do & how Oracle responds.

Re: Problem With Java Stored Procedure invoking Windows runtime process [message #555274 is a reply to message #555248] Tue, 22 May 2012 16:46 Go to previous messageGo to next message
ThomasG
Messages: 3211
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
You seem to be mixing up a few concepts.

* You can call anything on the server from inside a PL/SQL procedure. PL/SQL runs on the server, there is no way to run something on the client. (unless you can run "remote commands" via SSH or some other remote access on the client from the server)

* You could call a OS process on the client from the SQL script run by SQL*Plus, but NOT from inside a PL/SQL process that runs ON THE SERVER.

Re: Problem With Java Stored Procedure invoking Windows runtime process [message #555275 is a reply to message #555274] Tue, 22 May 2012 18:21 Go to previous messageGo to next message
p_pml
Messages: 15
Registered: February 2012
Junior Member
OK before I paste code maybe I will try to write more clearly what I want to do.

Generally problem is related with batches. I was migrating some aplication based on Oracle Forms 6i to Oracle Forms 11g (also database form 9i to 11g). I also inherited some strange manner of executing batch processes related to migrated application. Shortly it wad starting from commandline and some forms where directly invoked.

After migration to 11g everything works on applet in browser. And batch process was changed to that started from SQLPlus.
SqlPlus run database package which includes java stored procedure. The owner of the migrated application provides some jars, one of them was load into database and other are invoked from java stored procedure, but they are stored on client machine.

Hmm, I am totally frightened that you are right. I make mistake and it will probably be necessary to use ssh to connect to my machine from datatabse server.


Re: Problem With Java Stored Procedure invoking Windows runtime process [message #555393 is a reply to message #555275] Wed, 23 May 2012 15:44 Go to previous message
ThomasG
Messages: 3211
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
It might be worth investigating whether you can move the batch process to the server entirely. Since Forms6i was client/server based there might have been technical reasons to have the batch run on the client, but with Forms 11g it makes more sense to have everything running on the server.
Previous Topic: Adding new field to cater GL account code into Employee Self Service page (Expense Claim)
Next Topic: Load XML into DataBase multiple XSD Schema
Goto Forum:
  


Current Time: Thu Mar 28 03:34:07 CDT 2024