Hi Greg,
I would kindly thank you for your support. I think I have built the Apache
river on netbeans, but when i try to run an example, an error message is shown
like: java.net.SocketTimeoutException: Read timed out. I have followed all
steps as are explain river.apache.org page. The source code of the example im
trying to run is:
import net.jini.core.discovery.LookupLocator;
import net.jini.core.lookup.ServiceRegistrar;
import net.jini.core.lookup.ServiceItem;
import net.jini.core.lookup.ServiceRegistration;
import java.io.Serializable;
import java.rmi.RMISecurityManager;
import org.apache.river.api.lookup.StreamServiceRegistrar;
public class SimpleService implements Serializable {
static public void main(String argv[]) {
new SimpleService();
}
public SimpleService() {
LookupLocator lookup = null;
ServiceRegistrar registrar = null;
System.setSecurityManager(new RMISecurityManager());
System.out.println("First Step");
try {
lookup = new LookupLocator("jini://localhost:8080");
System.out.println("...successfully founded....");
}
catch(java.net.MalformedURLException e) {
System.err.println("Lookup failed: " + e.toString());
System.exit(1);
}
System.out.println("Second Step");
try {
System.out.println("System is trying to get a registrar....");
registrar = lookup.getRegistrar();
System.out.println("...successfully get the registrar....");
}
catch (java.io.IOException e) {
System.err.println("Registrar search failed 1: " + e.toString());
System.exit(1);
}
catch (java.lang.ClassNotFoundException e) {
System.err.println("Registrar search failed 2: " + e.toString());
System.exit(1);
}
System.out.println("Third Step");
System.out.println("Found a registrar");
// register ourselves as service, with no serviceID
// or set of attributes
ServiceItem item = new ServiceItem(null, this, null);
ServiceRegistration reg = null;
try {
// ask to register for 10,000,000 milliseconds
reg = registrar.register(item, 10000000L);
}
catch(java.rmi.RemoteException e) {
System.err.println("Register exception: " + e.toString());
}
System.out.println("Service registered with registration id: " +
reg.getServiceID());
}
} // SimpleService
Do you have any idea about this kind of error? thank you!
Regards,
Behar skenderaj
On Friday, October 10, 2014 3:47 AM, Greg Trasuk <[email protected]> wrote:
Create a “free-form” project based on the unpacked source directory and run the
Ant build script (build.xml) to build it.
Can you give a little more information on what the difficulty is? Error
messages or the like?
Cheers,
Greg Trasuk.
On Oct 9, 2014, at 1:31 PM, Behar Skenderaj <[email protected]>
wrote:
> Hi,
>
> can anyone help me for building of Apache River on Netbeans?
>
> thank you!