You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@river.apache.org by Behar Skenderaj <be...@yahoo.com.INVALID> on 2014/10/09 19:31:44 UTC

Implementation of Apache River on Netbeans

Hi,

can anyone help me for building of Apache River on Netbeans?

thank you!

Re: Implementation of Apache River on Netbeans

Posted by Greg Trasuk <tr...@stratuscom.com>.
Hi Behar:

I haven’t tried to run that demo, but just looking at the exception, it seems you might have come across the problem that Dennis Reedy mentions in https://www.mail-archive.com/dev@river.apache.org/msg02732.html

Could you try adding '-Djava.rmi.server.useCodebaseOnly=false’ to your command line that starts up the example?

Also, you might find it useful (and I’d certainly appreciate) if you could try out the River Container project that’s at https://github.com/trasukg/river-container.  When you build it and then run it (see the README file that github shows you on that page), it should startup a LookupService under the group name “RiverContainerDefault”, which you should then be able to use for any other services you want to try out.

Cheers,

Greg Trasuk.


On Oct 26, 2014, at 12:01 PM, Behar Skenderaj <be...@yahoo.com> wrote:

> Hi,
> I think the problem is starting of service registrar. I stared successfully HTTP server, but when I try to start service registrar, the system shows me a an exception on service creation. Below is the full message that is shown when I try to start service registrar:
> 
> C:\apache-river-2.2.1\examples\hello>java -Djava.security.policy=config\start.po
> licy      -jar ..\..\lib\start.jar      config\start-reggie.config
> Oct 26, 2014 4:56:07 PM com.sun.jini.reggie.RegistrarImpl init
> INFO: started Reggie: 17876d96-fe7e-4800-a171-39f3c3d1d5d0, [nonsecure.hello.exa
> mple.jini.sun.com], jini://192.168.1.6:12266/
> Oct 26, 2014 4:56:07 PM com.sun.jini.start.ServiceStarter checkResultFailures
> WARNING: Exception creating service.
> java.lang.ClassNotFoundException: com.sun.jini.reggie.RegistrarProxy
>         at java.net.URLClassLoader$1.run(Unknown Source)
>         at java.net.URLClassLoader$1.run(Unknown Source)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(Unknown Source)
>         at java.lang.ClassLoader.loadClass(Unknown Source)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>         at java.lang.ClassLoader.loadClass(Unknown Source)
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Unknown Source)
>         at net.jini.loader.pref.PreferredClassProvider.loadClass(PreferredClassP
> rovider.java:615)
>         at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
>         at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
>         at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
>         at java.io.ObjectInputStream.readClassDesc(Unknown Source)
>         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
>         at java.io.ObjectInputStream.readObject0(Unknown Source)
>         at java.io.ObjectInputStream.readObject(Unknown Source)
>         at java.rmi.MarshalledObject.get(Unknown Source)
>         at com.sun.jini.start.NonActivatableServiceDescriptor.create(NonActivata
> bleServiceDescriptor.java:689)
>         at com.sun.jini.start.ServiceStarter.create(ServiceStarter.java:287)
>         at com.sun.jini.start.ServiceStarter.processServiceDescriptors(ServiceSt
> arter.java:445)
>         at com.sun.jini.start.ServiceStarter.main(ServiceStarter.java:476)
> Oct 26, 2014 4:56:07 PM com.sun.jini.start.ServiceStarter checkResultFailures
> WARNING: Associated service descriptor [0]: [http://192.168.1.6:8080/reggie-dl.j
> ar http://192.168.1.6:8080/jsk-dl.jar, config\reggie.policy, ..\..\lib\reggie.ja
> r, com.sun.jini.reggie.TransientRegistrarImpl, [config\jrmp-reggie.config], com.
> sun.jini.start.NonActivatableServiceDescriptor$1@20ca8d94, BasicProxyPreparer[]]
> 
> thank you.
> 
> 
> 
> On Saturday, October 25, 2014 3:17 PM, "trasukg@stratuscom.com" <tr...@stratuscom.com> wrote:
> 
> 
> Could you post the full exception trace? That will help us figure out what has gone wrong. 
> 
> Greg 
> 
> 
> Sent from my BlackBerry 10 smartphone.
> From: Behar Skenderaj
> Sent: Friday, October 24, 2014 8:10 PM
> To: Greg Trasuk; user@river.apache.org
> Reply To: Behar Skenderaj
> Subject: Re: Implementation of Apache River on Netbeans
> 
> 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 <tr...@stratuscom.com> 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 <be...@yahoo.com.INVALID> wrote:
> 
> > Hi,
> > 
> > can anyone help me for building of Apache River on Netbeans?
> > 
> > thank you!
> 
> 
> 
> 
> 


Re: Implementation of Apache River on Netbeans

Posted by Behar Skenderaj <be...@yahoo.com.INVALID>.
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 <tr...@stratuscom.com> 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 <be...@yahoo.com.INVALID> wrote:

> Hi,
> 
> can anyone help me for building of Apache River on Netbeans?
> 
> thank you!

Re: Implementation of Apache River on Netbeans

Posted by Greg Trasuk <tr...@stratuscom.com>.
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 <be...@yahoo.com.INVALID> wrote:

> Hi,
> 
> can anyone help me for building of Apache River on Netbeans?
> 
> thank you!