Java IDL / CORBA

Status
Nicht offen für weitere Antworten.

thebootstrap

Mitglied
hi all

my classpath is correctly set and the "HelloWorld" IDL/CORBA example makes another problem:

when running the server, the instruction

Code:
NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);

in the server code waits a bit and then the following error occurs

06.07.2005 10:31:45 com.sun.corba.se.impl.transport.SocketOrChannelConnectionImp
l <init>
WARNUNG: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR
_TEXT; hostname: 192.168.1.104; port: 1049"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectFailure(Unknown Source)
at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectFailure(Unknown Source)
at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(Unkn own Source)
at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(Unkn own Source)
at com.sun.corba.se.impl.transport.SocketOrChannelContactInfoImpl.createConnection (Unknown Source)
at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(Un known Source)
at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.request(Unknown Source)
at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.is_a(Unknown Source)
at org.omg.CORBA.portable.ObjectImpl._is_a(Unknown Source)
at org.omg.CosNaming.NamingContextExtHelper.narrow(Unknown Source)
at HelloServer.main(HelloServer.java:65)
Caused by: java.net.ConnectException: Connection timed out: connect
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at java.nio.channels.SocketChannel.open(Unknown Source)
at com.sun.corba.se.impl.transport.DefaultSocketFactoryImpl.createSocket
(Unknown Source)
... 9 more


is somebody able to help me with this one? thanks alot in advance!

greetings!
 

KISS

Bekanntes Mitglied
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No

completed: no means an excpetion occured prior an object implementation was invoked
minor code 201 means connection failure

so I assume either your name service is not running or not connectable for any reason (e.g using a non matching ior)
 

thebootstrap

Mitglied
yes you are right i think, but the problem is: i started orbd as written in the tutorial.. :( so i don't know what steps to take now..
 

KISS

Bekanntes Mitglied
could you post how you start the orbd, the server and the client (orbinitialreference, orbinitialport, orbinitialhost)
 

thebootstrap

Mitglied
by the way, here's my server code. not that i commented out some lines below -> like this, there is no exception and all goes well (when i uncomment the line

Code:
NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);

i get the problem again), and of course, those lines are necessary :)

thanks for your help, all of you!

Code:
// Copyright and License 
import HelloApp.*;
import org.omg.CosNaming.*;
import org.omg.CosNaming.NamingContextPackage.*;
import org.omg.CORBA.*;
import org.omg.PortableServer.*;
import org.omg.PortableServer.POA;
import java.util.*;

import java.util.Properties;

class HelloImpl extends HelloApp.HelloPOA{
  private ORB orb;

  public void setORB(ORB orb_val){
    orb = orb_val;
  }
  
  public String sayHello(){
    return "\nHello world !!\n";
  }
  
  public void shutdown(){
    orb.shutdown(false);
  }
}

public class HelloServer{

  public static void main(String args[]){
    try{
      // create and initialize the ORB
	System.out.println("server: create and initialize the ORB");
        Properties props = new Properties();
        props.put("org.omg.CORBA.ORBInitialPort", "5510");
        props.put("org.omg.CORBA.ORBInitialHost", "127.0.0.1");
      ORB orb = ORB.init(args, props);

      // Get reference to rootpoa & activate the POAManager
	System.out.println("server: Get reference to rootpoa & activate the POAManager");
      POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
      rootpoa.the_POAManager().activate();

      // create servant and register it with the ORB
	System.out.println("server: create servant and register it with the ORB");
      HelloImpl helloImpl = new HelloImpl();
      helloImpl.setORB(orb); 

      // create a tie, with servant being the delegate.
	System.out.println("server: create a tie, with servant being the delegate.");
      HelloApp.HelloPOATie tie = new HelloApp.HelloPOATie(helloImpl, rootpoa);

      // obtain the objectRef for the tie
      // this step also implicitly activates the 
      // the object
	System.out.println("server: obtain the objectRef for the tie");
      HelloApp.Hello href = tie._this(orb);
	    
      // get the root naming context
	System.out.println("server: get the root naming context");
      org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
      
      // Use NamingContextExt which is part of the Interoperable
      // Naming Service specification.
//	System.out.println("server: Use NamingContextExt which is part of the Interoperable Naming Service specification.");
//      NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);

      // bind the Object Reference in Naming
//	System.out.println("server: bind the Object Reference in Naming");
//      String name = "Hello";
//      NameComponent path[] = ncRef.to_name( name );
//      ncRef.rebind(path, href);

      System.out.println("HelloServer ready and waiting ...");

      // wait for invocations from clients
//      orb.run();
      } 
      
    catch (Exception e){
      System.err.println("ERROR: " + e);
      e.printStackTrace(System.out);
    }
    
    System.out.println("HelloServer Exiting ...");
	
  }
}
[/code]
 

