Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trouble with writting a Factory with CORBA (jacorb)

 
zorg zorgy
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

Im trying to learn CORBA, so I started doing an assignment online but now im really stuck.
I have 4 classes, 1 server class (StockServer.java) , 1 client class (StockClient.java), 1 factory (Quote_FactoryImpl)
and one object class (Quoter).

After I run the server and client I get the messages as shown below. I think the problem is in the Quote_FactoryImpl

From my understanding, I create a POA in the server class to hold all the servants, therefore I have to pass the
POA to the Quoter_Factory class in order to put the newly created servants into the POA, once the servant
is in the POA and activated, then anyone can use it since the IOR of the POA is written to a file.

Is my understanding correct? I cant figure out whats going wrong.


Output from Server
2010-12-17 22:17:50.671 FINE rid: 2 opname: get_quote invokeOperation on servant (stream based)
2010-12-17 22:17:50.672 SEVERE rid: 2 opname: get_quote invocation: throwable was thrown.
QuoterImpl.get_quote(QuoterImpl.java:10)
Stock.QuoterPOA._invoke(QuoterPOA.java:46)
org.jacorb.poa.RequestProcessor.invokeOperation(RequestProcessor.java:301)
org.jacorb.poa.RequestProcessor.process(RequestProcessor.java:604)
org.jacorb.poa.RequestProcessor.run(RequestProcessor.java:747)
2010-12-17 22:17:50.673 FINE ServerRequest: reply to get_quote
2010-12-17 22:17:50.673 FINE wrote 20 bytes to 127.0.1.1:44209
2010-12-17 22:17:50.674 FINE wrote 84 bytes to 127.0.1.1:44209
2010-12-17 22:17:50.674 FINE wrote 44 bytes to 127.0.1.1:44209
2010-12-17 22:17:50.675 FINE wrote GIOP message of size 68 to ServerGIOPConnection to 127.0.1.1:44209 (a4e2e3)
2010-12-17 22:17:50.675 FINE rid: 2 opname: get_quote ends with request processing
2010-12-17 22:17:51.021 FINE Transport to 127.0.1.1:44209: stream closed on read < 0
2010-12-17 22:17:51.022 FINE ServerGIOPConnection to 127.0.1.1:44209 (a4e2e3): getMessage() -- COMM_FAILURE
2010-12-17 22:17:51.022 FINE ServerGIOPConnection to 127.0.1.1:44209 (a4e2e3): streamClosed()
2010-12-17 22:17:51.022 FINE ServerGIOPConnection to 127.0.1.1:44209 (a4e2e3): close()
2010-12-17 22:17:51.025 INFO Closed server-side transport to 127.0.1.1:44209
2010-12-17 22:17:51.025 FINE [1/1] job queue empty



Output from Client:
2010-12-17 22:17:50.675 FINE read 12 bytes from 127.0.1.1:47958
2010-12-17 22:17:50.675 FINE read 136 bytes from 127.0.1.1:47958
2010-12-17 22:17:50.676 FINE read GIOP message of size 148 from ClientGIOPConnection to 127.0.1.1:47958 (c832d2)
org.omg.CORBA.UNKNOWN: Server-side Exception: java.lang.NullPointerException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.jacorb.orb.SystemExceptionHelper.read(SystemExceptionHelper.java:223)
at org.jacorb.orb.ReplyReceiver.getReply(ReplyReceiver.java:319)
at org.jacorb.orb.Delegate.invoke_internal(Delegate.java:1090)
at org.jacorb.orb.Delegate.invoke(Delegate.java:957)
at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:80)
at Stock._QuoterStub.get_quote(_QuoterStub.java:34)
at StockClient.main(StockClient.java:24)












 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic