Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / CORBA / June 2004

Tip: Looking for answers? Try searching our database.

JacORB: Passing a sequence of valuetype

Thread view: 
Maurizio Fuschetto - 20 May 2004 08:29 GMT
This is my IDL (and I hope it's right):

------
module eventDispatcherInterface {
typedef boolean Success;

valuetype BSIEvent {
 attribute string theSource;
 attribute string theDestination;
 attribute string theDetails;
 attribute long param1;
 attribute long param2;
};                      

typedef sequence<BSIEvent> BSIEventsList;

 interface LocalEvDispatcherInterface {
   blahblahblah ...
   Success Dispatch(in BSIEventsList theEvents);
   blahblahblah ...
 };
 
 interface blahblahblah {
   blahblahblah ...
 };
};
-----

But when I invoke the Dispatch method, at server side the following
exception is thrown:

[jacorb.poa] INFO : rid: 204 opname: Dispatch invocation: system
exception was thrown (No factory found for:
IDL:eventDispatcherInterface/BSIEvent:1.0)
[jacorb] ERROR : org.omg.CORBA.MARSHAL: No factory found for:
IDL:eventDispatcherInterface/BSIEvent:1.0  vmcid: 0x0  minor code: 0
completed: No
    at org.jacorb.orb.CDRInputStream.read_untyped_value(CDRInputStream.java:2426)
    at org.jacorb.orb.CDRInputStream.read_typed_value(CDRInputStream.java:2564)
    at org.jacorb.orb.CDRInputStream.read_value(CDRInputStream.java:2248)
    at it.sia_av.bsi.kernel.elaboration.eventDispatcherInterface.BSIEventHelper.read(BSIEventHelper.java:61)
    at it.sia_av.bsi.kernel.elaboration.eventDispatcherInterface.BSIEventsListHelper.read(BSIEventsListHelper.java:51)
    at it.sia_av.bsi.kernel.elaboration.eventDispatcherInterface.LocalEvDispatcherInterfacePOA._invoke(LocalEvDispatcherInterfacePOA.java:48)
    at org.jacorb.poa.RequestProcessor.invokeOperation(RequestProcessor.java:281)
    at org.jacorb.poa.RequestProcessor.process(RequestProcessor.java:576)
    at org.jacorb.poa.RequestProcessor.run(RequestProcessor.java:718)

The IDL compiler also generated the BSIEventDefaultFactory so it
should find it automatically.
Why doesn't this happen?
Shashank - 29 May 2004 14:02 GMT
You have to explicitly register Valuetype factory implementation with ORB.

> This is my IDL (and I hope it's right):
>
[quoted text clipped - 46 lines]
> should find it automatically.
> Why doesn't this happen?
lizard43 - 11 Jun 2004 01:59 GMT
The error says that a factory wasn't found - creating and registering
a valuetype factory will fix the problem.  But you don't always need
one with JacORB.  If you've named your Impl correctly and followed a
few other simple rules, you can get away without having to mess with
implementing and registering a factory.

From the JacORB Programmer's Guide:

JacORB's convenience mechanism is straightforward:
If the implementation class for an IDL value type A is named AImpl,
resides in the same package as A, and has a no-argument constructor,
then no value factory is needed for that type.

In other words, if your implementation class follows the common naming
convention ("...Impl"), and it provides a no-arg constructor so that
the ORB can instantiate it, then the ORB has all that it needs to (a)
find the implementation class, and (b) create an instance of it (which
is then initialized with the unmarshaled state from the wire).

BTW, if you do decide to create and register a valuetype factory, the
generated ValueFactory class is simply an interface and you still need
to provide an implementation.

Good luck,
David

> You have to explicitly register Valuetype factory implementation with ORB.
>
[quoted text clipped - 48 lines]
> > should find it automatically.
> > Why doesn't this happen?


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.