My big max-patch breaks jweb and crashes on close.

    Apr 01 2010 | 1:46 pm
    Hi there,
    I have a complex patch that: - uses jweb to communicate with an asp- webpage with javascript (site to max is done using "maxmessage", max to site is done using POST-vars); - autoresizes the main window on startup if the size is not what it should be (using a message to thispatcher); - does some of other things including reading external wave files, external text files, uses the mxj loadbang.sql object to do built-in database stuff and uses some simple javascript. No jitter.
    Two problems occur: the communication with the website works fine if tested in a separate patch, but in the main patch the jweb-object shows no web page. Not even . The jweb output keeps spitting out the following message (flooding the Max window if I print to it, even if I send the url to the jweb object only once):
    error The operation couldn’t be completed. (NSURLErrorDomain error -999.)
    The other problem: on Mac OS X (both 10.5 and 10.6), Max crashes when I try to close the patch, but only if it had resized the window upon loading the patch. Surprisingly, on windows XP, it doesn't crash at all. Both platforms use Max/MSP 5.1.3.
    The patch is too big and complex to post in its entirety, otherwise I would have done it. But here is the auto-resizing bit:
    And a tiny bit from the crash-log: Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x000000000000002e Crashed Thread: 0 Java: AWT-AppKit Dispatch queue:
    I'm using Java 1.5.something. Updated last month.
    Any insights? I believe at least the jweb-stuff worked fine on a previous version of Max (5.1.2 or below).

    • Apr 05 2010 | 2:08 pm
      Ok, funnily enough the jweb-breaking issue just went away. It occasionally spits out the NSURLErrorDomain error, but at least the pages keep getting loaded.