This indicates that two processes are trying to use the same port at the same time. Usually, this means that you have two copies of something running, by accident. But, it can also mean that you've got a configuration entry that creates a server endpoint, on a fixed port, and you are not using a "static" instance, but instead, a dynamic instance that is created multiple times.
Look to make sure you aren't creating two of something. Gregg On Jan 16, 2012, at 2:37 PM, Girbea Alina wrote: > Thanks for the help, it worked! > This is the result I got. > D:\>java -Djava.security.policy=D:\policy.all -jar > D:\jini\apache-river-2.2.0\lib\start.jar D:\start-transient-reggie.config > Jan 16, 2012 10:23:12 PM com.sun.jini.reggie.RegistrarImpl init > INFO: started Reggie: c704a7fa-0540-46a4-93b1-a321bc8c50a8, [], > ConstrainableLookupLocator[[jini://pc-nume/], [null]] > > > Afterwards I tried to setup a nonactivatable service (the implementation must > be Remote and must be able to create a proxy) as described in Jan Newmarch's > book in chapter 21 using the ServiceDescription interface. > First I have started the http server: > D:\jini\apache-river-2.2.0\lib>java -jar tools.jar -port 8080 -dir > D:\jini\apache-river-2.2.0\lib-dl > Jan 16, 2012 10:11:28 PM com.sun.jini.tool.ClassServer run > INFO: ClassServer started [[D:\jini\apache-river-2.2.0\lib-dl\], port 8080] > > Afterwards I have created the jar "ServiceDescription-dl.jar", which I have > put at D:\jini\apache-river-2.2.0\lib-dl\classes where the http server is > started and which contains the classes needed by the client. The thing is > that if reggie is started then I get the following error message: > > java.net.BindException: Address already in use: Cannot bind > at java.net.PlainDatagramSocketImpl.bind0(Native Method) > at java.net.PlainDatagramSocketImpl.bind(Unknown Source) > at java.net.DatagramSocket.bind(Unknown Source) > at java.net.MulticastSocket.<init>(Unknown Source) > at java.net.MulticastSocket.<init>(Unknown Source) > at > net.jini.discovery.LookupDiscovery$AnnouncementListener.<init>(LookupDiscovery.java:1030) > at net.jini.discovery.LookupDiscovery$7.run(LookupDiscovery.java:3091) > at java.security.AccessController.doPrivileged(Native Method) > at net.jini.security.Security$5.run(Security.java:543) > at java.security.AccessController.doPrivileged(Native Method) > at net.jini.security.Security.doPrivileged(Security.java:540) > at > net.jini.discovery.LookupDiscovery.beginDiscovery(LookupDiscovery.java:3089) > at net.jini.discovery.LookupDiscovery.<init>(LookupDiscovery.java:1946) > at > net.jini.discovery.LookupDiscoveryManager.beginDiscovery(LookupDiscoveryManager.java:1549) > at > net.jini.discovery.LookupDiscoveryManager.<init>(LookupDiscoveryManager.java:902) > at starter.ServiceDescription.advertiseService(ServiceDescription.java:160) > at starter.ServiceDescription.<init>(ServiceDescription.java:76) > at starter.ServiceDescription.main(ServiceDescription.java:36) > > If reggie is not started, then I get no error and the service works. > Otherwise, if I try to start reggie after my service is started I get a > similar error. It seems that only one can run at a time. > I'm a little confused here...shouldn't both services be able to run on the > same server? > Thank you very much! > > > > On Monday 16/01/2012 at 16:31:21, Gregg Wonderly wrote: >> As a general rule, there is no need to use '\' in a path for anything in >> Java, except when that path will be used in Runtime.exec() kinds of calls >> where the windows "CMD" application is involved. Windows, for many, many >> years, as an operating system, has supported either, and from a portability >> issue, using '/', instead, will make your programs more portable, especially >> if you do use relative paths. >> >> Having to 'double' the '\' characters is a pain. It causes all kinds of >> "hard to find" problems when you don't. So, use '/' in your >> ConfigurationFile input, unless you really are crafting a "CMD" command line. >> >> Gregg Wonderly >> >> On Jan 16, 2012, at 6:54 AM, Greg Trasuk wrote: >> >>> >>> I think you need to double the backslashes in the config file if you're >>> going to use absolute pathnames. For example , >>> private static policy = "D:\policy.all"; >>> should be >>> private static policy ="D:\\policy.all"; >>> >>> This is because the backslash character is used for escaping in Java >>> string literals, and the config file implementation duplicates this >>> behaviour. >>> >>> Usually people just use relative paths, and 'cd' into the application >>> directory before starting, but I think absolute paths will work if you >>> need to do that. >>> >>> Cheers, >>> >>> Greg. >>> >>> >>> On Mon, 2012-01-16 at 03:13, Girbea Alina wrote: >>>> >>>> Hi, >>>> >>>> This is the site from which I haven taken the previous instructions: >>>> http://www.javacoffeebreak.com/books/extracts/jini/LookupDiscovery.html >>>> >>>> Now I?m trying to start the reggie service as specified in the API >>>> of the reggie class >>>> (http://river.apache.org/doc/api/com/sun/jini/reggie/package-summary.html#start_transient_jrmp_config). >>>> I?ve taken the instructions from the section ?Starting Transient >>>> Reggie using Jini ERI? and I have used the following command line >>>> instruction: >>>> >>>> Unfortunately I get the following error: >>>> >>>> D:\>java -Djava.security.policy=D:\policy.all -jar >>>> D:\apache-river-2.2.0-bin\ap >>>> ache-river-2.2.0\lib\start.jar D:\start-transient-reggie.config >>>> Jan 16, 2012 10:02:08 AM >>>> com.sun.jini.start.NonActivatableServiceDescriptor crea >>>> te >>>> SEVERE: classloader.problem >>>> Jan 16, 2012 10:02:08 AM com.sun.jini.start.ServiceStarter >>>> checkResultFailures >>>> WARNING: Exception creating service. >>>> java.io.IOException: The filename, directory name, or volume label >>>> syntax is inc >>>> orrect >>>> at java.io.WinNTFileSystem.canonicalize0(Native Method) >>>> at java.io.Win32FileSystem.canonicalize(Unknown Source) >>>> at java.io.File.getCanonicalPath(Unknown Source) >>>> at java.io.File.getCanonicalFile(Unknown Source) >>>> at >>>> com.sun.jini.start.ClassLoaderUtil.getClasspathURLs(ClassLoaderUtil.j >>>> ava:77) >>>> at >>>> com.sun.jini.start.ClassLoaderUtil.getImportCodebaseURLs(ClassLoaderU >>>> til.java:135) >>>> at >>>> com.sun.jini.start.NonActivatableServiceDescriptor.create(NonActivata >>>> bleServiceDescriptor.java:598) >>>> 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) >>>> Jan 16, 2012 10:02:08 AM com.sun.jini.start.ServiceStarter >>>> checkResultFailures >>>> WARNING: Associated service descriptor [0]: >>>> [http://RO1CVPFC.ww300.siemens.net:8 >>>> eggie.jar, com.sun.jini.reggie.TransientRegistrarImpl, [D: >>>> ransient-reggie. >>>> config], com.sun.jini.start.NonActivatableServiceDescriptor$1@c4aad3, >>>> BasicProxy >>>> Preparer[]] >>>> >>>> >>>> All files specified in the instructions are in the correct place. This >>>> is the content of the file >>>> ?start-transient-reggie.config?: >>>> >>>> import com.sun.jini.start.ServiceDescriptor; >>>> import com.sun.jini.start.NonActivatableServiceDescriptor; >>>> >>>> >>>> com.sun.jini.start { >>>> >>>> private static codebase ="http://localhost:8080/reggie-dl.jar"; >>>> >>>> private static policy = "D:\policy.all"; >>>> >>>> private static classpath = >>>> "D:\jini\apache-river-2.2.0\lib\reggie.jar"; >>>> >>>> private static config = "D:\transient-reggie.config"; >>>> >>>> static serviceDescriptors = new ServiceDescriptor[] { >>>> new NonActivatableServiceDescriptor( >>>> codebase, policy, classpath, >>>> "com.sun.jini.reggie.TransientRegistrarImpl", >>>> new String[] { config }) >>>> }; >>>> } >>>> >>>> and of the file ?transient-reggie.config?: >>>> >>>> com.sun.jini.reggie { >>>> initialMemberGroups = new String[] {}; >>>> } >>>> >>>> In the example explained in the API, it was ?initialMemberGroups = >>>> new String[] { "your.group" };?, but I don?t think that this >>>> matters. >>>> >>>> Thank you! >>>> Alina >>> >> >
