This discussion is archived
2 Replies Latest reply: Feb 7, 2013 9:01 AM by 989824 RSS

Unknown Forms failure in create_obj in CLIENT_OLE2 when communicating with

711559 Newbie
Currently Being Moderated
Dears,
I have a code running fine in forms 6, this code communicates with external COM located in client machine. I'm migrating the application to 10g and using WebUtil for OLE2 communication based on this article http://www.oracle.com/technology/products/forms/htdocs/webutil/howto_ole.html. The code is failing in create_obj method in CLIENT_OLE2

The code is as follows:
DECLARE
sd CLIENT_OLE2.OBJ_TYPE;
args CLIENT_OLE2.LIST_TYPE;
BEGIN
sd := CLIENT_OLE2.CREATE_OBJ('yyy.xxxcom');
CLIENT_OLE2.SET_PROPERTY(sd,'p1',1);
-- ...
END;

I just find the browser is not returning anything, as if it is hanging. Trying to solve the issue I got the code for create_obj from webutil.pll and tried to call it for debugging the issue:

FUNCTION create_obj(object IN VARCHAR2) RETURN CLIENT_OLE2.OBJ_TYPE is
v_objHandle CLIENT_OLE2.OBJ_TYPE;
v_javaHandle varchar2(6);
BEGIN
MSG(4,4,0);
-- check if OLE object name is valid
if ((object is null) or (object = '')) then
raise CLIENT_OLE2.OLE_ERROR;
end if;
WebUtil_Core.setProperty(WebUtil_Core.WUO_PACKAGE,'WUO_OLE2_OBJNAME',object);
MSG(6,6,0);
v_javaHandle := WebUtil_Core.getProperty(WebUtil_Core.WUO_PACKAGE,'WUO_OLE2_CREATE_OBJ');

-- check if the OLE Object handle is valid
if (v_javaHandle is null) or (v_javaHandle='') or (v_javaHandle='-1') then
raise CLIENT_OLE2.OLE_ERROR;
end if;
MSG(7,7,0);
v_objHandle := to_number(v_javaHandle);
MSG(8,8,0);
return(v_objHandle);
EXCEPTION
when WebUtil_Core.BEAN_NOT_REGISTERED then
MSG('N','N',0);
WebUtil_Core.ErrorAlert(WebUtil_Core.getImplClass(WebUtil_Core.WUO_PACKAGE)
||' bean not found. CLIENT_OLE2.create_obj will not work');
RAISE CLIENT_OLE2.OLE_ERROR;
when WebUtil_Core.PROPERTY_ERROR then
MSG('T','T',0);
RAISE CLIENT_OLE2.OLE_ERROR;
when VALUE_ERROR then
MSG('V','V',0);
RAISE CLIENT_OLE2.OLE_ERROR;
when CLIENT_OLE2.OLE_ERROR then
MSG('O','O',0);
RAISE FORM_TRIGGER_FAILURE;

END create_obj;

The problem happens in line (v_javaHandle := WebUtil_Core.getProperty(WebUtil_Core.WUO_PACKAGE,'WUO_OLE2_CREATE_OBJ');) there is something wrong and it is not even caught by exception clause mentioned above.

Can anyone help?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points