This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Distributed Java and the fly likes Trouble with writting a Factory with CORBA (jacorb) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Trouble with writting a Factory with CORBA (jacorb)" Watch "Trouble with writting a Factory with CORBA (jacorb)" New topic
Author

Trouble with writting a Factory with CORBA (jacorb)

zorg zorgy
Greenhorn

Joined: Dec 17, 2010
Posts: 1
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)












 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Trouble with writting a Factory with CORBA (jacorb)