gwtproject / gwt

GWT Open Source Project
http://www.gwtproject.org
1.52k stars 375 forks source link

Hosted mode broken on MacOS X Leopard #1798

Closed dankurka closed 9 years ago

dankurka commented 9 years ago

Originally reported on Google Code with ID 1792

Found in GWT Release: 1.4

Detailed description:

http://groups.google.com/group/Google-Web-
Toolkit/browse_thread/thread/44df53c5c7ef6df2

The hosted mode does not work in Leopard.  In my case, the browser pops up for
a second, but quickly disappears.  There does not appear to be any useful details
given stdout or stderr when it exits/crashes, nor is there anything useful that shows
up in Console.app.      In my case, I'm using Netbeans and gwt4nb, but  it also  fails
when I attempt to run it standalone.

I'm running the latest developer seed:  Mac OS X 10.5 (9A559)  The official release
is supposed to come out on October 26th, and I suspect it won't behave any better.

Other details available in the aforementioned group thread.

Workaround:  None.

Reported by pohl.longsine on 2007-10-21 22:36:19

dankurka commented 9 years ago
Hi are there any chances that this fix is merged to the main trunk? or at least
create a patch file with the changes for the trunk, I wanted try the java 5 features
of the trunk but i cant because it doesnt has the fix

Reported by gabrieldavidguerrero on 2008-01-23 17:47:16

dankurka commented 9 years ago
Same here, we're dying for the 1.5 features, the strict mode fixes and our
application working in FF3. But without the leopard, fix, we either have to not use
the hosted mode or not use 1.5 :-(

Reported by zigoto on 2008-01-28 04:29:29

dankurka commented 9 years ago
For myself, I took the patch from the branch and applied it to 1.5, then combined it
with the 1.4 framework binaries.  This results in a working Leopard version of 1.5,
tested in hosted and web mode.

I'd post my own gwt-dev-mac.jar, but I've got a number of patches applied from
various places in my frankenstein build and I can't guarantee it'll work for anyone
else.

If you'd like to reproduce it for yourselves:

1.  Grab trunk from SVN.
2.  Apply this patch to BootStrapPlatform (essentially copied from the branch):

Index: dev/mac/src/com/google/gwt/dev/BootStrapPlatform.java
===================================================================
--- dev/mac/src/com/google/gwt/dev/BootStrapPlatform.java   (revision 1666)
+++ dev/mac/src/com/google/gwt/dev/BootStrapPlatform.java   (working copy)
@@ -17,6 +17,7 @@

 import com.google.gwt.dev.shell.mac.LowLevelSaf;

+import java.awt.GraphicsEnvironment;
 import java.awt.Toolkit;

 /**
@@ -72,6 +73,9 @@
    * </p>
    */
   public static void maybeInitializeAWT() {
+    
+GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
+
     final Toolkit toolkit = Toolkit.getDefaultToolkit();
   }

@@ -92,5 +96,8 @@
     // Disable CocoaComponent compatibility mode.
     System.setProperty("com.apple.eawt.CocoaComponent.CompatibilityMode",
         "false");
+    Thread.currentThread().setContextClassLoader(
+        BootStrapPlatform.class.getClassLoader());
+
   }
 }

3.  Build GWT
4.  Grab the mac build binaries from your build and replace the frameworks + JNI
libraries from the unofficial build.

Just in case you're running on the bleeding edge like me, this doesn't work with
Apple's developer preview of 1.6.  1.5 is fine, however.  :)

Reported by mmastrac on 2008-01-28 05:44:13

dankurka commented 9 years ago
I still have issues with the "gwt-leopard-1.4.61.tar.gz" version after installing it
as described in post 101.

After executing the commands explained in the post (curl..) I navigated to the KitchenSink
samples folder and 
tried to run the sample in hosted mode. The window pops up and I get a "spinning beachball
of death" and so 
I am forced to kill the associated process by hand, because CPU usage is at 95 %.

