Returning interface reference of a object from a factory kind of class
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Pradeep_Palkonda
Posted On:   Tuesday, May 20, 2003 08:03 AM

Before i ask my question let me tell wat am i doing in my work.. i have declared two interfaces in my idl file, one is kind of factory interface and other is a normal interface. the client is java and server is in c++(visibroker for ORB), the client makes an instance of factory class and calls a method on it and in that method the factory class makes an instance of the other class which implements the second interface and sends back the refereence to the client. When i run the java client i get the following error: org.omg.CORBA.UNKNOWN: vmcid: OMG minor code: 0 completed: No at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInst   More>>

Before i ask my question let me tell wat am i doing in my work..


i have declared two interfaces in my idl file, one is kind of factory interface and other is a normal interface. the client is java and server is in c++(visibroker for ORB), the client makes an instance of factory class and calls a method on it and in that method the factory class makes an instance of the other class which implements the second interface and sends back the refereence to the client. When i run the java client i get the following error:


org.omg.CORBA.UNKNOWN: vmcid: OMG minor code: 0 completed: No
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:306)
at java.lang.Class.newInstance(Class.java:259)
at com.inprise.vbroker.orb.SE.read(SE.java:28)
at com.inprise.vbroker.orb.DelegateImpl.handleReply(DelegateImpl.java:80
0)
at com.inprise.vbroker.orb.DelegateImpl.invoke(DelegateImpl.java:686)
at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457)
at IRET._IRETServerStub.getIntValue(_IRETServerStub.java:41)
at ClientInt.main(ClientInt.java:17)


i will put the IDL also


module IRET {


//Second Interface
interface IRETSecond
{
void sendModifiedValue(out string strRetVal);
};


//Server Interface
interface IRETServer
{
IRETSecond getIntValue();
};


};


implementation of server



#include "TestRetInt_s.h"



class INTImpl : public POA_IRET::IRETSecond,
public PortableServer::RefCountServantBase



{
public:
INTImpl()
{
}

virtual void sendModifiedValue(CORBA::String_out strRetVal)
{
strRetVal = "abcd";
return;
}
};



class TestNSImplServer : public POA_IRET::IRETServer,
public PortableServer::RefCountServantBase
{
public:
IRET::IRETSecond_ptr getIntValue()
{
INTImpl* objRETSecond = new INTImpl();
return (IRET::IRETSecond_ptr)objRETSecond ;
}
};


am i wrong somewhere ..pls let me know as soon possible

regards
pradeep

   <<Less
About | Sitemap | Contact