Web Service Callout User Guide


Web Service Callout refers to the invocation of Web Services from within the database using SQL query, PL/SQL stored procedures, or Java stored procedures.

The following steps are required for performing Web Service Callout in release 9.2 or higher of the Oracle database.

  1. preparing (or Web Service enabling) the database. Mostly, through the loading of the Java-based Web Service client runtime in the database.
  2. loading the client proxy for a particular Web Service into the database. Generate the Java-based Web Service client proxy, the corresponding Java and PL/SQL wrappers, and load all the generated objects into the database. You may also use the dynamic invocation (DII) APIs, in which case, this step can be skipped. 
  3. invoking the Web Service using the proxy or wrapper, or the DII APIs.

The Java VM in Oracle 9.2 is JDK 1.3 compatible, while it is JDK 1.4 compatible in Oracle database 10g. The RDBMS release dictates the Web Service client runtime to be used (i.e., Oracle SOAP client or Oracle JAX-RPC client).

  • Oracle SOAP client is built against JDK 1.3 and is shipped in Oracle Application Server (OracleAS) Releases 9.0.4 and 10.1.2.
  • Oracle JAX-RPC client is built against JDK 1.4 and ships with OracleAS 10.1.3 release. Therefore, Oracle database 9.2 cannot support the Oracle JAX-RPC client runtime.

Table 1 enumerates the supported combinations of Oracle database releases and Web Service client runtime stacks. For example, using Oracle 9.2 with Oracle JAX-RPC client, or using Oracle 9.2 with JAX-RPC DII calls are not supported combinations.