This is the first version of GWT I installed on my machine here with Leopard so I dont
really know what to do 
now. Is there any "clean-command" like procedure I could manually do to make absolutely
sure that no 
cached compiled stuff is run anywhere without me being aware of it?

Anyone else still experiencing this problem?

Reported by dkimmig on 2008-02-06 07:30:43

dankurka commented 9 years ago
Hi, another bug report coming up:

- the GWT-dev-shell runs, but no hosted browser window is launched.

- app running on: gwt-leopard-1.4.61 on Mac OS 10.5.1 (tried also 10.5.2) with JDK
1.5.0_13

- error msg in dev shell is:
[ERROR] The browser widget class could not be instantiated
org.eclipse.swt.SWTError: No more handles
    at org.eclipse.swt.SWT.error(SWT.java:3400)
    at org.eclipse.swt.SWT.error(SWT.java:3297)
    at org.eclipse.swt.SWT.error(SWT.java:3268)
    at org.eclipse.swt.browser.Browser.<init>(Browser.java:121)
    at com.google.gwt.dev.shell.BrowserWidget.<init>(BrowserWidget.java:242)
    at com.google.gwt.dev.shell.mac.BrowserWidgetSaf.<init>(BrowserWidgetSaf.java:137)
    at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    at
com.google.gwt.dev.shell.PlatformSpecific.createBrowserWidget(PlatformSpecific.java:53)

---
@mmastrac, post 104: is there a way to patch a later revision (1843) with the diff
you posted?
my patch result was:

Hunk #2 FAILED at 73.
patch unexpectedly ends in middle of line
Hunk #3 FAILED at 96.
2 out of 3 hunks FAILED -- saving rejects to file
dev/mac/src/com/google/gwt/dev/BootStrapPlatform.java.rej

Cheers!

Reported by madison.schwinn on 2008-02-13 07:30:27

dankurka commented 9 years ago
Just wanted to add my system.log entries for comment 105:

Feb 14 10:13:22 Macintosh login[431]: USER_PROCESS: 431 ttys000
Feb 14 10:13:26 Macintosh /usr/bin/java[443]: CPSSetForegroundOperationState(): This
call is deprecated and 
should not be called anymore.
Feb 14 10:13:28 Macintosh java[443]: Error loading /Library/InputManagers/Safari AdBlock/Safari

AdBlock.bundle/Contents/MacOS/Safari AdBlock:  dlopen(/Library/InputManagers/Safari
AdBlock/Safari 
AdBlock.bundle/Contents/MacOS/Safari AdBlock, 265): Symbol not found: 
__ZN3KJS10Identifier3addEPNS_7UString3RepE\n  Referenced from: 
/System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/W
ebCore\n  Expected in: /Users/DK/Code/resources/gwt-mac-
1.4.61/Frameworks/JavaScriptCore.framework/Versions/A/JavaScriptCore
Feb 14 10:13:28 Macintosh java[443]: [Java CocoaComponent compatibility mode]: Enabled
Feb 14 10:13:28 Macintosh java[443]: [Java CocoaComponent compatibility mode]: Setting
timeout for SWT to 
0.100000
Feb 14 10:16:40 Macintosh /usr/sbin/spindump[468]: process 443 is being monitored
Feb 14 10:16:43 Macintosh /usr/sbin/spindump[468]: process 443 is being force quit
Feb 14 10:16:49 Macintosh login[431]: DEAD_PROCESS: 431 ttys000

Right now I am on the wifi killing 10.5.2 and cannot run hosted mode with the special
leopard-build of GWT.

Reported by dkimmig on 2008-02-14 09:43:18

dankurka commented 9 years ago
dkimmig, it looks to me like you have something called "Safari AdBlock" installed on
your system that
could be causing your problem.  The system.log that you posted seems to show that GWT's
attempt
to link WebKit in is being thwarted by the inability to find some symbol that it expects.

Could it  be that "Safari AdBlock" is mucking around with WebKit in some way that breaks
GWT's
attempt to load it?   If so, this may help:

       sudo rm -rf /Library/InputManagers/Safari\ AdBlock/

(at your own peril, of course)

Reported by pohl.longsine on 2008-02-14 16:17:28

dankurka commented 9 years ago
@dkimmig - Safari AdBlock is definitely a problem. It actually loads System WebKit
into every app you start, including the GWT Shell. You can expect it to cause
problems with the GWT shell, slow down the load of almost every app on your system
and potentially cause crashes in completely unrelated apps.

Reported by kellegous on 2008-02-14 16:52:13

dankurka commented 9 years ago
It seems this unofficial build lets GWTShell run, but the JUnit shell still bombs out
with the original
error:testEquals(com.totsp.gwittir.client.util.GwtTestEqualsHashCodeBean)javax.xml.parsers.FactoryConfigurationError:
Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found
    at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:104)
    at org.apache.commons.modeler.util.DomUtil.readXml(DomUtil.java:284)
    at
org.apache.commons.modeler.modules.MbeansDescriptorsDOMSource.execute(MbeansDescriptorsDOMSource.java:130)
    at
org.apache.commons.modeler.modules.MbeansDescriptorsDOMSource.loadDescriptors(MbeansDescriptorsDOMSource.java:120)
    at org.apache.commons.modeler.Registry.load(Registry.java:819)

Reported by kebernet on 2008-02-16 18:40:15

dankurka commented 9 years ago
>>Safari AdBlock is definitely a problem. It actually loads System WebKit
>>into every app you start, including the GWT Shell. You can expect it to cause
>>problems with the GWT shell, slow down the load of almost every app on your system
>>and potentially cause crashes in completely unrelated apps.

Thanks for the advice kellegous and pohl.longsine. I ll try that and see what result
the removal of AdBlock will 
accomplish. I cant live on Safari without Adblock thats for sure.. gonna have to go
back to FF if that is really the 
reason for it. 

Reported by dkimmig on 2008-02-17 23:11:25

dankurka commented 9 years ago
Indeed this is it. Uninstalling Safari Adblock did the trick.

No I can highly efficiently develop GWT apps, but cannot surf the web any longer without
making my eyes bleed 
;)

Reported by dkimmig on 2008-02-17 23:16:06

dankurka commented 9 years ago
I still can't get 1.4.61 to run GWTTestCase unit tests. I get a null pointer
exception from CompilingClassLoader line 261 which seems to suggest it can't get the
context class loader again, even though JUnitShell appears to call
BootstrapPlatform.go(), which should be using the hack (the same hack as GWTShell
which DOES work) to prevent nulls from being returned.

Oh how I am tired of these Leopard issues. I really hope out-of-process hosted mode
can be done soon and rid us of this issue. 

Reported by cromwellian on 2008-02-19 23:22:21

dankurka commented 9 years ago
I reported the problem to the developer of Safari Adblock and in his answer he said
it will be solved in the next 
release.

Reported by dkimmig on 2008-03-02 09:36:11

dankurka commented 9 years ago
Committed r2000.

Reported by gwt.team.knorton on 2008-03-05 06:20:01

dankurka commented 9 years ago
Was this tested with the "Java 1.6 Preview Release" Apple made a few months back?

Reported by aviad.infomancers on 2008-03-09 05:18:49

dankurka commented 9 years ago
Okay, updating myself: It does NOT work with the preview release of Java 1.6 for Leopard.
I tried it, and got a 
JNI error:

Unable to load required native library 'gwt-ll'.  Detailed error:
/Users/aviadbendov/Library/Java/GWT/libgwt-ll.jnilib: )

Your GWT installation may be corrupt
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load required
native library 'gwt-ll'.  
Detailed error:
/Users/aviadbendov/Library/Java/GWT/libgwt-ll.jnilib: )

