<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: Strange NoClassDefFoundError when inside MaxClock</title>
		<atom:link href="http://cycling74.com/forums/topic/strange-noclassdeffounderror-when-inside-maxclock/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/strange-noclassdeffounderror-when-inside-maxclock/feed</link>
		<description></description>
		<pubDate>Tue, 18 Jun 2013 20:00:52 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/strange-noclassdeffounderror-when-inside-maxclock/#post-36804</guid>
					<title><![CDATA[Strange NoClassDefFoundError when inside MaxClock]]></title>
					<link>http://cycling74.com/forums/topic/strange-noclassdeffounderror-when-inside-maxclock/#post-36804</link>
					<pubDate>Wed, 09 Apr 2008 05:43:46 +0000</pubDate>
					<dc:creator>Adam Murray</dc:creator>

					<description>
						<![CDATA[
						<p>I&#8217;m getting a NoClassDefFoundError when I try to run some code from a MaxClock. This code can be executed repeatedly outside of a MaxClock with no problems. How is that possible?</p>
<p>I&#8217;m interacting with JRuby here, so it may be a bad interaction with JRuby&#8217;s ClassLoader. I&#8217;m trying to implement a file autowatch mechanism for ruby scripts in my max ruby object. I gave up on the MaxClock approach and implemented the file watcher in a Java Thread, which is probably a more appropriate solution. That seems to work fine so far.</p>
<p>Anyway, thought this was pretty weird! Maybe if anyone else is having issues with MaxClock you should just switch to using standard Java Threads.</p>
<p>The class in question is definitely on Max&#8217;s classpath.</p>
<p>java.lang.NoClassDefFoundError: org/jruby/runtime/callback/FastInvocationCallback<br />
at java.lang.ClassLoader.defineClass1(Native Method)<br />
at java.lang.ClassLoader.defineClass(ClassLoader.java:675)<br />
at org.jruby.util.JRubyClassLoader.defineClass(JRubyClassLoader.java:25)<br />
&#8230;<snip>&#8230;<br />
sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)<br />
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br />
at java.lang.reflect.Method.invoke(Method.java:585)<br />
at com.cycling74.max.Callback.execute(Callback.java:300)<br />
at com.cycling74.max.MaxClock.tick(MaxClock.java:149)</snip></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/strange-noclassdeffounderror-when-inside-maxclock/#post-126497</guid>
					<title><![CDATA[Re: Strange NoClassDefFoundError when inside MaxClock]]></title>
					<link>http://cycling74.com/forums/topic/strange-noclassdeffounderror-when-inside-maxclock/#post-126497</link>
					<pubDate>Wed, 09 Apr 2008 15:59:25 +0000</pubDate>
					<dc:creator>topher lafata</dc:creator>

					<description>
						<![CDATA[
						<p>hey adam.<br />
definitely seems to be some sort of strange classloader interaction.  <br />
is org/jruby/runtime/callback in your<br />
jruby classpath??</p>
<p>regardless, i would probably do file watcher with a java thread too.</p>
<p>t</p>
<p>
On Apr 8, 2008, at 22:43 PM, Adam Murray wrote:</p>
<p>><br />
> I&#8217;m getting a NoClassDefFoundError when I try to run some code from  <br />
> a MaxClock. This code can be executed repeatedly outside of a  <br />
> MaxClock with no problems. How is that possible?<br />
><br />
> I&#8217;m interacting with JRuby here, so it may be a bad interaction  <br />
> with JRuby&#8217;s ClassLoader. I&#8217;m trying to implement a file autowatch  <br />
> mechanism for ruby scripts in my max ruby object. I gave up on the  <br />
> MaxClock approach and implemented the file watcher in a Java  <br />
> Thread, which is probably a more appropriate solution. That seems  <br />
> to work fine so far.<br />
><br />
> Anyway, thought this was pretty weird! Maybe if anyone else is  <br />
> having issues with MaxClock you should just switch to using  <br />
> standard Java Threads.<br />
><br />
> The class in question is definitely on Max&#8217;s classpath.<br />
><br />
> java.lang.NoClassDefFoundError: org/jruby/runtime/callback/ <br />
> FastInvocationCallback<br />
> at java.lang.ClassLoader.defineClass1(Native Method)<br />
> at java.lang.ClassLoader.defineClass(ClassLoader.java:675)<br />
> at org.jruby.util.JRubyClassLoader.defineClass <br />
> (JRubyClassLoader.java:25)<br />
> &#8230;<snip>&#8230;<br />
> sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)<br />
> at sun.reflect.DelegatingMethodAccessorImpl.invoke <br />
> (DelegatingMethodAccessorImpl.java:25)<br />
> at java.lang.reflect.Method.invoke(Method.java:585)<br />
> at com.cycling74.max.Callback.execute(Callback.java:300)<br />
> at com.cycling74.max.MaxClock.tick(MaxClock.java:149)<br />
><br />
><br />
> &#8211;<br />
> Adam Murray<br />
> compusition.com</snip></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/strange-noclassdeffounderror-when-inside-maxclock/#post-126498</guid>
					<title><![CDATA[Re: Strange NoClassDefFoundError when inside MaxClock]]></title>
					<link>http://cycling74.com/forums/topic/strange-noclassdeffounderror-when-inside-maxclock/#post-126498</link>
					<pubDate>Wed, 09 Apr 2008 17:56:38 +0000</pubDate>
					<dc:creator>Adam Murray</dc:creator>

					<description>
						<![CDATA[
						<p>Quote: topher lafata wrote on Wed, 09 April 2008 08:59<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
> hey adam.<br />
> definitely seems to be some sort of strange classloader interaction.  <br />
> is org/jruby/runtime/callback in your<br />
> jruby classpath??</p>
<p>That class is in jruby.jar, which is on Max&#8217;s classpath (Cycling &#8217;74/java/lib). I believe JRuby has access to everything on the JVM (i.e. Max&#8217;s) classpath since it&#8217;s running inside MXJ. There is a separate path I need to configure for the context of the ruby scripts, and jruby.jar is on there too. I believe the JRuby classloader is for that script context. This error occurs the moment I try to eval a script when the stack trace starts with MaxClock. </p>
<p>I was wondering what MaxClock might be doing that doesn&#8217;t happen when I spawn my own Thread. If I knew a little more about the Max side I might be able to post intelligent questions on the JRuby mailing list. </p>
<p>
> regardless, i would probably do file watcher with a java thread too.</p>
<p>Yeah, so I&#8217;m not stuck on this issue. Just curious what&#8217;s going on here.</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

