4 Replies Latest reply: Dec 13, 2006 6:28 AM by 444892 RSS

    Problems calling external Web Service from a Java Stored Procedure

    497201
      I'm using a sample code that I found here about calling external web services from a Java Store Procedure ( Credit Agency Web Service http://www.oracle.com/technology/sample_code/tech/java/jsp/samples/wsclient/Readme.html ) but when I run it ,send this error. I dont know what can I do or what is missing. Please help me. Thanks.

      Error: Premature EOF encountered [java.io.EOFException] [SOAPException: faultCode=SOAP-ENV:IOException; msg=Premature EOF encountered; targetException=java.io.EOFException: Premature EOF encountered] at org.apache.soap.SOAPException.(SOAPException.java:77) at oracle.soap.transport.http.OracleSOAPHTTPConnection.send(OracleSOAPHTTPConnection.java:765) at org.apache.soap.rpc.Call.invoke(Call.java:261) at oracle.otnsamples.wsclient.CreditAgencyServiceStub.authorizeCustomer(CreditAgencyServiceStub.java:84) at Products.jspService(Products.jsp:120) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:139) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:349) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:795) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:794) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534)
        • 1. Re: Problems calling external Web Service from a Java Stored Procedure
          352091
          -----------------

          Message was edited by:
          madhaw005@yahoo.com
          • 2. Re: Problems calling external Web Service from a Java Stored Procedure
            352091
            I'm also facing problem in running the example on the page http://www.oracle.com/technology/sample_code/tech/java/jsp/samples/wsclient/Readme.html

            I've Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 and Oracle Application Server 10g (10.1.3). When I executed the following command,

            loadjava -thin -user sys/password@localhost:1521:oradb -resolve -synonym -verbose -grant public %OC4J_HOME%/webservices/lib/soap.jar %OC4J_HOME%/lib/dms.jar %OC4J_HOME%/jlib/javax-ssl-1_1.jar %ORACLE_HOME%/lib/servlet.jar %OC4J_HOME%/j2ee/home/lib/mail.jar

            ... mentioned in step 3 under the "Configuring the Application" section on the above link, the process terminates with the following error

            The following operations failed
            class oracle/net/www/protocol/https/Handler: resolution
            class oracle/net/www/protocol/https/HttpsURLConnection: resolution
            class oracle/soap/client/ProviderManagerClient: resolution
            class oracle/soap/client/ServiceManagerClient: resolution
            class oracle/soap/providers/JavaProvider: resolution
            class oracle/soap/providers/ejbprov/EntityEJBProvider: resolution
            class oracle/soap/providers/ejbprov/StatefulEJBProvider: resolution
            class oracle/soap/providers/ejbprov/StatelessEJBProvider: resolution
            class oracle/soap/providers/sp/SpProvider: resolution
            class oracle/soap/server/http/SOAPServlet: resolution
            class oracle/soap/transport/http/OracleSOAPHTTPConnection$1: resolution
            class oracle/soap/transport/http/OracleSOAPHTTPConnection: resolution
            class org/apache/soap/messaging/Message: resolution
            class org/apache/soap/rpc/Call: resolution
            class org/apache/soap/rpc/RPCMessage: resolution
            class org/apache/soap/rpc/Response: resolution
            class javax/net/DefaultServerSocketFactory: creation (createFailed)
            class javax/net/DefaultSocketFactory: creation (createFailed)
            class javax/net/ServerSocketFactory: creation (createFailed)
            class javax/net/SocketFactory: creation (createFailed)
            class javax/net/ssl/DefaultSSLServerSocketFactory: creation (createFailed)
            class javax/net/ssl/DefaultSSLSocketFactory: creation (createFailed)
            class javax/net/ssl/HandshakeCompletedEvent: creation (createFailed)
            class javax/net/ssl/HandshakeCompletedListener: creation (createFailed)
            class javax/net/ssl/SSLException: creation (createFailed)
            class javax/net/ssl/SSLHandshakeException: creation (createFailed)
            class javax/net/ssl/SSLKeyException: creation (createFailed)
            class javax/net/ssl/SSLPeerUnverifiedException: creation (createFailed)
            class javax/net/ssl/SSLProtocolException: creation (createFailed)
            class javax/net/ssl/SSLServerSocket: creation (createFailed)
            class javax/net/ssl/SSLServerSocketFactory: creation (createFailed)
            class javax/net/ssl/SSLSession: creation (createFailed)
            class javax/net/ssl/SSLSessionBindingEvent: creation (createFailed)
            class javax/net/ssl/SSLSessionBindingListener: creation (createFailed)
            class javax/net/ssl/SSLSessionContext: creation (createFailed)
            class javax/net/ssl/SSLSocket: creation (createFailed)
            class javax/net/ssl/SSLSocketFactory: creation (createFailed)
            class javax/security/cert/Certificate: creation (createFailed)
            class javax/security/cert/CertificateEncodingException: creation (createFailed)
            class javax/security/cert/CertificateException: creation (createFailed)
            class javax/security/cert/CertificateExpiredException: creation (createFailed)
            class javax/security/cert/CertificateNotYetValidException: creation (createFailed)
            class javax/security/cert/CertificateParsingException: creation (createFailed)
            class javax/security/cert/X509Certificate: creation (createFailed)
            exiting : Failures occurred during processing

            I've checked the path to all the jar files.

            I tried to run the command again with system/password instead sys/password but then I got the following stacktrace:

            The following operations failed
            class oracle/net/www/protocol/https/Handler: resolution
            class oracle/net/www/protocol/https/HttpsURLConnection: resolution
            class oracle/soap/client/ProviderManagerClient: resolution
            class oracle/soap/client/ServiceManagerClient: resolution
            class oracle/soap/providers/JavaProvider: resolution
            class oracle/soap/providers/ejbprov/EntityEJBProvider: resolution
            class oracle/soap/providers/ejbprov/StatefulEJBProvider: resolution
            class oracle/soap/providers/ejbprov/StatelessEJBProvider: resolution
            class oracle/soap/providers/sp/SpProvider: resolution
            class oracle/soap/server/http/SOAPServlet: resolution
            class oracle/soap/transport/http/OracleSOAPHTTPConnection$1: resolution
            class oracle/soap/transport/http/OracleSOAPHTTPConnection: resolution
            class org/apache/soap/messaging/Message: resolution
            class org/apache/soap/rpc/Call: resolution
            class org/apache/soap/rpc/RPCMessage: resolution
            class org/apache/soap/rpc/Response: resolution
            exiting : Failures occurred during processing

            Thanks in advance for any useful help.

            -
            • 3. Re: Problems calling external Web Service from a Java Stored Procedure
              475314
              I do not think, you can overwrite javax.net.* and some built-in packages. You have to change Java Security policy file to do it. and you might need to sign (i am not sure exactly) these new packs.
              • 4. Re: Problems calling external Web Service from a Java Stored Procedure
                444892
                I have exactly the same problem, any solution?

                The problem comes when I load the following APIs:

                loadjava -thin -user sys/<sys-pwd>@<host>:<port>:<SID> -resolve -synonym -verbose -grant public $OC4J_HOME/soap/lib/soap.jar
                loadjava -thin -user sys/<sys-pwd>@<host>:<port>:<SID> -resolve -synonym -verbose -grant public $OC4J_HOME/lib/dms.jar
                loadjava -thin -user sys/<sys-pwd>@<host>:<port>:<SID> -resolve -synonym -verbose -grant public $OC4J_HOME/jlib/javax-ssl-1_1.jar

                The database is Oracle 10g R2