Table 1 also shows the corresponding steps for a particular combination (i.e., using Oracle JAX-RPC client with the Oracle database 10g is covered in section 1.3 and 2.3.

Table 1. Compatibility Chart


Oracle SOAP Client
Oracle JAX-RPC Client
Oracle JAX-RPC DII
Database 9.2
supported (1.1 + 2.1)
not supported
not supported
Database 10g
supported (1.2 + 2.2)
supported (1.3 + 2.3)
supported (1.2 + 3.2)


This document provides the recipes for Web Service callout under various combinations. The document is structured as follows:
  1. Preparing the database: describe how to prepare a database for Web Service callout, based on the database release version and Web Service client runtime stack.
  2. Generating the proxy: describe how to create Web Service client proxies and wrappers.
  3. Invoking the Web Service: describe how to call Web Service using proxies, wrappers or DII APIs.
This document also serves as user guide for the Web Service Callout Utilities downloadable from OTN:

1. Preparing the Database

Preparing the database consists mainly in loading the Web Services client stack into the database. Loading the client stack requires extra Java space inside the JavaVM to resolve and store load jar files. Make sure the shared_pool_size and java_pool_size in the pfile (.ora) are equal to or greater than 96M and 80M, i.e.,

shared_pool_size=96M
java_pool_size=80M

Depending on the number of Java classes already loaded into the database, the two parameters may need to be increased beyond 96M and 80M. Restart the database, if pfile is modified. In the following, we discuss various database and client stack combinations respectively.

1.1. Loading Oracle SOAP client into Oralce 9.2 Database

Download OC4J Release 10.1.2 (standalone). Expand oc4j_extended.zip. We referred to the directory under which oc4j_extended.zip is expanded as the environment variable ORACLE_HOME, in subsequent discussion. One can choose to load Oracle SOAP client into the SYS schema, or into a particular user schema. To load the client into the user schema, run the command below. Windows users, please replace ${ORACLE_HOME} with %ORACLE_HOME%.

% loadjava -u scott/tiger -r -v -f -genmissing ${ORACLE_HOME}/j2ee/home/lib/jssl-1_2.jar ${ORACLE_HOME}/soap/lib/soap.jar ${ORACLE_HOME}/dms/lib/dms.jar ${ORACLE_HOME}/j2ee/home/lib/servlet.jar ${ORACLE_HOME}/j2ee/home/lib/ejb.jar ${ORACLE_HOME}/j2ee/home/lib/mail.jar

If the user has priviliges granting public, then add -grant public to the command above to make the loaded classes visible to other schemas.

JDeveloper 10.1.2 may generate Web Service client proxy using Oracle SOAP client runtime. To run such proxy in the database, one needs to add $ORACLE_HOME/jdev/lib/jdev-rt.jar into both lists of jar files above.

Note, instead of using jar files released with OC4J 10.1.2, you can also use those released with OC4J 9.0.4. Oracle SOAP clients are essentially the same in OC4J 9.0.4 and 10.1.2, except for some bug fixes. However, at present, OTN no longer provide OC4J 9.0.4 standalone download. Therefore, we do not provide a recipe for using OC4J 9.0.4 jar files.

1.2. Loading Oracle SOAP client into Oralce 10g Database

Download OC4J 10.1.2 standalone and define ${ORACLE_HOME} as described in Section 1.1. The command below loads the client into the user schema.

% loadjava -u scott/tiger -r -f -v -genmissing ${ORACLE_HOME}/soap/lib/soap.jar ${ORACLE_HOME}/lib/dms.jar ${ORACLE_HOME}/jlib/javax-ssl-1_1.jar ${ORACLE_HOME}/j2ee/home/lib/servlet.jar ${ORACLE_HOME}/j2ee/home/lib/mail.jar ${ORACLE_HOME}/j2ee/home/lib/activation.jar ${ORACLE_HOME}/j2ee/home/lib/http_client.jar ${ORACLE_HOME}/j2ee/home/lib/ejb.jar

Again, if the user has "Grant Public" privileges, then add -grant public to the command above to make the loaded classes visible to other schemas.

1.3. Loading Oracle JAX-RPC client into Oralce 10g Database

  Note:
  Either version of the callout utility for 10g databases contains:
  • A component used by JPublisher to generate Web Service client proxy
  • Oracle JAX-RPC client runtime released with OracleAS 10.1.3
  • Oracle SOAP client runtime released with OracleAS 10.1.2
       1.3.1. Loading the Oracle JAX-RPC client into Oracle 10g Release 1 Database

         Load the webservice client into the SYS schema:
    % loadjava -u sys/change_on_install -r -v -f -genmissing ?s ?grant public dbwsclientws.jar dbwsclientdb101.jar

        Alternatively, load the webservice client into a user schema using the command:
    % loadjava -u scott/tiger -r -v -f -genmissing dbwsclientws.jar dbwsclientdb101.jar
       
         Continue to Section 2.3.

        1.3.2. Loading the Oracle JAX-RPC client into Oracle 10g Release 2 Database

     Load the webservice client into the SYS schema:
     % loadjava -u sys/change_on_install -r -v -f -genmissing ?s ?grant public dbwsclientws.jar dbwsclientdb102.jar

         Alternatively, load the webservice client into a user schema using the command:
     % loadjava -u scott/tiger -r -v -f -genmissing dbwsclientws.jar dbwsclientdb102.jar

          Continue to Section 2.3.

     If the user has "Grant Public" privileges, then add -grant public to the command above to make the loaded classes visible to other schemas.

2. Generating the Proxy

In this section, we describe the required steps for generating Web Service client proxy using JPublisher. Including: downloading appropriate utility, setting up the environement, and evetually running JPublisher.

2.1. Generating Proxy for Oracle 9.2 Database Using Oracle SOAP client

Download and install JPublisher 10.1, if you do not have it installed already.
 
Download and install 10.1.2 Callout Utility for 10g RDBMS. Notably, the utility contains the jar file sqlj/lib/utl_dbws.jar, which is the utility JPublisher used to generate Web Service client proxy.

Include the following jar files in the CLASSPATH environment variable.
  • ${ORACLE_HOME}/sqlj/lib/utl_dbws.jar
  • ${ORACLE_HOME}/sqlj/lib/translator.jar
  • ${ORACLE_HOME}/sqlj/lib/runtime12.jar
  • ${ORACLE_HOME}/jdbc/lib/classes12.jar
Set up the environment to use JDK 1.3. Add JDK 1.3 JAVA_HOME/bin into the PATH environment variable, for example.

Download the Web Service WSDL file and run JPublisher command to generate the client proxy. Here, we use a sample Web Service available on the internet to illustrate the command.  The sample service provides weather information for cities of given zipcodes with the endpoint below.

http://services.xmethods.net:80/soap/servlet/rpcrouter

To verify wheather the service is available, access the URL above from the web browser. The return message should be

SOAP RPC Router
Sorry, I don't speak via HTTP GET- you have to use HTTP POST to talk to me.

Although the service can be unavailable any time, the example below illustrates in general how to run JPublisher command utiltiy.

Download the service WSDL file TemperatureService.wsdl from


Run JPublisher to generate client proxy and its PL/SQL wrapper, and load them into the SCOTT schema. If you are not running inside a firewall, remove the -httpproxy option. Otherwise, adjust the -httpproxy setting to point to your actual http proxy host and port.

% jpub -u scott/tiger -sysuser sys/change_on_install -proxywsdl=TemperatureService.wsdl -httpproxy=www-proxy.us.oracle.com:80 -endpoint=http://services.xmethods.net:80/soap/servlet/rpcrouter -proxyopts=soap,tabfun -dir=weather -plsqlpackage=soap_callout_wrapper

weather/TemperatureServiceProxyJPub.java
weather/plsql_wrapper.sql
weather/plsql_dropper.sql
weather/plsql_grant.sql
weather/plsql_revoke.sql
Executing weather/plsql_wrapper.sql
Executing weather/plsql_grant.sql
Loading weather/plsql_proxy.jar

The option -proxyopts=soap is required. It instructs JPublisher to generate client proxy based on Oracle SOAP client runtime.

Run the PL/SQL wrapper to invoke the Web Service. In SQLPLUS, run the PL/SQL wrapper method to get the temperature for the zipcode 97229.

SQL> conn scott/tiger
SQL> select soap_callout_wrapper.gettemp('97229') from dual; SOAP_CALLOUT_WRAPPER.GETTEMP('97229')
-----------------------------------
50
The output shows that the current temperature for Portland is 50 degree. In SQLPLUS, run the PL/SQL table function to get the temperature for a list cities specified by the zipcode table.

SQL> create table zipcodes(zip varchar2(5));
SQL> insert into zipcodes values('97006');
SQL> insert into zipcodes values('67003');
SQL> insert into zipcodes values('19023');
SQL> insert into zipcodes values('98271');
SQL> insert into zipcodes values('83281');
SQL> SELECT * FROM TABLE(SOAP_CALLOUT_WRAPPER. TO_TABLE_gettemp(CURSOR(SELECT * FROM zipcodes)));
SQL> P0 RES
SQL> ----------
SQL> 97006 50
SQL> 67003 63
SQL> 19023 53
SQL> 98271 48
SQL> 83281 44

The output shows that the temperature for the given zipcode cities are 50, 63, 53, etc.

2.2. Generating Proxy for Oracle 10g Database using Oracle SOAP Client

For callout using that Oracle SOAP client, follow the instruction in the next section, but specify -proxyopts=soap in the jpub command, or add soap into -proxyopts setting, such as -proxyopts=soap,tabfun.

2.3 Generating Proxy for Oracle 10g Database using Oracle JAX-RPC Client

Download and install JPublisher 10.2. Add the following jar files into the CLASSPATH environment variable:
  • ${ORACLE_HOME}/sqlj/lib/dbwsa.jar
  • ${ORACLE_HOME}/sqlj/lib/translator.jar
  • ${ORACLE_HOME}/sqlj/lib/runtime12.jar
  • ${ORACLE_HOME}/jdbc/lib/ojdbc14.jar
Set up the environment to use JDK1.4. Include JDK 1.4 JAVA_HOME/bin in the PATH environment variable, if necessary.

Run JPublisher to generate Web Services client proxy and the PL/SQL wrapper. Here is an example using the Web Service application included in the  callout utility. Before generating Web Service client proxy, we first deploy the Web Service appliccation, called javacallout, to an OC4J instance.

% java -jar $ORACLE_HOME/j2ee/home/admin_client.jar deployer:oc4j:localhost:23791 oc4jadmin welcome -file javacallout.ear -deploymentName javacallout -bindAllWebApps default-web-site

The samples/javacallout.wsdl file is the WSDL file for the webservices deployed above. Suppose the Web Service is deployed to the following endpoint.

http://localhost:8888/javacallout/javacallout

Then the command

% jpub -u scott/tiger -sysuser sys/change_on_install -proxywsdl=sample/javacallout.wsdl  -endpoint=http://localhost:8888/javacallout/javacallout

creates the Web Service client proxy and its Java and PL/SQL wrappers, and then loads the proxy and wrappers into the database. The output from the command above would be
 
HelloServiceEJBJPub.java
plsql_wrapper.sql
plsql_dropper.sql
plsql_grant.sql
plsql_revoke.sql
Executing plsql_dropper.sql
Executing plsql_wrapper.sql
Executing plsql_grant.sql
Loading plsql_proxy.jar

Run PL/SQL to invoke the Web Service. In SQLPLUS, one can invoke the PL/SQL functions provided in plsql_wrapper.sql. Each PL/SQL function corresponds to an operation in that Web Service. For example, the command

SQL> select jpub_plsql_wrapper.sayhello('hello') from dual;

will return

JPUB_PLSQL_WRAPPER.SAYHELLO('HELLO')
-----------------------------------
HELLO!! You just said :hello

3. Invoking Web Service Using DII APIs

It is also possible to invoke Web Service with out generating and loading client proxy, by using Web Service client DII APIs or PL/SQL DII APIs in SYS.UTL_DBWS. The PL/SQL user can invoke WebServices using the PL/SQL package SYS.UTL_DBWS, which provides wrappers functions for the JAX-RPC dynamic invocation APIs. The following procedure set up a Oracle 10g database for webservice callout using SYS.UTL_DBWS and Oracle JAX-RPC client.
  1. Prepare the database according to Section 1.3. In addition to dbwsa.jar, the download also contains SQL scripts utl_dbws_decl.sql and utl_dbws_body.sql.
  2. Execute utl_dbws_decl.sql and utl_dbws_body.sql as SYS. Now you are ready to use SYS.UTL_DBWS to call webservices.
The SQL scripts samples/test-plsql-dii.sql and samples/test-plsql-dii2.sql invokes the sayHello operation defined in javacallout.wsdl. Both SQL scripts are included in download zip file mentioned in Section 1.3. Examine the two scripts for their correspondences with the WSDL file. Both scripts output the result PL/SQL DII client return

HELLO!! You just said :hello

Refer to PL/SQL Packages and Types Reference 10g Release 2 (10.2). for details on SYS.UTL_DBWS.

4. TroubleShooting

This section discusses common problems encounted in Web Service callout.

4.1. ORA-04031: unable to allocate shared memory

When: at loading Web Service client runtime into the database.
Error:
resolving: class com/sun/msv/datatype/xsd/AnyURIType
Error while resolving com/sun/msv/datatype/xsd/AnyURIType
    ORA-04031: unable to allocate 4096 bytes of shared memory ("java pool","unknown object","joxlod exec hp","SGAClass")

resolving: class oracle/j2ee/ws/client/BasicService$HandlerRegistryImpl
Error while resolving oracle/j2ee/ws/client/BasicService$HandlerRegistryImpl
    ORA-04031: unable to allocate 16 bytes of shared memory ("shared pool","unknown object","joxlod exec hp","kglhin: temp")

resolving: class oracle/j2ee/ws/client/BasicService
Error while resolving oracle/j2ee/ws/client/BasicService
    ORA-04031: unable to allocate 16 bytes of shared memory ("shared pool","unknown object","joxlod exec hp","kglhin: temp")
The following operations failed
    class com/sun/msv/datatype/xsd/AnyURIType: resolution
    class oracle/j2ee/ws/client/BasicService$HandlerRegistryImpl: resolution
    class oracle/j2ee/ws/client/BasicService: resolution
    class oracle/j2ee/ws/client/ServiceFactoryImpl: resolution

Solution: Increase the java_pool_size and shared_pool_size in the pfile, restart the database and re-load the client runtime.
 

4.2. ORA-29521: referenced name could not be found

When: at loading Web Service client runtime into the database
Error:
ORA-29521: referenced name javax/management/MBeanServer could not be found
ORA-29521: referenced name javax/management/ObjectName could not be found

Solution: Ensure that -genmissing is used in the loadjava command. 

4.3. Cannot run CompileTool for the given wsdl file

When: at performing JPublisher command
Error:
Error: Cannot run CompileTool for the given wsdl file. Please make sure sqlj/lib
/utl_dbws.jar exists and appears in the classpath.

Solution: When running JPublisher 10.1, the sqlj/lib/utl_dbws.jar is required in the classpath. Include that file to fix the error. Another possible cause is the -proxywsdl setting bering a URL with "http://" prefix. JPublisher 10.1 can not correctly fetch the WSDL file through HTTP URL. So one needs to specify a local file in the -proxywsdl setting. As a workaround, download the WSDL file to a local directory and use that file for -proxywsdl.

4.4. Bad Class File or ORA-29552: Verification Warning

When: at performing JPublisher command
Error:   
javacallout/src/javacallout/HelloServiceInfPortClient.java:8: cannot access oracle.webservices.transport.ClientTransport
bad class file: /oracle/product/10.2.0.1/sqlj/lib/dbwsa.jar(oracle/webservices/transport/ClientTransport.class)
class file has wrong version 48.0, should be 47.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
import oracle.webservices.transport.ClientTransport;
^
1 error
No files written

The same JDK issue may appear in form of ORA-29552 error, e.g.,

ORA-29552: verification warning: java.lang.UnsupportedClassVersionError: GoogleSearchResult (Unsupported major.minor version 49.0)

Solution: The error is due to the JDK version in the enviroment being higher than the JDK version of the database JAVAVM. To fix this JDK issue, use the same JDK version as the one used by the JAVAVM. For Oracel 9.2 database use JDK 1.3. For Oracle 10.2 database, use JDK 1.4.

4.5. Failed to read WSDL

When: at performing JPublisher command
Error.

SEVERE: WSDL validation failed. WSDLException: faultCode=OTHER_ERROR: Failed to
read WSDL from http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsd
l:Read timed out
SEVERE: Caught WSDL validation exception: WSDLException: faultCode=OTHER_ERROR:
Failed to read WSDL from http://services.xmethods.net/soap/urn:xmethods-delayed-
quotes.wsdl:Read timed out

Solution: The error is likey caused by unavailable service or improper proxy setting. Check whether the WSDL file is available to your web browser. Also check or add the -httpproxy option.

4.6. Warning: no loadjava utility

When: at performing JPublisher command
Error:
WARNING: no loadjava utility. Please manually load the Java code.
java.lang.ClassNotFoundException: oracle.aurora.server.tools.loadjava.LoadJavaMa
in

Solution: The loadjava error is due to missing loadjava client in the environment. By default, JPublisher requires the loadjava utility to load the generated Java wrapper. Either run jpub in an environment with loadjava installed, or specify "-proxyopts=noload" in the jpub command so that to JPublisher will skip loading the wrappers.

4.7. Error connecting as SYSDBA

When: at performing JPublisher command using JDBC thin driver connecting to the database
Error:
Error connecting as SYSDBA. Please load the file in question manually. For automatic loading into remote databases or through thin drivers, please set up the password file for remote SYS connection according to Oracle JDBC Developer's Guide.
Error executing weather/plsql_grant.sql: null. Please run that script as SYSDBA.
Error connecting as SYSDBA. Please load the file in question manually. For automatic loading into remote databases or through thin drivers, please set up the password file for remote SYS connection according to Oracle JDBC Developer's Guide.
Error granting loading permission: null
Loading weather/plsql_proxy.jar
Error while turning off verifier
    ORA-29532: Java call terminated by uncaught Java exception: java.security.AccessControlException: the Permission (oracle.aurora.security.JServerPermission Verifier) has not been granted to SCOTT. The PL/SQL to grant this is dbms_java.grant_permission( 'SCOTT', 'SYS:oracle.aurora.security.JServerPermission', 'Verifier', '' )

Error while turning off verifier
    ORA-29532: Java call terminated by uncaught Java exception: java.security.AccessControlException: the Permission (oracle.aurora.security.JServerPermission Verifier) has not been granted to SCOTT. The PL/SQL to grant this is dbms_java.grant_permission( 'SCOTT', 'SYS:oracle.aurora.security.JServerPermission', 'Verifier', '' )

Solution: Configure the SYS user name and password for remote access. Alternatively, ignore the error, and load JPublisher-generated SQL scripts and wrappers into the database mannually.

4.8. No match

When: at performing JPublisher command
Error:
% jpub -proxywsdl=http://localhost:8888/PLSQLRefCurWS/PLSQLRefCurWS?wsdl 
java: No match.

Solution: The error is caused by the shell program attempting to resolve ? as a wild card character. Quotating the proxywsdl parameter should resolve that error, for example.

% jpub -proxywsdl="http://localhost:8888/PLSQLRefCurWS/PLSQLRefCurWS?wsdl

4.9. ORA-29532: Java call terminated by uncaught Java exception

When: running the PL/SQL wrapper to invoke the Web Service
Error:
SQL> select jpub_plsql_wrapper.sayHello('hello from outer space') from dual;
select jpub_plsql_wrapper.sayHello('hello from outer space') from dual;
                                                    *
ERROR at line 1:
ORA-29532: Java call terminated by uncaught Java exception:
java.rmi.RemoteException: Provider oracle.j2ee.ws.client.ServiceFactoryImpl not
found
ORA-06512: at "SCOTT.JPUB_PLSQL_WRAPPER", line 1
ORA-06512: at line 2

Solution: If no detailed message shows up in SQLPLUS, the detailed Java stack can normally be found in the log directory of the database installation for Unix, or in the UDUMP area for the Windows. Look for files containing the string ORA-29532.

4.10. Message send failed: the Permission (java.lang.RuntimePermission setFactory) has not been granted

When: running the PL/SQL wrapper to invoke the Web Service
Error:
SQL> select jpub_plsql_wrapper.checkphonenumber('6103831264','0') from dual;
select jpub_plsql_wrapper.checkphonenumber('6103831264','0') from dual
                                                                  *
ERROR at line 1:
ORA-29532: Java call terminated by uncaught Java exception:
java.rmi.RemoteException: java.rmi.RemoteException:HTTP transport error:
javax.xml.soap.SOAPException: java.security.PrivilegedActionException:
javax.xml.soap.SOAPException: Message send failed: the Permission
(java.lang.RuntimePermission setFactory) has not been granted to SCOTT. *The
PL/SQL to grant this is dbms_java.grant_permission( 'SCOTT',
'SYS:java.lang.RuntimePermission', 'setFactory', '' );* nested exception is:
HTTP transport error: javax.xml.soap.SOAPException:
java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message
send failed: the Permission (java.lang.RuntimePermission setFactory) has not
been granted to SCOTT. The PL/SQL to grant this is dbms_java.grant_permission(
'SCOTT', 'SYS:java.lang.RuntimePermission', 'setFactory', '' )

Solution: JPublisher generates a file postfixed with "grant.sql", which grants necessary permission for Web Service invocation. Make sure that this script has been run properly in the SYS schema. Another reason for such error is a bug in JPublisher 10.2 where the particular "setFactory" permission was not included in the grant.sql file. That bug will be fixed in post-10.2 releases. For JPubliser 10.2, please mannually grant that permission inside SYS schema, using the script:

SQL> call dbms_java.grant_permission('SCOTT', 'SYS:java.lang.RuntimePermission', 'setFactory', '' );

If JPublisher 10.1.0.2  is used to generated the PL/SQL wrapper, run the following scripts in SYS, in addition to the script generated in grant.sql.

SQL> call dbms_java.grant_permission('SCOTT', 'SYS:java.lang.RuntimePermission', 'setFactory', '' );
SQL> call dbms_java.grant_permission( 'SCOTT', 'SYS:java.lang.RuntimePermission', 'shutdownHooks', '' );
SQL> call dbms_java.grant_permission( 'SCOTT', 'SYS:java.util.logging.LoggingPermission', 'control', '' );

4.11. NoClassDefFoundError

When: running JPublisher-generated PL/SQL wrappers may give NoClassDefFoundError:
Error:
SQL> BEGIN DBMS_OUTPUT.PUT_LINE(JPUB_PLSQL_WRAPPER.sayHello('Andrew')); END;
/
BEGIN
*
ERROR at line 1:
ORA-29532: Java call terminated by uncaught Java exception:
java.lang.NoClassDefFoundError: generated by genmissing
ORA-06512: at "SYS.JPUB_PLSQL_WRAPPER", line 1
ORA-06512: at line 2

Solution: Inspect the trace files under the log directory for Unix or the trace files under UDUMP dirctory for the detailed Java stack trace with NoClassDefFoundError. Check any abnormality during loading Web Service client runtime or performing JPublisher command. Report a bug if no abnormality found during those two steps.

4.12.   java.lang.ExceptionInInitializerError

When: running JPublisher-generated PL/SQL wrappers
Error:

ERROR at line 1:
ORA-29532: Java call terminated by uncaught Java exception:
java.lang.ExceptionInInitializerError
ORA-06512: at "SCOTT.JPUB_PLSQL_WRAPPER", line 1
ORA-06512: at line 1

Solution: Inspect the trace files under the log directory for Unix or the trace files under UDUMP directory for the detailed Java stack trace with ExceptionInInitializerError. Typically, the trace file suggusts that certain permissions need to be granted to the schema running the webservice client. Try the following SQL scripts and then rerun the PL/SQL wrapper.


SQL> conn sys/change_on_install as sysdba
SQL> call dbms_java.grant_permission( 'SCOTT', 'SYS:java.lang.RuntimePermission', 'shutdownHooks', '' );
SQL> call dbms_java.grant_permission( 'SCOTT', 'SYS:java.util.logging.LoggingPermission', 'control', '' );

5. Changes in this Document

This document differs from previously release README document with 10.1.2 Callout Utility for 10g RDBMS and 10.1.3 Callout Utility for 10g (R1 + R2) RDBMS. Previously, we recommended loading Web Service client runtime into SYS schema to make the runtime available to other schemas. This document recommend loading the client runtime into the user schema, to avoid overwriting existing classes in SYS by dbwsa.jar classes. The loading schema can grant priviliges to other schemas to make loaded classes available elsewhere.

6. Documentation and Links

E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy