<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
Anybody has any ideas about this case? I put really all details in my
mail, hoping to spark quick clues from Drupal gurus on the list. It
took me weeks to pinpoint the problem, but now I am totally stuck,
wondering what is special in Drupal that breaks the applet data loading
functionality... <br>
<br>
Even the faintest clue might help. Please.<br>
<br>
Tomáš / Vacilando<br>
<br>
<br>
<br>
-------- Original Message --------
<table class="moz-email-headers-table" border="0" cellpadding="0"
cellspacing="0">
<tbody>
<tr>
<th align="right" nowrap="nowrap" valign="baseline">Subject: </th>
<td>a nasty Java applet case</td>
</tr>
<tr>
<th align="right" nowrap="nowrap" valign="baseline">Date: </th>
<td>Tue, 23 Oct 2007 21:08:55 +0200</td>
</tr>
<tr>
<th align="right" nowrap="nowrap" valign="baseline">From: </th>
<td>Tomas J. Fulopp <a class="moz-txt-link-rfc2396E" href="mailto:tomi@vacilando.org"><tomi@vacilando.org></a></td>
</tr>
<tr>
<th align="right" nowrap="nowrap" valign="baseline">Reply-To: </th>
<td><a class="moz-txt-link-abbreviated" href="mailto:tomi@vacilando.org">tomi@vacilando.org</a></td>
</tr>
<tr>
<th align="right" nowrap="nowrap" valign="baseline">Organization:
</th>
<td>Vacilando</td>
</tr>
<tr>
<th align="right" nowrap="nowrap" valign="baseline">To: </th>
<td><a class="moz-txt-link-abbreviated" href="mailto:development@drupal.org">development@drupal.org</a></td>
</tr>
</tbody>
</table>
<br>
<br>
<pre>Lads and lassies, I wonder who can explain this one...
I've been working on this nasty problem for several weeks... and I am
really close to a solution now, but not quite there. Hope you can help.
It is really an interesting problem!
I maintain the "hypergraph" (HG) module, which currently takes the
current-user-visible menu and turns it into a visual map using an open
source Java applet -- see <a class="moz-txt-link-freetext" href="http://drupal.org/project/hypergraph">http://drupal.org/project/hypergraph</a> or the
files in CVS here
<a class="moz-txt-link-freetext" href="http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/hypergraph/">http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/hypergraph/</a>
I have a multisite install of D5.2, the HG module sits in
<a class="moz-txt-link-freetext" href="http://quidne.vacilando.org/sites/all/modules/hypergraph/">http://quidne.vacilando.org/sites/all/modules/hypergraph/</a> folder, and
there is also the .jar file of the Java applet.
Now, when the page that contains the HG tag loads, the Java applet
appears, but it needs to call data from the server. This data is
provided by a file that resides in a folder of hypergraph, namely
<a class="moz-txt-link-freetext" href="http://quidne.vacilando.org/sites/all/modules/hypergraph/graphs/hg.php">http://quidne.vacilando.org/sites/all/modules/hypergraph/graphs/hg.php</a>
(+ some arguments).
Note: in the same folder there is a .dtd file that is necessary for the
XML data.
Quite simple, really. Worked fine on other (non Drupal) sites where I
implemented it - e.g. <a class="moz-txt-link-freetext" href="http://www.vacilando.org">http://www.vacilando.org</a> frontpage
But on Drupal, and not only on my multisite install (several users
reported it), there is a silly bug: After you open the browser (FF and
IE; tested on WinXP) for the first time (with or without clearing cache,
I found), the Java applet would throw a cache-related error. When
reloaded page, and on all subsequent loads, the Java would display
correct data, without any problem.
So I looked everywhere and tried to avoid this Java error, finding that
JRE 6 has a bug related to cache, etc. Many days after I realized that
this error (after fresh opening of the browser) did not occur in other
websites I had made that feature the same applet. So I changed focus to
the generated XML data, tweaking it to perfection.. But I could not get
rid of the bug!
I then thought that perhaps I am not properly initializing Drupal. This
is in the data provider file hg.php :
drupalize();
function drupalize() {
while (!@stat('./includes/bootstrap.inc')) {
chdir ('..');
}
require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
}
That should be fine, no? Just to be sure, I tried to put just plain XML
file here - not dynamically generated, for a test. Still the same problem!!
Then I put both files (the static test XML and the DTD file) elsewhere,
on a different subdomain ( in <a class="moz-txt-link-freetext" href="http://www.vacilando.org/temp/tst/">http://www.vacilando.org/temp/tst/</a> ). Wow
-- surprise -- no bug!!!!!!
Why??? Why does it not work when XML and DTD are in
<a class="moz-txt-link-freetext" href="http://quidne.vacilando.org/sites/all/modules/hypergraph/graphs/">http://quidne.vacilando.org/sites/all/modules/hypergraph/graphs/</a> and it
works when XML and DTD are in <a class="moz-txt-link-freetext" href="http://www.vacilando.org/temp/tst/">http://www.vacilando.org/temp/tst/</a> ? No idea!
I have a hunch - but I need your thoughts here... the XML file
definitely needs its DTD file. Could it be that something - either some
consequences of multisite, or the .htaccess rules in the root of Drupal,
or something else (what?) cause that the XML does not "see" its DTD even
though it is in the same folder..?
I tried to put an empty .htaccess file in the folder
<a class="moz-txt-link-freetext" href="http://quidne.vacilando.org/sites/all/modules/hypergraph/graphs/">http://quidne.vacilando.org/sites/all/modules/hypergraph/graphs/</a> trying
to override the basic Drupal's .htaccess - no change.
Another suspicion - the Java applet seems to be loading before the page
loads, or at least sometimes (when cache has been emptied from the
browser before it was closed). Could it be that Drupal somehow forbids
anything accessing module directories before session/cookies are set or
something?
Also tried to put the two files into a folder in the files folder ( in
<a class="moz-txt-link-freetext" href="http://quidne.vacilando.org/sites/quidne.vacilando.org/files/tst/">http://quidne.vacilando.org/sites/quidne.vacilando.org/files/tst/</a> ) -
same bug.
Any idea? Anybody has experience with a similar problem?
If any of you want to test the problem in action, don't go to my website
(too many on-going dev changes), just get v1.2 from
<a class="moz-txt-link-freetext" href="http://drupal.org/project/hypergraph">http://drupal.org/project/hypergraph</a> and install it ( then go to
/hypergraph ). Or contact me and I'll quickly set up a demo of the
problem on my site.
Cheers,
Tomáš / Vacilando
</pre>
</body>
</html>