PreferredClassProvider should be in jsk-platform.jar (which I think you confirmed with your ‘grep -r’). It is there in the 2.2.2 build that I have. I’m not familiar with your build tool (Gradle?) but you might want to check the class path entry in the jar manifest that’s generated, to see if jsk-platform is actually in the runtime class path.
Are you starting up the system using the ServiceStarter approach or winging it yourself? If ServiceStarter, could you post the starter configuration file? Cheers, Greg Trasuk. On Jul 6, 2014, at 8:27 PM, Gus Heck <[email protected]> wrote: > I've now spent several hours hunting for this class. What jar contains it? > > Presently I'm building with the following (shotgun, messy non minimized) > dependencies: > dependencies { > compile 'com.google.guava:guava:15.0' > compile 'com.google.code.findbugs:jsr305:2.0.3' > compile 'jini:jini-core:2.1' > compile 'org.apache.river:reggie:2.2.2' > compile 'net.jini:jini-ext:2.1' > compile 'net.jini:jsk-lib:2.2.2' > compile 'net.jini:jsk-dl:2.2.2' > compile 'net.jini:jsk-platform:2.2.2' > compile 'net.jini:jsk-resources:2.2.2' > compile 'net.jini:jini-core:2.1' > compile 'net.jini:jini-ext:2.1' > compile 'net.jini:jsk-policy:2.2.2' > // compile 'net.jini:jini-starterkit:2.1-beta2' // 404 in maven central > compile 'org.apache.logging.log4j:log4j-core:2.0-rc2' > testCompile 'junit:junit:4.11' > } > > I basically got frustrated and just threw everything I could find at it and > it still does this: > > guss-mbp:ingest gus$ alias j7a > alias > j7a='/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre/bin/java > -Djava.security.policy=/Users/gus/tools/jpolicy/all.policy > -Djava.rmi.server.RMIClassLoaderSpi=net.jini.loader.pref.PreferredClassProvider' > guss-mbp:ingest gus$ j7a -Done-jar.silent=true -jar > build/libs/ingest-node.jar foo bar > Starting injester node... > Jul 06, 2014 7:57:31 PM > net.jini.discovery.LookupDiscovery$UnicastDiscoveryTask run > INFO: exception occurred during unicast discovery to guss-mbp.lan:54290 > with constraints InvocationConstraints[reqs: {}, prefs: {}] > java.lang.NoClassDefFoundError: net.jini.loader.pref.PreferredClassProvider > at > java.rmi.server.RMIClassLoader.initializeProvider(RMIClassLoader.java:687) > at java.rmi.server.RMIClassLoader.access$000(RMIClassLoader.java:110) > at java.rmi.server.RMIClassLoader$1.run(RMIClassLoader.java:120) > at java.rmi.server.RMIClassLoader$1.run(RMIClassLoader.java:119) > at java.security.AccessController.doPrivileged(Native Method) > at java.rmi.server.RMIClassLoader.<clinit>(RMIClassLoader.java:117) > at net.jini.loader.ClassLoading.loadClass(ClassLoading.java:138) > at > net.jini.io.MarshalInputStream.resolveClass(MarshalInputStream.java:296) > at > java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1612) > at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1517) > at > java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771) > at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) > at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370) > at net.jini.io.MarshalledInstance.get(MarshalledInstance.java:358) > at > com.sun.jini.discovery.DiscoveryV1.doUnicastDiscovery(DiscoveryV1.java:397) > at net.jini.discovery.LookupDiscovery$13.run(LookupDiscovery.java:3327) > at java.security.AccessController.doPrivileged(Native Method) > at > net.jini.discovery.LookupDiscovery.doUnicastDiscovery(LookupDiscovery.java:3324) > at > net.jini.discovery.LookupDiscovery.doUnicastDiscovery(LookupDiscovery.java:3355) > at > net.jini.discovery.LookupDiscovery.access$3900(LookupDiscovery.java:696) > at > net.jini.discovery.LookupDiscovery$UnicastDiscoveryTask.run(LookupDiscovery.java:1744) > at com.sun.jini.thread.TaskManager$TaskThread.run(TaskManager.java:331) > > No Service Registries found > > I'm passing in the option for this class on the advice of your getting > started page <http://river.apache.org/user-guide-basic-river-services.html>. > It would be really nice if that page listed what dependency I needed for > this. > > I tried grepping the entire distribution and only found it in two places > > guss-mbp:apache-river-2.2.2 gus$ grep -r PreferredClassProvider * > <*snip* javadoc matches> > Binary file lib/jini-ext.jar matches > Binary file lib/jsk-platform.jar matches > > in both jars I see only: > drwxr-xr-x 0 10-Nov-2013 22:49:20 com/sun/jini/loader/ > drwxr-xr-x 0 10-Nov-2013 22:49:20 com/sun/jini/loader/pref/ > drwxr-xr-x 0 10-Nov-2013 22:49:20 > com/sun/jini/loader/pref/internal/ > -rw-r--r-- 7218 10-Nov-2013 22:49:20 > com/sun/jini/loader/pref/internal/PreferredResources.class > > > But in any case as you can see both of these libs are already in my > dependency list. > > This puzzles me since it's clearly in your repository... > http://svn.apache.org/viewvc/river/jtsk/trunk/src/net/jini/loader/pref/ > > shouldn't it be in at least one of the distributed jars, if not one of the > packages on mavencentral? > > -Gus > > -- > http://www.the111shift.com