Your GWT installation may be corrupt
    at com.google.gwt.dev.shell.LowLevel.init(LowLevel.java:107)
    at com.google.gwt.dev.shell.mac.LowLevelSaf.init(LowLevelSaf.java:262)
    at com.google.gwt.dev.BootStrapPlatform.init(BootStrapPlatform.java:34)
    at com.google.gwt.dev.GWTShell.main(GWTShell.java:371)

After switching back to Java 1.5, got no such error and hosted mode worked. 

Reported by aviad.infomancers on 2008-03-09 05:26:16

dankurka commented 9 years ago
I just tried the above and got the same error, but when switching back it still did
not work.
The GWT shell starts up and then crashed right away.

An apple crash report is generated referring to the libswt-pi-carbon-3235.jnilib.....not
much info other than this.

Here's the entire printout from the terminal:
     [echo] Running GWT shell against external server
     [java] 2008-03-26 11:38:41.939 java[3218:80f] [Java CocoaComponent compatibility
mode]: Enabled
     [java] 2008-03-26 11:38:41.945 java[3218:80f] [Java CocoaComponent compatibility
mode]: Setting timeout for SWT to 0.100000
     [java] Invalid memory access of location 00000000 eip=96fabac7
     [java] Java Result: 138

Would it help to build GWT with the newest version of libswt?

Reported by TueDissing on 2008-03-26 10:42:57

dankurka commented 9 years ago
I'm seeing the same issue as comment #79 - any known workarounds for that?

Reported by vectorstofinal on 2008-03-26 15:17:21

dankurka commented 9 years ago
I get the impression, from reading comment #79, that it's unrelated to the leopard bug
tracked by this ticket.   If 
"rrec...@mac.com" happened to be using Leopard at the time, it must have been incidental.

Reported by pohl.longsine on 2008-03-26 15:26:18

dankurka commented 9 years ago
Interesting, I didn't get that impression.  Especially since commenter 80 had the
same issue.  The exact same code that fails in Leopard hosted mode works just fine
in
hosted mode on WinXP...

Reported by vectorstofinal on 2008-03-26 16:39:40

dankurka commented 9 years ago
I could be wrong, although I don't see a clear, leopard-specific connection.  Have you
tried that same code in 
hosted  mode on Tiger? 

Reported by pohl.longsine on 2008-03-26 17:01:07

dankurka commented 9 years ago
Nope, unfortunately I don't have access to Tiger anymore - wish I could try it there.

Reported by vectorstofinal on 2008-03-26 17:06:05

dankurka commented 9 years ago
Are you also using IntelliJ?  If so, have you tried the same code running the hosted
mode in eclipse — or 
standalone?   In my case, I use Netbeans, and the plugin ("gwt4nb") configures GWT's
hosted mode differently 
than it would be in standalone mode.   In particular, it deploys to the glassfish container
in Netbeans rather than 
to the embedded tomcat that ships with GWT's hosted mode — and this causes some RPC-in-hosted-mode

headaches for me that are not specific to leopard.

Reported by pohl.longsine on 2008-03-26 17:21:16

dankurka commented 9 years ago
On both machines I am using myEclipse with resin for the app server.  I believe I am
running it the same way on both machines, best I can tell.

Reported by vectorstofinal on 2008-03-26 17:47:43

dankurka commented 9 years ago
For comment #119 to #123:
As pohl.longsine noticed correctly, the RPC call problem is not related to Leopard
but to the cross-scripting 
security of Webkit, which is used in hosted mode on mac os machines.
The security mechanism checks if the RPC call URL is in the same domain as the applications
URL.
So if you start the hosted mode on localhost:8888 and then you try to make a RPC call
to 
http://some.other.server/rpc/service the call will fail!!!

So you need to start your hosted mode in noserver mode and connect to the servers URL:
In Intellij change the shell parameters of your launch configuration:
-noserver http://some.other.server/pathtoApp/App.html

you can even add the -whitelist parameter to get rid of the annoying warning.... ;-)

