Adding a valuetype to IDL, compile and it fails with "No factory found"
I can't figure out why the client keeps complaining about the not finding the factory method. I've tried the IDL with and without the "factory" keyword and that didn't change the behavior. The SDMGeoVT IDL matches other objects used (which run successfully).
The SDMGeoVT classes generated match other generated classes in regards to inheritance and methods.
The IDL is as follows; The idlj compiler runs w/o error. I implement the function on the server and I see the server code run and serialize the object over the wire (the server code runs fine).
The client bombs with the following stack trace (the first couple of lines is from the jacORB library).
I've created a small app just to compile and test the code (ArrayClient & ArrayServer). The base app (from the jacORB demo) works fine.
I've tried using the base class OFBaseVT and a single object (SDMGeoVT vs the list return) and have the same issue.
2010-05-27 15:37:11.813 FINE read GIOP message of size 100 from ClientGIOPConnection to 127.0.0.1:47030 (1e4853f)
2010-05-27 15:37:11.813 FINE read GIOP message of size 100 from ClientGIOPConnection to 127.0.0.1:47030 (1e4853f)
org.omg.CORBA.MARSHAL: No factory found for: IDL:pl/SDMGeoVT:1.0
at org.jacorb.orb.CDRInputStream.read_untyped_value(CDRInputStream.java:2906)
at org.jacorb.orb.CDRInputStream.read_typed_value(CDRInputStream.java:3082)
at org.jacorb.orb.CDRInputStream.read_value(CDRInputStream.java:2679)
at com.helloworld.pl.SDMGeoVTHelper.read(SDMGeoVTHelper.java:106)
at com.helloworld.pl.SDMGeoVTListHelper.read(SDMGeoVTListHelper.java:51)
at com.helloworld.pl._PLManagerIFStub.getSDMGeos(_PLManagerIFStub.java:28)
at com.helloworld.ArrayClient.<init>(ArrayClient.java:40)
at com.helloworld.ArrayClient.main(ArrayClient.java:125)
valuetype SDMGeoVT : common::OFBaseVT{
private string sdmName;
private string 开发者_如何学Python zip;
private string atz;
private long long primaryDeptId;
private string deptName;
factory instance(in string name,in string ZIP,in string ATZ,in long long primaryDeptId,in string deptName,in string name);
string getZIP();
void setZIP(in string ZIP);
string getATZ();
void setATZ(in string ATZ);
long long getPrimaryDeptId();
void setPrimaryDeptId(in long long primaryDeptId);
string getDeptName();
void setDeptName(in string deptName);
};
typedef sequence<SDMGeoVT> SDMGeoVTList;
interface PLManagerIF : PublicManagerIF {
pl::SDMGeoVTList getSDMGeos(in framework::ITransactionHandle tHandle, in long long productionLocationId);
};
EDIT: Changing the IDL to be a struct vs a valuetype works. previously i've created a new interface and that failed with the same issue.
Edit: Yes updated the server as well. The server and client code is the same code base. I have to put in the ant script that builds both sets; the -fall and -ftie options.
Edit: (jun 10) Narrowed it down to the overly complex framework that the original builders created (maintenance programmer, yea!) There is a call in one of the "supers" that need to be done.
Perhaps you need to define a value factory for pl.SDMGeoVT valuetype, and register an instance of the factory with the ORB.
JacORB has a proprietary (non-portable) feature that lets you avoid creating a value factory for your valuetype. If your implementation of the valuetype SDMGeoVT is called SDMGeoVTImpl and you declare it in your "pl" package and if it has a no-argument constructor, then you will not need a value factory.
See the PDF file in the JacORB distribution's docs directory for details of both of the above options.
精彩评论