Livegrabber v3.3.3 - java.lang.classnotfoundexception fix for GrabberReceiver

For anyone else who comes across this error in the Max console when attempting to use Grabber Receiver, I resolved the issue by copying all of the Livegrabber .jar and .class files to: /Applications/Max.app/Contents/Resources/C74/packages/max-mxj/java-classes

I’m pretty ignorant when it comes to Java (and Max kinda) so not sure if this is a bug or not or whether or not my fix is a poor workaround or a good solution. Is there a better way to solve this problem?

I tested and was getting this error in live 9.1 and live 9.6 both 32 and 64bit using both Max 6.1 and 7.2 both 32 and 64bit versions.

1 Like

Thanks for sharing this bforest!

In theory the java classes should always be found by the plugins when they are together with the amxd plugin files in one folder. But it is good to know that this can be a workaround in case something is somehow not working (or maybe the amxd files were moved to a different location alone?).

In general, java support in Max For Live is unfortunately quite poor, i.e. freezing the jar and class files into the plugin should work but doesn’t. It would be interesting to know how many people actually use the functionality that the java classes provide:

  • bonjour and
  • auto-assigning a new port when the saved one is in use by another application

Thanks again,
Mattijs

Hey all,

So I’m testing the latest version of LiveGrabber on Windows 7, 64bit and am running into a similar but slightly different issue. Version 2.8 definitely works for me, but version 3.3.3 is giving my errors. When I open GrabberReceiver in Max 7.2.1 at first I get a similar error about not being able to find the .class files. I copied them into the equivalent directory as the Mac solution in bforest’s work around and also osc.jar into the lib folder for good measure. This takes me to a new set of errors. It appears there is a reference to some Mac-only code:

java.lang.NoClassDefFoundError: com/apple/dnssd/RegisterListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
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.ClassLoader.findSystemClass(Unknown Source)
at com.cycling74.max.MXJClassLoaderImpl.doLoadClass(MXJClassLoaderImpl.java:104)
at com.cycling74.max.MXJClassLoaderImpl.loadClass(MXJClassLoaderImpl.java:89)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Unknown Source)
at java.lang.Class.getDeclaredFields(Unknown Source)
at com.cycling74.max.MaxObject._get_all_fields(MaxObject.java:2220)
at com.cycling74.max.MaxObject.declareAttribute(MaxObject.java:2321)
at com.cycling74.max.MaxObject.declareAttribute(MaxObject.java:2291)
at OscService.(OscService.java:87)
Caused by: java.lang.ClassNotFoundException: com.apple.dnssd.RegisterListener
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)
… 23 more
(mxj) unable to construct instance of OscService

Follow up. It looks like that class is related to Bonjour so I downloaded and installed Bonjour for Windows: Apple - Support - Downloads

By applying bforest’s fix and installing Bonjour for Windows GrabberReceiver is now working for me.

It would be awesome if you could add some code that checks for the presence of Bonjour or some how makes it optional. However if that’s not possible I think you will probably want to put these steps into the README.txt or somehow make them more obvious.

So glad to have this finally working. Thank you by the way for the LiveGrabber tools, this is the only thing I’ve found that let’s me do the OSC interaction with Ableton Live that I’ve wanted to do.

Cheers

Thanks for getting back to us with your feedback. Indeed, we are not happy with the options Max gives us for using Java, which severly limit how user friendly we can make this process. However it’s currently the only way to implement Bonjour and advanced networking without building new objects for this in C++ (which would take more time than we could currently invest).

Thanks for your persistence and happy to hear you got it working!