This problem does not occur on Windows machines as their hosted mode uses IE........

I hope these explications will help you resolve this "issue"
Roll

Reported by rreckel@mac.com on 2008-04-02 12:30:10

dankurka commented 9 years ago

Reported by knorton+personal@google.com on 2008-04-29 08:06:51

dankurka commented 9 years ago
I am seeing the same error as comment #117, just running from the command line on OS
X 10.5.2:

mactom:KitchenSink tomgordon$ cat KitchenSink-shell 
#!/bin/sh
APPDIR=`dirname $0`;
java -XstartOnFirstThread -cp
"$APPDIR/src:$APPDIR/bin:$APPDIR/../../gwt-user.jar:$APPDIR/../../gwt-dev-mac.jar"
com.google.gwt.dev.GWTShell -out "$APPDIR/www" "$@"
com.google.gwt.sample.kitchensink.KitchenSink/KitchenSink.html;

mactom:KitchenSink tomgordon$ ./KitchenSink-shell 
Unable to load required native library 'gwt-ll'.  Detailed error:
/Users/tomgordon/gwt-mac-1.4.62/libgwt-ll.jnilib: )

Your GWT installation may be corrupt
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load required
native library 'gwt-ll'.  Detailed error:
/Users/tomgordon/gwt-mac-1.4.62/libgwt-ll.jnilib: )

Your GWT installation may be corrupt
    at com.google.gwt.dev.shell.LowLevel.init(LowLevel.java:107)
    at com.google.gwt.dev.shell.mac.LowLevelSaf.init(LowLevelSaf.java:262)
    at com.google.gwt.dev.BootStrapPlatform.go(BootStrapPlatform.java:29)
    at com.google.gwt.dev.GWTShell.main(GWTShell.java:318)

mactom:KitchenSink tomgordon$ java -version
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13-120)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_05-b13-52, mixed mode)

Reported by oomph.gordon on 2008-05-09 04:20:04

dankurka commented 9 years ago
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13-120)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_05-b13-52, mixed mode)

This is the new JVM that just shipped a few days ago. GWT doesn't support 64-bit 
JVM's right now, so it's not going to work yet. The 1.5 JVM should still be the 
default for 10.5.2 and it should work just fine.

Reported by knorton+personal@google.com on 2008-05-09 04:41:20

dankurka commented 9 years ago
I see, thanks for the info!
-Tom

Reported by oomph.gordon on 2008-05-09 14:53:23

dankurka commented 9 years ago
is there any reason why Compile/Browse isn't working anymore with the GWT 1.5
Milestone Release on Leopard? When I click the Compile/Browse button on the GWT Shell
it seems as if it would be compiling but never actually opens the browser window and
seems to be getting into an infinite loop as my processor seems to be under full load
ever after.

Does anybody else had this problem too?

Thanks 

Dominik

Reported by Dominik.J.Steiner on 2008-05-19 18:58:53

dankurka commented 9 years ago
the same problem as in comment 132 is happening when i launch the GWTCompiler from
the command line. I'm wondering if someone is being able to compile his application
on Mac Leopard?

Reported by Dominik.J.Steiner on 2008-05-19 19:13:55

dankurka commented 9 years ago
To follow up on comments 132 and 133, after deleting the .gwt-cache and .gwt-temp
directories the compilation process is working again - both from command line and the
Compile/Browse button on the GWT Shell

Reported by Dominik.J.Steiner on 2008-05-20 12:34:35

dankurka commented 9 years ago
One thing that I could notice though is that the compile time increase to more than
twice what it was before when using a snapshot from the GWT 1.5 development some
month ago. Is there any reason for that?

Reported by Dominik.J.Steiner on 2008-05-21 11:49:01

dankurka commented 9 years ago
I downloaded the GWT 1.4.62 and gwt-leopard-1.4.61 from comment #46 and in both cases
I'm getting the 
follow error:

Unable to load required native library 'gwt-webkit'
    Your GWT installation may be corrupt
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load required
native library 'gwt-webkit'
    Your GWT installation may be corrupt
    at com.google.gwt.dev.shell.mac.LowLevelSaf.init(LowLevelSaf.java:283)
    at com.google.gwt.dev.BootStrapPlatform.go(BootStrapPlatform.java:29)
    at com.google.gwt.dev.GWTShell.main(GWTShell.java:318)

I'm running using the JDK 5 (Default MacOS X)

I checked the file permissions already and everything looks fine.

Anyone had the same problem?

Reported by pentateu on 2008-05-25 03:29:00

dankurka commented 9 years ago
I started the hosted browser but It shows up just http://localhost:8888 and does not
show my application.

I was working without problems in my project for while and suddenly my application
stop working. I tried to 
create another application in a different place but with the same names, but it was
unsucessful. The most 
strange thing is if I create an application with a different name it works. I tried
to create my application in 
different places in my computer, but when I use my application original´s name it does
not work.

It´s like a cache or something like that.

example:
    my original application
    - applicationcreator -eclipse News info.personal.News

    (when I start the shell it does not show in the hosted browser 
http://localhost:8888/info.personal.News/News.html  -- remembering, it worked for a
while)

if I try to create another application using same names (News info.personal.News) in
a different place 
(anywhere in my computer) it does not work, but if I use a different name (like, applicationcreator
-eclipse 
NewsXXX info.personal.NewsXXX) it does work.

Leopard, Java 1.5 and GWT 1.5 (r.c.)

Reported by f.beppler on 2008-06-09 12:36:50

dankurka commented 9 years ago
hi beppler,

it might be the same issue that i was facing some time ago but couldn't find any
solution either besides modifying the html host page.

http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/def4377d6c1f088f/c012df7f467ed749?lnk=gst&q=dominik+cache+new+name#c012df7f467ed749

have a look at above thread to see if that might be the issue you are facing too.

HTH

Dominik

Reported by Dominik.J.Steiner on 2008-06-09 13:25:32

dankurka commented 9 years ago
Thank you Steiner, the link you suggested has a solution (not a perfect one but it works).

I had to change the shell script to run the hosted browser.

#!/bin/sh
java -XstartOnFirstThread -Xmx256M -cp "./src:./bin:./gwt-user.jar:./gwt-dev-mac.jar"

com.google.gwt.dev.GWTShell -whitelist http://127.0.0.1 -out "./www" "$@" 
http://127.0.0.1:8888/info.personal.News/News.html;

Reported by f.beppler on 2008-06-09 18:04:03

dankurka commented 9 years ago
Unfortunately, the solution worked for some time. It has a very strange behavior. The
link used to call my 
application (http://127.0.0.1:8888/info.personal.News/News.html) stopped working again.
It seems there is a 
problem with java + gwt + leopard.

I found another solution (again, not a perfect one). I created a new host in /private/etc/hosts
and use such a 
host to call my application (use sudo vi /private/etc/hosts to edit the file). For
example, I added a host called 
"mymachine" pointing to 127.0.0.1 and used "mymachine" to call my application (if it
stops working again it is 
just necessary to create a new host with a different name).

java -XstartOnFirstThread -Xmx256M -cp "./src:./bin:./gwt-user.jar:./gwt-dev-mac.jar"

com.google.gwt.dev.GWTShell -whitelist http://mymachine -out "./www" "$@" 
http://mymachine:8888/info.personal.News/News.html;

Reported by f.beppler on 2008-06-16 17:51:50

dankurka commented 9 years ago

Reported by scottb+legacy@google.com on 2008-07-29 16:34:07

dankurka commented 9 years ago
1_5_RC has been released.

Reported by scottb+legacy@google.com on 2008-08-14 02:26:52

dankurka commented 9 years ago

Reported by rjrjr@google.com on 2011-02-09 00:17:40