|
|
|
|||||
|
"NoObjectFactoryException" when call methods in interface by java
when I call a method in interface that was generated by C++ by java, It generated exception as follows:
Ice.NoObjectFactoryException reason = (null) type = "::WASP::PlayerInfo" The phenomena is: when the value returned is empty, the exception above not appear. But when the value not empty, the exception appear. why??? |
|
|||||
|
Update over
I've done it!
__________________
Wireless Support Platform --------------------------------------------- Yanbo Ma Central University for Nationality, P.R.China http://www.cun.edu.cn yanboma_bj@yahoo.com.cn --------------------------------------------- |
|
|||||
|
need factory?
my slice definition as follows:
class Player { int iActId; int iId; string sPlayerId; ...... } class PlayerInfo extends Player { int iSupVoteNum; int iOppVoteNum; }; sequence<PlayerInfo> SeqPlayInfo; interface trans { SeqPlayInfo GetVoteObjInfo( int iActId, int iPage ); } =========================================== The methods I call by java client is 'GetVoteObjInfo' in interface trans, No methods in class PlayerInfo, so the server implement by C++ doesn't need factory. right?
__________________
Wireless Support Platform --------------------------------------------- Yanbo Ma Central University for Nationality, P.R.China http://www.cun.edu.cn yanboma_bj@yahoo.com.cn --------------------------------------------- |
|
||||||
|
It's not clear from your definitions if the Player class has some methods or not. If it has some methods, then it's abstract and the PlayerInfo class is also abstract since it extends it. So you'll need to register an object factory for the PlayerInfo type if this is the case.
Benoit. |
|
|||||
|
hi
thanks
the Player class hasn't methods
__________________
Wireless Support Platform --------------------------------------------- Yanbo Ma Central University for Nationality, P.R.China http://www.cun.edu.cn yanboma_bj@yahoo.com.cn --------------------------------------------- |
|
||||||
|
Ok, so you don't need to register an object factory
.When the Ice for Java runtime receives the "::WASP::PlayerInfo" type, it transforms it to the WASP.PlayerInfo Java class name. It then tries to load this class and instantiates it. If it can't find the class, it throws an Ice.ObjectFactoryException. Is your CLASSPATH correctly setup? Is the WASP.PlayerInfo class in your CLASSPATH? If it's not this might be the reason for this exception. Also, please post the full stack trace of the exception if possible, this would help to figure out where exactly the exception coming from. One last thing, if you're using a specific package for your Java generated classes, you will need to set the Ice.Default.Package or Ice.Package.<module> configuration property. See Section 10.15 and 10.15.2 in particular for more information about this. Benoit. |
|
|||||
|
thanks
![]()
__________________
Wireless Support Platform --------------------------------------------- Yanbo Ma Central University for Nationality, P.R.China http://www.cun.edu.cn yanboma_bj@yahoo.com.cn --------------------------------------------- |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Don't "Ice-3.1.1-VC71.msi " include the "slice2java.exe"? | Jason Gao | Help Center | 4 | 10-26-2006 12:23 PM |
| IceStorm "batch" reliability with Java? | SteveWampler | Help Center | 3 | 10-27-2005 02:54 PM |
| Testing the "printer" example in java? | zyoracle | Help Center | 2 | 06-20-2005 06:22 AM |
| starting "ice" process (node/admin etc) via Java | BobDeAnna | Help Center | 6 | 01-04-2005 10:26 AM |
| Going from "in" to "out" param, using a class as a union | catalin | Help Center | 1 | 04-05-2004 09:55 AM |