thebootstrap

Mitglied
i start the orbd like this:

Code:
orbd -ORBInitialPort 5510 -ORBInitialHost 127.0.0.1

and for the moment, i don't even try to run a client :) server first.

i run the server like this (because i introduced properties in the server's code

Code:
java HelloServer

but even

Code:
java HelloServer -ORBInitialPort 5510 -ORBInitialHost 127.0.0.1

does not work.. :(
 

KISS

Bekanntes Mitglied
about the orbd, don't you use start (windows) or & (unix)? or do you have a dedicated console for orbd

well, I think the property org.omg.CORBA.ORBInitialPort and org.omg.CORBA.ORBInitialHost are not known. the java example uses them without qualification. also, this would explain why you say localhost:5... and the nameservice is expected at 192...... : 1049
 

thebootstrap

Mitglied
there is the -port option which causes the error message you sent me to change to the port 5510, yes. but still, the whole thing does not work :/
and then -ORBInitialPort seems to exist and to be necessary if one wants to change the port
 
G

Guest

Gast
well i tried the servertool and the example using it - did not work.

so it must be this orbd which causes trouble but well... starting it like in the example seems to work because this tool does not return anything to me, when i start it... it simply starts with no report, even when i start it like orbd -Shit 1000, it seems to run. so its difficult to find the mistake :(
 
G

Gast

Gast
I am a Sw develper which interests in corba, which first time I met in faculty studies, when I implement a c++ corba application.
Now I would like to try it in java, where I go some success, but still not in a manner I would like to .
The point is that I would like to implement a server and a client using a method, so that client may connect to server without being a ORB daemon needed...
One sugested me to use IOR files, but I would like to perform a conection without manipulating files, by knowing the interface , IP Address and port, how should I proceed ?
Some time ago in a c++ corba I used: by client launching ( for example):

-ORBIIOPAddr: inet:192.168.2.2:1400

And it conects to server direclty without starting a daemon as I remember ...
In the client code sequence I used an ORB.bind(...) method call and a narraw call .
Which should be the java functions for this approach ?

victor.cuteanu@siemens.com

Thank You
Best Regards
Victor
 
Status
Nicht offen für weitere Antworten.
Ähnliche Java Themen
  Titel Forum Antworten Datum
OliverKroll Wie kann mit Java und CORBA der Ausfall des Servers abgefangen werden ? Netzwerkprogrammierung 9
root84 Corba Sun Example -> no Hell0POA.java Netzwerkprogrammierung 4
Z CORBA mit Java in 3 Wochen? Netzwerkprogrammierung 5
D HTTP Apache-HttpClient/UNAVAILABLE (java 1.4) Netzwerkprogrammierung 18
M JAX-WS unter Java 17 plötzlich nicht mehr möglich Netzwerkprogrammierung 5
K Java RMI bricht ab wenn Remote eine Methode ausgeführt werden soll Netzwerkprogrammierung 5
M HTTP Let's Encrypt und Java Trust-Store Netzwerkprogrammierung 6
JaXnPriVate Java HTTPS Server (Secure Sockets) Netzwerkprogrammierung 15
Tobero Java serversocket nicht nur zuganglich für localhost Netzwerkprogrammierung 6
D path-Variablen in eine URL hinzufügen mit Java 1.8 Netzwerkprogrammierung 2
D WebSocket Server mit HTML Client und Java Server Netzwerkprogrammierung 5
S Von Java auf passwortgeschützten Server zugreifen + Umgang mit Ports Netzwerkprogrammierung 28
S Probleme bei Java-Installation auf Server (Linux/Shell/Terminal) Netzwerkprogrammierung 6
S Java: Anbindung an einen realen Server? (+ Portfreigabe) Netzwerkprogrammierung 8
H Socket Chat entwickeln mit Java Server Client Netzwerkprogrammierung 4
x46 Java SSLContext erstellen mit SSL-Zertifikat Netzwerkprogrammierung 1
P Jenkins Login per Java Download Manager Netzwerkprogrammierung 15
N Java socket Programmierung Filme verschicken Netzwerkprogrammierung 20
S HTTP Post?!? - Java Server Netzwerkprogrammierung 7
F Verbindung zu einem LDAP Server über Java Netzwerkprogrammierung 4
K Java Websocketserver Problem | Android to Pi Netzwerkprogrammierung 1
R Anfängerbeispiel: Suche Java-Anwendung die http-Anfragen in Tomcat liest Netzwerkprogrammierung 8
V Browsergame mit Java(WebSocketServer) als Backend? Netzwerkprogrammierung 5
platofan23 Socket Java Socket mit DynDns nicht erreichbar Netzwerkprogrammierung 6
S Fragen zu Java Webservice mit Axis2 Netzwerkprogrammierung 0
M Mit Java Mail Mails an Webmailer schicken Netzwerkprogrammierung 1
mor16Euro HTTP Php website mit Java aktualisiern Netzwerkprogrammierung 6
T HTTP JAVA Browser Konsolenanfrage(JavaScript) Netzwerkprogrammierung 7
L Socket Wie kann man in Java die Anzahl der Objekte in einem InputStream sehen ohne ihn durchgehen zu müssen Netzwerkprogrammierung 1
M Socket Verbindung Matlab(Server) Java(Client) Netzwerkprogrammierung 1
M Socket peer to peer Verbindung zwischen Java und Matlab Netzwerkprogrammierung 0
L Remote Desktop per Java steuern Netzwerkprogrammierung 4
F Server für Java Applikationen Netzwerkprogrammierung 16
J Webserver mit Java schreiben? Netzwerkprogrammierung 4
D JAVA RMI Netzwerkprogrammierung 1
K HTTP Mit Java HTML Codeauslesen um damit zu arbeiten Netzwerkprogrammierung 7
V Kann man mit Hilfe eines Java-Programms den Zugriff auf bestimmte Internetseiten verhinden? Netzwerkprogrammierung 3
J HTTP [Java 9] Neuer HTTP Client - Tutorial Netzwerkprogrammierung 3
T Mikrofonaudio über Java Server an Webbrowser streamen Netzwerkprogrammierung 13
A Bestimmter URL/Certificate per Java immer vertrauen (Trustmanager/HostnameVerifier) Netzwerkprogrammierung 1
T VPN-Verbindung über Java Netzwerkprogrammierung 4
M HTTP PATCH Request mit Java ausführen Netzwerkprogrammierung 2
Niggo_ Probleme mit Java Mail Netzwerkprogrammierung 14
Aruetiise Socket Java Programm auf Server Netzwerkprogrammierung 3
L FTP Java Interpreter unterbindet SSL Handshake Netzwerkprogrammierung 2
C IFrame mit java auslesen Netzwerkprogrammierung 1
A FTP wie kann ich von java auf datei in fpt://192.168.178.1 lesen/schreiben? Netzwerkprogrammierung 3
C Datensammlung mit Java RMI Netzwerkprogrammierung 0
K Java Jsoup : OnLoad Netzwerkprogrammierung 0
S Java Chat Server Netzwerkprogrammierung 8
Carres HTTP Vorhandenen Session-ID Cookie von Firefox, Chrome oder IE in Java verwenden Netzwerkprogrammierung 2
B Java+Grbl: G-Code Befehle mit Java an Arduino senden und lesen Netzwerkprogrammierung 1
Z HTTP HTML Element auslesen in Java Netzwerkprogrammierung 1
T Socket Java Programm hängt sich auf bei dem versuch von einem Socket scanner Daten zu erhalten. Netzwerkprogrammierung 1
Thallius HTTP HTTPS unter Java 1.6 schlägt fehl Netzwerkprogrammierung 4
Thallius Java Application über ZScaler benutzer? Netzwerkprogrammierung 0
P Chat in Java Netzwerkprogrammierung 3
C java.net.ConnectException: Operation timed out? Netzwerkprogrammierung 2
M Java Eingabe auf FTP Server übergeben Netzwerkprogrammierung 4
T curl request in java umwandeln Netzwerkprogrammierung 4
M Socket Java Server: NullPointerException Netzwerkprogrammierung 4
J Java Server empfängt php inhalt nicht Netzwerkprogrammierung 1
I Socket Kommunikation C / Java Netzwerkprogrammierung 2
H Machbarkeitsfrage: TCP/IP Client (z.B. Netty) für Java Web Applcation Netzwerkprogrammierung 1
L Java RMI Objekt konsistenz Netzwerkprogrammierung 1
H Portforwarding umgehen in Java? Netzwerkprogrammierung 5
D Response in Java Servlet erzeugen Netzwerkprogrammierung 0
X Mit Java eine Applikation auf einem anderen Windows Rechner (Windows Server 2008) starten Netzwerkprogrammierung 1
E HttpUrlConnectionExample cannot be resolved to a type / Java 8 Netzwerkprogrammierung 1
F Socket Java Server mit Android App, Antwort vom Server an App Netzwerkprogrammierung 5
M Java-Programm aus dem Web laden Netzwerkprogrammierung 3
S HTTP-Requeste von Browser mit Java sniffen? Netzwerkprogrammierung 9
J access denied (“java.net.SocketPermission”…) mit Java 8 Netzwerkprogrammierung 1
N CURL requests in Java Netzwerkprogrammierung 6
P Kritische Java-Anwendung und Citrix veröffentlichen Netzwerkprogrammierung 1
F Java Server Scanner oder InputStream kann nicht gelsesen werden! Netzwerkprogrammierung 6
1 Netty NIO oder Java IO Netzwerkprogrammierung 2
1 Via Java mit WLAN Netzwerken verbinden Netzwerkprogrammierung 5
J Java Service Wrapper Netzwerkprogrammierung 1
K Mit Java ASPX Webseite fern steuern Netzwerkprogrammierung 2
H Socket Java | Server sendet Nachricht nur wenn vorher eine JOptionPane-Nachricht ausgegeben wurde. Netzwerkprogrammierung 2
K Emailsenden via Java Applikation Netzwerkprogrammierung 5
L Mit Java über PHP in MySQL anmelden (Login script) Netzwerkprogrammierung 3
C Java Chat Admin Kenzeichnung Netzwerkprogrammierung 14
P PHP Script per Java ausführen Netzwerkprogrammierung 2
P PPTP Protokoll für JAVA Netzwerkprogrammierung 14
T php/java-bridge Netzwerkprogrammierung 16
D Webseite(mit JavaScript-Element) mit Java auslesen Netzwerkprogrammierung 0
G Multiple Clients and one Server --> java.lang.NullPointerException Netzwerkprogrammierung 1
E Java Server übers Internet erreichen Netzwerkprogrammierung 4
D Socket Error: java.lang.NullPointerException Netzwerkprogrammierung 1
windl AirPlay mittels Java Netzwerkprogrammierung 0
R Email mit Java API Netzwerkprogrammierung 1
P Java Deauth / Deauthentication request Netzwerkprogrammierung 10
F Socket Java - Server/Client simple Netzwerkprogrammierung 1
E HTTP java.lang.IllegalArgumentException: protocol = http host = null Netzwerkprogrammierung 1
R Java - Socketprogrammierung Netzwerkprogrammierung 10
B Methoden und Konstruktoren von Java.net package werden nicht geladen Netzwerkprogrammierung 2
L Email versenden mit Java funktioniert nicht, Fehlermeldungen: MessagingException & SocketException Netzwerkprogrammierung 10
V Templates für Java Client rabbitmq Netzwerkprogrammierung 4

Ähnliche Java Themen

Neue Themen


Oben