Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Send data to remote webservices

Re: Send data to remote webservices

From: Vladimir M. Zakharychev <vladimir.zakharychev_at_gmail.com>
Date: Thu, 04 Oct 2007 08:38:27 -0700
Message-ID: <1191512307.631334.293750@w3g2000hsg.googlegroups.com>


On Oct 4, 12:25 pm, sandro.sal..._at_gmail.com wrote:
> Hi,
> I have an oracle server with a "java stored procedure" that sends a
> SOAP message to remote server over HTTP.
> I upload the follow jar to my user tablespace with loadjava:
>
> cglib-nodep-2.1_3.jar
> commons-beanutils-1.7.0.jar
> commons-logging-1.1.jar
> dbwsa.jar
> dbwsclient.jar
> dbwsclientdb102.jar
> jsr173_1.0_api.jar
> xom-1.1.jar
> xpp3_min-1.1.3.4.O.jar
> XStream.jar
> (and my application jar).
>
> Then I get the follow grant to my user:
>
> exec dbms_java.grant_permission( 'TST_GSTECOGRAFICO_V21',
> 'SYS:java.net.SocketPermission', '*', 'resolve' )
> exec dbms_java.grant_permission( 'TST_GSTECOGRAFICO_V21',
> 'SYS:java.net.SocketPermission', '*', 'connect' )
> exec dbms_java.grant_permission( 'TST_GSTECOGRAFICO_V21',
> 'SYS:java.util.PropertyPermission', 'HTTPClient.socket.idleTimeout',
> 'write' );
> exec dbms_java.grant_permission( 'TST_GSTECOGRAFICO_V21',
> 'SYS:java.lang.RuntimePermission', 'createClassLoader', '' );
> exec
> dbms_java.grant_permission( 'TST_GSTECOGRAFICO_V21','SYS:java.lang.RuntimePermission',
> 'accessDeclaredMembers', '' );
> exec dbms_java.grant_permission( 'TST_GSTECOGRAFICO_V21',
> 'SYS:java.lang.reflect.ReflectPermission', 'suppressAccessChecks',
> '' );
> exec dbms_java.grant_permission( 'TST_GSTECOGRAFICO_V21',
> 'SYS:java.lang.RuntimePermission', 'setFactory', '' );
>
> exec dbms_java.grant_permission( 'TST_GSTECOGRAFICO_V21',
> 'SYS:java.lang.RuntimePermission', 'shutdownHooks', '' )
>
> exec dbms_java.grant_permission( 'TST_GSTECOGRAFICO_V21',
> 'SYS:java.lang.RuntimePermission', 'shutdownHooks', '' )
>
> exec dbms_java.grant_permission('TST_GSTECOGRAFICO_V21',
> 'SYS:java.util.logging.LoggingPermission','control','')
>
> exec
> dbms_java.grant_permission('TST_GSTECOGRAFICO_V21','SYS:java.net.SocketPermission','*','connect,resolve');
>
> When I try to send a message using my application I receive the follow
> error:
>
> java.rmi.RemoteException: HTTP transport error:
> javax.xml.soap.SOAPException: java.security.PrivilegedActionException:
> javax.xml.soap.SOAPExcept
> ion: Message send failed: 2 > 0; nested exception is:
> HTTP transport error: javax.xml.soap.SOAPException:
> java.security.PrivilegedActionException: javax.xml.soap.SOAPException:
> Message send
> failed: 2 > 0
> at
> it.escsolution.hostInterscambio.core.runtime.HostActionManagerSoapBinding_Stub.executeNodo(HostActionManagerSoapBinding_Stub.java:
> 601
> )
> at
> it.escsolution.hostInterscambio.core.HostActionManagerClient.executeNodo(HostActionManagerClient.java:
> 92)
> at
> it.escsolution.clientInterscambio.myThread.xStream.NodoSenderXStream.useSpecificWS(NodoSenderXStream.java:
> 39)
> at
> it.escsolution.clientInterscambio.myThread.xStream.ThreadSenderXStream.run(ThreadSenderXStream.java:
> 171)
> at
> it.escsolution.clientInterscambio.core.ClientActionManager.deliveryDatas(ClientActionManager.java:
> 970)
> Caused by: HTTP transport error: javax.xml.soap.SOAPException:
> java.security.PrivilegedActionException: javax.xml.soap.SOAPException:
> Message se
> nd failed: 2 > 0
> at
> oracle.j2ee.ws.client.http.HttpClientTransport.invokeImpl(Unknown
> Source)
> at
> oracle.j2ee.ws.client.http.HttpClientTransport.invoke(Unknown Source)
> at
> oracle.j2ee.ws.client.StreamingSender._sendImpl(StreamingSender.java:
> 165)
> at
> oracle.j2ee.ws.client.StreamingSender._send(StreamingSender.java:110)
> at
> it.escsolution.hostInterscambio.core.runtime.HostActionManagerSoapBinding_Stub.executeNodo(HostActionManagerSoapBinding_Stub.java:
> 585
> )
> ... 4 more
> responce: null
>
> Tnx to all,
> Bye.

This is most probably an issue with Java permissions incorrectly granted. A few questions to clarify the situation a bit further:

  1. Which user is the owner of the Java classes you loaded? In other words, what was the command line for the loadjava utility? Is TST_GSTECOGRAFICO_V21 the name of the user who owns the classes or did you load them as SYS?
  2. Did you issue those dbms_java.grant_permission() calls as a user with JAVAADMINPRIV role granted (SYS has it)? I guess so, because otherwise the call would throw an error...
  3. How do you invoke the method that sends the message in your application (the one that throws the exception?) Which Oracle user does this? Issue

SELECT * FROM USER_JAVA_POLICY as that user and verify that it indeed has java.net.SocketPermission granted with "connect,resolve" action for "*" name.

Regards,

   Vladimir M. Zakharychev
   N-Networks, makers of Dynamic PSP(tm)    http://www.dynamicpsp.com Received on Thu Oct 04 2007 - 10:38:27 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US