[jacorb-developer] having a problem, and can't understand why

Nick Cross jacorb at goots.org
Mon Jan 21 10:57:53 CET 2013



Hi,

Firstly attachments are stipped to this list - you could use bugzilla to 
share code.

Have you tried using DNS names instead? Or configuring the ip address 
explicitly? (both of these should be in the programmingguide).

Regards

Nick


On 20/01/13 22:08, Fabrizio Vižintin wrote:
> Hi,
>
> I am working on a Java POS (point of sale) application that is in its 2
> year of development.
>
> The printing is implemented using the corba technology.
>
> We have migrated from the standard com.sun.corba.se implementation to
> jacorb.
>
> The reasons of the migration are obvious, jacorb is just a better
> implementation.
>
> I can say that everything is working fine for now. We expect the first new
> installations to happen at the beginning of Februrary.
>
> I have a problem, that is happening on both implementations: standard and
> jacorb.
>
> So let me shortly explain how we print using corba.
>
> We have an IDL interface that defines a Printer interface (with the main
> method print(String XMLdata) ), a DeviceFactory interface, a
> PrintetSettings valueType.
>
> And we basically get the Printer from the DeviceFacotry that has a
> getPrinter method (with some parameters). And then invoke the print method.
>
> The problem is happening with the local connection ...
>
> No problem with cllients from other machines :-)
>
> Now, what happens is that the ip address returned from the server is almost
> always 127.0.0.1 but on the print method the server is returning the
> network address! And this is a problem if the network goes down.
>
> I reproduced the behavior modifying the corbaloc example, and I'm attaching
> a zip file containing all the sources.
>
> The IDL have been extended by a new Printer interface, and the GoodDay
> interface has a method Printer getPrinter.
>
> runing ant, when the network cable is attached generates the output:
>
> fvizinti at fvizinti-ubuntu ~/Downloads/src/jacorb-3.1/demo/corbaloc $ ant
> Buildfile: /home/fvizinti/Downloads/src/jacorb-3.1/demo/corbaloc/build.xml
>
> idl.taskdef:
>
> idl:
>     [jacidl] processing idl file:
> /home/fvizinti/Downloads/src/jacorb-3.1/demo/corbaloc/idl/server.idl
>
> compile:
>
> demo:
>       [jaco] Server 1 can be reached with:
>       [jaco]    corbaloc::1.2 at localhost
> :6969/HelloServer/HelloPOAP/HelloServerID
>       [jaco]
>       [jaco] Jan 20, 2013 10:52:40 PM org.jacorb.config.JacORBConfiguration
> <init>
>       [jaco] WARNING: no properties found for configuration jacorb
>       [jaco] Jan 20, 2013 10:52:40 PM org.jacorb.orb.ORBSingleton <init>
>       [jaco] INFO: created ORBSingleton
>       [jaco] Jan 20, 2013 10:52:40 PM org.jacorb.poa.AOM add
>       [jaco] INFO: oid: 48 65 6C 6C 6F 53 65 72 76 65 72 49 44
>         HelloServerIDobject is activated
>       [jaco] Server 1 ior:
> IOR:000000000000001D49444C3A6F6D672E6F72672F434F5242412F4F626A6563743A312E3000000000000000010000000000000050000102000000000A3132372E302E302E31001B390000002348656C6C6F5365727665722F48656C6C6F504F41502F48656C6C6F536572766572494400000000010000000000000008000000004A414300
>       [jaco] Adding object mapping for server 1
> ior:IOR:000000000000001D49444C3A6F6D672E6F72672F434F5242412F4F626A6563743A312E3000000000000000010000000000000050000102000000000A3132372E302E302E31001B390000002348656C6C6F5365727665722F48656C6C6F504F41502F48656C6C6F536572766572494400000000010000000000000008000000004A414300
>       [jaco] Calling server using short key form...
>       [jaco] Jan 20, 2013 10:53:10 PM org.jacorb.config.JacORBConfiguration
> <init>
>       [jaco] WARNING: no properties found for configuration jacorb
>       [jaco] Jan 20, 2013 10:53:10 PM org.jacorb.orb.ORBSingleton <init>
>       [jaco] INFO: created ORBSingleton
>       [jaco] Jan 20, 2013 10:53:10 PM org.jacorb.config.JacORBConfiguration
> <init>
>       [jaco] WARNING: no properties found for configuration jacorb
>       [jaco] Jan 20, 2013 10:53:10 PM
> org.jacorb.orb.giop.ClientConnectionManager getConnection
>       [jaco] INFO: ClientConnectionManager: created new ClientGIOPConnection
> to 127.0.0.1:6969 (2a4983)
>       [jaco] Jan 20, 2013 10:53:10 PM org.jacorb.orb.Delegate getReplyGroup
>       [jaco] INFO: Adding new retry group for 127.0.0.1:6969
>       [jaco] Jan 20, 2013 10:53:10 PM
> org.jacorb.orb.iiop.ServerIIOPConnection configure
>       [jaco] INFO: Opened new server-side TCP/IP transport to 127.0.0.1:36270
>       [jaco] Jan 20, 2013 10:53:10 PM org.jacorb.poa.AOM add
>       [jaco] INFO: oid: 00 01 33 0D 1B 3E 4D 0E 02 32 10 06 30 46 38 14 14
> 1B 48 4C ..3..>M..2..0F8...HL1B
>               .object is activated
>       [jaco] Jan 20, 2013 10:53:10 PM org.jacorb.poa.POA getImplName
>       [jaco] INFO: Using server ID (6796505089) for transient POA
>       [jaco] Hello World, from SomewhereP
>       [jaco] EXECUTING WORK ON THE OBJECT
>       [jaco] Jan 20, 2013 10:53:10 PM
> org.jacorb.orb.iiop.ClientIIOPConnection connect
>       [jaco] INFO: Connected to 127.0.0.1:6969 from local port 36270
>       [jaco] Jan 20, 2013 10:53:10 PM
> org.jacorb.orb.giop.ClientConnectionManager getConnection
>       [jaco] *INFO: ClientConnectionManager: created new
> ClientGIOPConnection to 192.168.254.54:6969 (1b3f829)*
>       [jaco] Jan 20, 2013 10:53:10 PM org.jacorb.orb.Delegate getReplyGroup
>       [jaco] INFO: Adding new retry group for 192.168.254.54:6969
>       [jaco] Jan 20, 2013 10:53:10 PM
> org.jacorb.orb.iiop.ClientIIOPConnection connect
>       [jaco] INFO: Connected to 192.168.254.54:6969 from local port 47255
>       [jaco] Printing text:  text to print
>       [jaco] Jan 20, 2013 10:53:10 PM
> org.jacorb.orb.iiop.ServerIIOPConnection configure
>       [jaco] INFO: Opened new server-side TCP/IP transport to
> 192.168.254.54:47255
>       [jaco] Jan 20, 2013 10:53:10 PM
> org.jacorb.orb.iiop.ServerIIOPConnection close
>       [jaco] INFO: Closed server-side transport to 192.168.254.54:47255
>       [jaco] Jan 20, 2013 10:53:10 PM
> org.jacorb.orb.iiop.ServerIIOPConnection close
>       [jaco] INFO: Closed server-side transport to 127.0.0.1:36270
>      [touch] Creating
> /home/fvizinti/Downloads/src/jacorb-3.1/demo/corbaloc/build/tmp/kill1099540429
>       [jaco] Jan 20, 2013 10:53:12 PM org.jacorb.orb.ORB shutdown
>       [jaco] INFO: prepare ORB for shutdown...
>       [jaco] Jan 20, 2013 10:53:12 PM org.jacorb.orb.ORB shutdown
>       [jaco] INFO: ORB going down...
>       [jaco] Jan 20, 2013 10:53:12 PM org.jacorb.poa.POA
> makeDestructionComplete
>       [jaco] INFO: POA HelloPOAT destroyed
>       [jaco] Jan 20, 2013 10:53:12 PM org.jacorb.poa.POA
> makeDestructionComplete
>       [jaco] INFO: POA HelloPOAP destroyed
>       [jaco] Jan 20, 2013 10:53:12 PM org.jacorb.poa.POA
> makeDestructionComplete
>       [jaco] INFO: POA RootPOA destroyed
>       [jaco] Jan 20, 2013 10:53:12 PM org.jacorb.orb.ORB shutdown
>       [jaco] INFO: ORB shutdown complete
>       [jaco] Jan 20, 2013 10:53:12 PM
> org.jacorb.orb.iiop.IIOPListener$Acceptor run
>       [jaco] INFO: Listener exiting
>       [jaco] Jan 20, 2013 10:53:12 PM org.jacorb.util.threadpool.ConsumerTie
> run
>       [jaco] INFO: ConsumerTie exited
>       [jaco] Jan 20, 2013 10:53:12 PM org.jacorb.util.threadpool.ConsumerTie
> run
>       [jaco] INFO: ConsumerTie exited
>
> BUILD SUCCESSFUL
> Total time: 34 seconds
>
> You can see the network address 192.168.254.54, and its returned when
> invoking the printText method (right after the line Printer printer =
> goodDay.getPrinter("NAME");)
>
> Now, if you start again ant, then wait for the server to come alive, and
> then unplug the network cable, we can't print ... here is the output:
>
> fvizinti at fvizinti-ubuntu ~/Downloads/src/jacorb-3.1/demo/corbaloc $ ant
> Buildfile: /home/fvizinti/Downloads/src/jacorb-3.1/demo/corbaloc/build.xml
>
> idl.taskdef:
>
> idl:
>     [jacidl] processing idl file:
> /home/fvizinti/Downloads/src/jacorb-3.1/demo/corbaloc/idl/server.idl
>
> compile:
>
> demo:
>       [jaco] Jan 20, 2013 10:56:50 PM org.jacorb.config.JacORBConfiguration
> <init>
>       [jaco] WARNING: no properties found for configuration jacorb
>       [jaco] Jan 20, 2013 10:56:50 PM org.jacorb.orb.ORBSingleton <init>
>       [jaco] INFO: created ORBSingleton
>       [jaco] Jan 20, 2013 10:56:50 PM org.jacorb.poa.AOM add
>       [jaco] INFO: oid: 48 65 6C 6C 6F 53 65 72 76 65 72 49 44
>         HelloServerIDobject is activated
>       [jaco] Server 1 can be reached with:
>       [jaco]    corbaloc::1.2 at localhost
> :6969/HelloServer/HelloPOAP/HelloServerID
>       [jaco]
>       [jaco] Server 1 ior:
> IOR:000000000000001D49444C3A6F6D672E6F72672F434F5242412F4F626A6563743A312E3000000000000000010000000000000050000102000000000A3132372E302E302E31001B390000002348656C6C6F5365727665722F48656C6C6F504F41502F48656C6C6F536572766572494400000000010000000000000008000000004A414300
>       [jaco] Adding object mapping for server 1
> ior:IOR:000000000000001D49444C3A6F6D672E6F72672F434F5242412F4F626A6563743A312E3000000000000000010000000000000050000102000000000A3132372E302E302E31001B390000002348656C6C6F5365727665722F48656C6C6F504F41502F48656C6C6F536572766572494400000000010000000000000008000000004A414300
>       [jaco] Jan 20, 2013 10:57:20 PM org.jacorb.config.JacORBConfiguration
> <init>
>       [jaco] WARNING: no properties found for configuration jacorb
>       [jaco] Jan 20, 2013 10:57:20 PM org.jacorb.orb.ORBSingleton <init>
>       [jaco] INFO: created ORBSingleton
>       [jaco] Jan 20, 2013 10:57:20 PM org.jacorb.config.JacORBConfiguration
> <init>
>       [jaco] WARNING: no properties found for configuration jacorb
>       [jaco] Calling server using short key form...
>       [jaco] Jan 20, 2013 10:57:20 PM
> org.jacorb.orb.giop.ClientConnectionManager getConnection
>       [jaco] INFO: ClientConnectionManager: created new ClientGIOPConnection
> to 127.0.0.1:6969 (c7b00c)
>       [jaco] Jan 20, 2013 10:57:20 PM org.jacorb.orb.Delegate getReplyGroup
>       [jaco] INFO: Adding new retry group for 127.0.0.1:6969
>       [jaco] Jan 20, 2013 10:57:20 PM
> org.jacorb.orb.iiop.ServerIIOPConnection configure
>       [jaco] INFO: Opened new server-side TCP/IP transport to 127.0.0.1:36282
>       [jaco] Jan 20, 2013 10:57:20 PM org.jacorb.poa.AOM add
>       [jaco] INFO: oid: 00 01 33 11 01 04 1F 0A 35 24 10 06 30 46 38 14 14
> 1B 48 4C ..3.....5$..0F8...HL1B
>               .object is activated
>       [jaco] Jan 20, 2013 10:57:20 PM org.jacorb.poa.POA getImplName
>       [jaco] INFO: Using server ID (1890388230) for transient POA
>       [jaco] Hello World, from SomewhereP
>       [jaco] EXECUTING WORK ON THE OBJECT
>       [jaco] Jan 20, 2013 10:57:20 PM
> org.jacorb.orb.iiop.ClientIIOPConnection connect
>       [jaco] INFO: Connected to 127.0.0.1:6969 from local port 36282
>       [jaco] Jan 20, 2013 10:57:20 PM
> org.jacorb.orb.giop.ClientConnectionManager getConnection
>       [jaco] INFO: ClientConnectionManager: created new ClientGIOPConnection
> to 192.168.254.54:6969 (15a0305)
>       [jaco] Jan 20, 2013 10:57:20 PM org.jacorb.orb.Delegate getReplyGroup
>       [jaco] INFO: Adding new retry group for 192.168.254.54:6969
>       [jaco] Jan 20, 2013 10:57:20 PM
> org.jacorb.orb.iiop.ClientIIOPConnection connect
>       [jaco] INFO: Retrying to connect to 192.168.254.54:6969
>       [jaco] Jan 20, 2013 10:57:21 PM
> org.jacorb.orb.iiop.ClientIIOPConnection connect
>       [jaco] INFO: Retrying to connect to 192.168.254.54:6969
>       [jaco] Jan 20, 2013 10:57:21 PM
> org.jacorb.orb.iiop.ClientIIOPConnection connect
>       [jaco] INFO: Retrying to connect to 192.168.254.54:6969
>       [jaco] Jan 20, 2013 10:57:22 PM
> org.jacorb.orb.iiop.ClientIIOPConnection connect
>       [jaco] INFO: Retrying to connect to 192.168.254.54:6969
>       [jaco] Jan 20, 2013 10:57:22 PM
> org.jacorb.orb.iiop.ClientIIOPConnection connect
>       [jaco] INFO: Retrying to connect to 192.168.254.54:6969
>       [jaco] Exception in thread "main" org.omg.CORBA.TRANSIENT: Retries
> exceeded, couldn't reconnect to 192.168.254.54:6969
>       [jaco] at
> org.jacorb.orb.iiop.ClientIIOPConnection.connect(ClientIIOPConnection.java:223)
>       [jaco] at
> org.jacorb.orb.giop.GIOPConnection.sendMessage(GIOPConnection.java:1042)
>       [jaco] at
> org.jacorb.orb.giop.GIOPConnection.sendRequest(GIOPConnection.java:987)
>       [jaco] at
> org.jacorb.orb.giop.ClientConnection.sendRequest(ClientConnection.java:308)
>       [jaco] at
> org.jacorb.orb.giop.ClientConnection.sendRequest(ClientConnection.java:289)
>       [jaco] at org.jacorb.orb.Delegate._invoke_internal(Delegate.java:1335)
>       [jaco] at org.jacorb.orb.Delegate.invoke_internal(Delegate.java:1160)
>       [jaco] at org.jacorb.orb.Delegate.invoke(Delegate.java:1148)
>       [jaco] at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:80)
>       [jaco] at demo.corbaloc._PrinterStub.printText(_PrinterStub.java:37)
>       [jaco] at demo.corbaloc.Client.main(Client.java:36)
>       [jaco] Jan 20, 2013 10:57:23 PM
> org.jacorb.orb.iiop.ServerIIOPConnection close
>       [jaco] INFO: Closed server-side transport to 127.0.0.1:36282
>       [jaco] Java Result: 1
>      [touch] Creating
> /home/fvizinti/Downloads/src/jacorb-3.1/demo/corbaloc/build/tmp/kill1331427440
>       [jaco] Jan 20, 2013 10:57:24 PM org.jacorb.orb.ORB shutdown
>       [jaco] INFO: prepare ORB for shutdown...
>       [jaco] Jan 20, 2013 10:57:24 PM org.jacorb.orb.ORB shutdown
>       [jaco] INFO: ORB going down...
>       [jaco] Jan 20, 2013 10:57:24 PM org.jacorb.poa.POA
> makeDestructionComplete
>       [jaco] INFO: POA HelloPOAT destroyed
>       [jaco] Jan 20, 2013 10:57:24 PM org.jacorb.poa.POA
> makeDestructionComplete
>       [jaco] INFO: POA HelloPOAP destroyed
>       [jaco] Jan 20, 2013 10:57:24 PM org.jacorb.poa.POA
> makeDestructionComplete
>       [jaco] INFO: POA RootPOA destroyed
>       [jaco] Jan 20, 2013 10:57:24 PM org.jacorb.orb.ORB shutdown
>       [jaco] INFO: ORB shutdown complete
>       [jaco] Jan 20, 2013 10:57:24 PM
> org.jacorb.orb.iiop.IIOPListener$Acceptor run
>       [jaco] INFO: Listener exiting
>       [jaco] Jan 20, 2013 10:57:24 PM org.jacorb.util.threadpool.ConsumerTie
> run
>       [jaco] INFO: ConsumerTie exited
>
> BUILD SUCCESSFUL
> Total time: 36 seconds
>
> Our workaround is to instantiate the Printer locally (bypassing the corba
> infrastructure) when the request for printing is coming from the local
> machine to the locally attached printer, but this is not what we want.
>
> So please, can you look at the code example, and tell us what we are doing
> wrong.
>
> Thanks in advance.
>
> Fabrizio
>
>
>
> _______________________________________________
> jacorb-developer maillist  -  jacorb-developer at lists.spline.inf.fu-berlin.de
> https://lists.spline.inf.fu-berlin.de/mailman/listinfo/jacorb-developer
>



More information about the jacorb-developer mailing list