Access Violation While Detaching Libraries From Forms Using JDAPI
(Doc ID 287106.1)
Last updated on APRIL 23, 2023
Applies to:
Oracle Forms - Version 10.1.2.3.0 and laterOracle Forms for OCI - Version 12.2.1.4.0 and later
Information in this document applies to any platform.
Symptoms
You receive the following error while detaching PL/SQL Library via JDAPI :
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at
PC=0x2FEBB7C
Function=icobad+0xC
Library=<ORACLE_HOME>\bin\ifcom90.dll
Current Java thread:
at oracle.forms.jdapi.BaseAPI._jni_save_form(Native Method)
at oracle.forms.jdapi.FormModule.save(Unknown Source)
at DetachLib.main(DetachLib.java:46)
The java code for detaching a PL/SQL Library from Forms is as follows:
--------------------------------------------------------------------------------------------------------------------------------------------------
import oracle.forms.jdapi.*;
public class DetachLib
{
public static void main(String[] args)
{
if (args.length < 2)
{
System.out.println("This program detaches a given library from a form,
given the");
System.out.println("filename of the source (fmb) and the library
name.");
System.out.println();
System.out.println("parameters: fmbFileName libraryName");
System.exit(-1);
}
String fmbFileName = args[0];
String libraryName = args[1];
if (libraryName.toLowerCase().endsWith(".pll"))
libraryName = libraryName.substring(0, libraryName.lastIndexOf('.'));
AttachedLibrary lib;
System.out.println("opening form " + fmbFileName);
FormModule fmb = FormModule.open(fmbFileName);
boolean detached = false;
JdapiIterator libs = fmb.getAttachedLibraries();
while (libs.hasNext())
{
lib = (AttachedLibrary) libs.next();
String libName = lib.getName();
if (libName.equalsIgnoreCase(libraryName))
{
System.out.println("detaching " + libName + "...");
lib.detach();
detached = true;
System.out.println("detached library " + libName);
}
}
if (detached)
{
System.out.println("saving form " + fmbFileName);
fmb.save(fmbFileName);
System.out.println("saved.");
}
Jdapi.shutdown();
}
}
Cause
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |