nameservice

I am developing a short application test using Visibroker 4.5.1 and JDK1.3.1

in windows 2000

My Count.idl is:

module CounterPortable{

interface Count{

attribute long sum;

long increment();

};

};

My Server:

package broker.notificacao.cliente;

import org.omg.CosNaming.*;

class TesteServer{

public void main(String[] args){

try{

org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null);

CountImpl count = new CountImpl();

orb.connect(count);

org.omg.CORBA.Object nameServiceObj =

orb.resolve_initial_references("NameService");

if (nameServiceObj == null){

System.out.println();

return;

}

org.omg.CosNaming.NamingContext nameService =

org.omg.CosNaming.NamingContextHelper.narrow(nameServiceObj);

NameComponent[] countName = {new NameComponent("countName","")};

nameService.rebind(countName, count);

Thread.currentThread().join();

}catch(Exception e)

{System.err.println(e);

}

}

}

My ServerImpl:

package broker.notificacao.cliente;

class CountImpl extends CounterPortable._CountImplBase{

private int sum;

CountImpl(){

super();

System.out.println("criado");

sum = 0;

}

public synchronized int sum(){

return sum;

}

public synchronized void sum(int val){

sum = val;

}

public synchronized int increment(){

sum++;

return sum;

}

}

>I am start Smart Agent.

> I am start nameservice:

C:\>vbj com.inprise.vbroker.naming.ExtFactory

IOR:000000000000002b49444c3a6f6d672e6f72672f436f734e616d696e672f4e616d696e67

436f6e746578744578743a312

e300000000000010000000000000080000102000000000d3230302e31382e39382e363500000

b8b0000002100504d43000000

040000000d2f434f4e544558545f504f41002020200000000132000000000000035649530300

000005000404010f000000000

0000000000008000000005649530000000001000000140000000000010001000000000001010

900000000

When run application:

C:\>vbj broker.notificacao.cliente.TesteServer

This information display:

vbj.exe make a error and closed program.

Whats the problem? whats is wrong?

Tanks

[2349 byte] By [esalmeida1a] at [2007-9-19]
# 1
Hi, You must sepecify the URL or IOR for the nameService to your client program.
chockalingama at 2007-7-8 > top of java,Core,Core APIs...