Different behaviour in hostedmode from that in the browser

2009-11-01 Thread mike_mac


Firstly, apologies as I'm opening a duplicate thread, I already
started this (http://groups.google.com/group/google-web-toolkit/
browse_thread/thread/bb98ca98a1b853ed/
914401f7acb74e8a#914401f7acb74e8a) but because of the title II thought
it might not have grabbed peoples attention so opening this one
instead.

While playing around with the soafaces gwt project I found some
strange behaviour w.r.t. instanceof and I'm wondering has anyone
noticed anything similar before.

When sending objects from the client to the server soafaces attempts
to wrap them in an object as arrays of Serializable and IsSerializable
objects ... The method that creates the wrapper takes as an argument
of an Object (and so also Object[])

e.g.
Object[] objArray = new Object[2];
objArray[0] = new MyType1();
objArray[1] = new MyType2();
MyType1 and MyType2 both implement IsSerializable and not
Serializable

The offending code is below, the first bunch of if statements seem to
be optimisations (are we sending a single object of a certain type) ,
the last if statement is where it wraps them in a single object.

The problem is that in Hosted mode the above obj evaluates to true for
(obj instanceof Serializable) where as in my compiled and deployed
code it falls through to the final if else (that evaluates to true)
and executes correctly. Is this a bug in the hosted mode
implementation ? I'm using gwt 1.7.1 with jdk 1.6.0_16

   if (obj instanceof IsSerializable) {
  proxy._Pojo = (IsSerializable) obj;
  //Window.alert("here 1");
} else if (obj instanceof IsSerializable[]) {
  proxy._PojoAr = (IsSerializable[]) obj;
  //Window.alert("here 2");
} else if(obj instanceof Serializable) {
  proxy._PojoSerial = (Serializable) obj;
  //Window.alert("here 3");
} else if (obj instanceof Serializable[]) {
  proxy._PojoSerialAr = (Serializable[]) obj;
  //Window.alert("here 4");
} else if (obj instanceof Serializable[][]) {
  proxy._PojoSerialArAr = (Serializable[][]) obj;
  //Window.alert("here 5");
} else if (obj instanceof JSONObject) {
  proxy._Json = ((JSONObject) obj).toString();
} else if(obj.getClass().getName().equals("[Ljava.lang.Object;"))
{
  //Window.alert("here 6");


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Anyone using soafaces for client server communication ?

2009-10-30 Thread mike_mac


On further investigation this seems to be a hosted mode issue and
different behaviour of instanceof between hosted mode and complied
versions of the code.

Passing an Object[] called obj that has two objects that implement
IsSerializable
results in "obj instanceof Serializable" returning true in hosted mode
but false in the compiled Javascript.

See
org.soafaces.services.client.rpcGenericDataUtil.createGenericDataWrapper
(Object obj) in soafaces source.

Anyone have a logical explanation why hosted mode thinks its a
Serializable object ? Object is not Serializable right so neither
should Object[] right ?

On Oct 30, 7:04 pm, mike_mac  wrote:
> http://code.google.com/p/soafaces/
>
> I've tried to get it working but it seems to be broken ... it claims
> to allow passing of Object[] but when I try to use it (Object[] objs =
> new Object[2]) I get a Serialization exception which seems to be from
> generated code ...
>
> com.google.gwt.user.client.rpc.SerializationException:
> [Ljava.lang.Object;
> at
> org.soafaces.services.client.rpc.UniversalClientRPC_TypeSerializer.raiseSerializationException
> (transient
> source for
> soafaces.services.client.rpc.UniversalClientRPC_TypeSerializer:3133)
> at
> soafaces.services.client.rpc.UniversalClientRPC_TypeSerializer.serialize
> (Native Method)
>
> It does work if I pass a single argument, anyone have any experience
> using this ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Anyone using soafaces for client server communication ?

2009-10-30 Thread mike_mac


http://code.google.com/p/soafaces/

I've tried to get it working but it seems to be broken ... it claims
to allow passing of Object[] but when I try to use it (Object[] objs =
new Object[2]) I get a Serialization exception which seems to be from
generated code ...

com.google.gwt.user.client.rpc.SerializationException:
[Ljava.lang.Object;
at
org.soafaces.services.client.rpc.UniversalClientRPC_TypeSerializer.raiseSerializationException
(transient
source for
soafaces.services.client.rpc.UniversalClientRPC_TypeSerializer:3133)
at
soafaces.services.client.rpc.UniversalClientRPC_TypeSerializer.serialize
(Native Method)

It does work if I pass a single argument, anyone have any experience
using this ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Problems with 1.7.1 -noserver hosted mode on Linux

2009-10-29 Thread mike_mac

Its not the war vs maven webapp issue is it ? the eclipse plugin
expects a war dir and doesn't work with the maven default dir
(webapp) ... Try running it from the commandline manually setting the
classpath to see if it works. If it does you can simply add it to your
run/debug configurations as a Java Application.

On Oct 28, 2:36 pm, Jeff Chimene  wrote:
> The problem may be that .16 point release doesn't play well w/ GWT. The
> symptoms are usually that the debugger doesn't stop at a breakpoint, not
> that the entry point is never called. I think you have to downgrade to at
> least .14 Search this list for the JDK version. It's been discussed several
> times.
>
> On Wed, Oct 28, 2009 at 2:33 AM, bysse  wrote:
>
> > I'm having huge problems getting hosted mode to work under Linux with
> > the -noserver flag. The module entry point is never called and no
> > error message is show / logged. I've tried to start it through both
> > the maven plugin and the eclipse plugin with the same results.
>
> > The project works fine in a windows environment with the same setup.
> > So there must be something wrong with the Linux SDK. Does anyone have
> > similar problems?
>
> > My setup is:
> >  Linux x64 (Ubuntu 9.04)
> >  Java 1.6.0.16 32bit
> >  GWT SDK 1.7.1
> >  Eclipse 3.5
> >   Google Plugin 1.1.2
> >  JBoss 4.2.2 and 4.2.3
> >  Firefox 3.0.14
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: hosted mode debugging with -noserver in eclipse

2009-10-09 Thread mike_mac


Wow ... thanks for explaining that, at least I know I wasn't going
crazy !
Maybe a small fix to look for the Maven default dir (webapp) in a
future release ? :-)
Actually it works fine when launched as a java application from inside
eclipse,
it just means I have to manage the dependent jars manually. Being able
to
make a change and just hit refresh is awesome !

On Oct 8, 4:38 pm, Keith Platfoot  wrote:
> Hi Mike,
> I think your issue has to do with certain changes made to GWT in version
> 1.6.  Before 1.6, the GWTShell class was used to launch applications in
> hosted mode.  In 1.6, the default structure of GWT projects was changed to
> make it more similar to Java web apps.  By convention, GWT projects now
> assume the existence of a directory named "war" which contains the contents
> of the deployed WAR file.  This includes source files, such as your web.xml
> and any public HTML pages.  The WAR directory also contains subdirectories
> with the compiled JavaScript output of each GWT module.  In 1.6 and later a
> new class, HostedMode, replaces the older GWTShell as the default class for
> launching hosted mode.
>
> The plugin supports GWT versions both older and newer than 1.6.  It uses
> some heuristics to determine whether to launch applications with the
> GWTShell or HostedMode class.  It sounds like in your case, you are able to
> use HostedMode from the command line, but when you launch from Eclipse, the
> plugin is using GWTShell... is that correct?
>
> If so, I have two follow-up questions.  First, does your project contain a
> WAR directory named "war"?  I know that many maven users use a different
> naming convention, but as of right now, the plugin does *not* support
> configuring the name of the WAR directory (it must be "war").  If yours is
> named differently, your best bet might be to try to create a symlink named
> "war" pointing to your actual WAR folder.  I haven't actually tested that
> scenario, but it *should* work.
>
> Once your project has a proper "war" directory (or symlink), the second
> thing to check is whether your project is tagged as a Google Web Application
> project.  This won't actually show up in the Eclipse UI, but if you look at
> your project's .project file, you should see the following tag nested under
> 
>
> com.google.gdt.eclipse.core.webAppNature
>
> If it's *not *there, go ahead and add it, and then restart Eclipse.  Then
> try launching the project again, and see what happens.  Let me know if you
> still run into problems.
>
> Keith
>
> On Wed, Oct 7, 2009 at 12:12 PM, mike_mac  wrote:
>
> > Just to follow up on this ... this seems to be the eclipse plugin,
> > I've managed to get host mode running from the command line and it
> > works.
>
> > The weird thing is, it DOES work with a small war project that I
> > built, deployed on jboss and ran the hosted mode -noserver option from
> > eclipse via the plugin. Our more complicated maven built war (part of
> > a larger ear) doesn't and it seems to classpath issue but I don't know
> > how to debug the eclipse plugin.
>
> > I've added the command line startup command into my eclipse run so I
> > can debug but it would be better if the plugin worked :(
>
> > I did notice that the usage for plugin was different from commandline
> > options so there could well be a bug here (i.e. theres a possiblity
> > I'm not going mad). GWTShell vs HostedMode ??
>
> > Unknown argument: -blah
> > Google Web Toolkit 1.7.0
> > GWTShell [-noserver] [-port port-number | "auto"] [-whitelist
> > whitelist-string] [-blacklist blacklist-string] [-logLevel level] [-
> > gen dir] [-style style] [-ea] [-out dir] [url]
>
> > where
> >  -noserver   Prevents the embedded web server from running
> >  -port       Specifies the TCP port for the embedded web server
> > (defaults to )
> >  -whitelist  Allows the user to browse URLs that match the specified
> > regexes (comma or space separated)
> >  -blacklist  Prevents the user browsing URLs that match the specified
> > regexes (comma or space separated)
> >  -logLevel   The level of logging detail: ERROR, WARN, INFO, TRACE,
> > DEBUG, SPAM, or ALL
> >  -gen        The directory into which generated files will be written
> > for review
> >  -style      Script output style: OBF[USCATED], PRETTY, or DETAILED
> > (defaults to OBF)
> >  -ea         Debugging: causes the compiled output to check assert
> > statements.
> >  -out        The directory to write output files into (defaults to
> > current)
> > and
> >  url 

Re: GWT 1.7 Hosted mode Wont create GWT widgets

2009-10-07 Thread mike_mac

Well I've just opened another thread with what sounds like a similar
(but different) problem ...
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/34b7bbcf6057a23d

Try running the app in hosted mode from the command line ... if it
works you can simply launch it from inside eclipse as a java app.
I know it doesn't solve your problem but it may at least allow you to
keep developing.

On Oct 7, 1:10 pm, Patrick Corbett 
wrote:
> Hello,
>
> I am having a problem that started just out of the blue.  my project
> has been working fine for months however today all of a sudden it
> stopped running in hosted mode.
>
> I can still compile the project and when run on my tomcat it worked
> fine.  I have determined that it is not contained to simply the
> project i was working on all previous and new proejects fail to
> start.  only basic HTML code is shown in the hosted browser and it
> wont process the java code in the entry point.
>
> If i set a break point within the onModuleLoad method it is never
> triggered.
>
> I am using eclispe 3.4 with GWT 1.7, also tried 1.6.4 and 1.7.1 with
> no effect.  using the Google plugin
>
> Thanks
>
> Patrick
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: hosted mode debugging with -noserver in eclipse

2009-10-07 Thread mike_mac

Just to follow up on this ... this seems to be the eclipse plugin,
I've managed to get host mode running from the command line and it
works.

The weird thing is, it DOES work with a small war project that I
built, deployed on jboss and ran the hosted mode -noserver option from
eclipse via the plugin. Our more complicated maven built war (part of
a larger ear) doesn't and it seems to classpath issue but I don't know
how to debug the eclipse plugin.

I've added the command line startup command into my eclipse run so I
can debug but it would be better if the plugin worked :(

I did notice that the usage for plugin was different from commandline
options so there could well be a bug here (i.e. theres a possiblity
I'm not going mad). GWTShell vs HostedMode ??

Unknown argument: -blah
Google Web Toolkit 1.7.0
GWTShell [-noserver] [-port port-number | "auto"] [-whitelist
whitelist-string] [-blacklist blacklist-string] [-logLevel level] [-
gen dir] [-style style] [-ea] [-out dir] [url]

where
  -noserver   Prevents the embedded web server from running
  -port   Specifies the TCP port for the embedded web server
(defaults to )
  -whitelist  Allows the user to browse URLs that match the specified
regexes (comma or space separated)
  -blacklist  Prevents the user browsing URLs that match the specified
regexes (comma or space separated)
  -logLevel   The level of logging detail: ERROR, WARN, INFO, TRACE,
DEBUG, SPAM, or ALL
  -genThe directory into which generated files will be written
for review
  -style  Script output style: OBF[USCATED], PRETTY, or DETAILED
(defaults to OBF)
  -ea Debugging: causes the compiled output to check assert
statements.
  -outThe directory to write output files into (defaults to
current)
and
  url Automatically launches the specified URL

versus

java -cp gwt-dev-.jar
com.google.gwt.dev.HostedMode
Missing required argument 'module[s]'
Google Web Toolkit 1.7.0
HostedMode [-noserver] [-port port-number | "auto"] [-whitelist
whitelist-string
] [-blacklist blacklist-string] [-logLevel level] [-gen dir] [-style
style] [-ea
] [-server servletContainerLauncher] [-startupUrl url] [-war dir] [-
extra dir] [
-workDir dir] [-localWorkers count] module[s]

where
  -noserver  Prevents the embedded web server from running
  -port  Specifies the TCP port for the embedded web server
(defaults to )
  -whitelist Allows the user to browse URLs that match the
specified regexes (comma or space separated)
  -blacklist Prevents the user browsing URLs that match the
specified regexes (comma or space separated)
  -logLevel  The level of logging detail: ERROR, WARN, INFO,
TRACE, DEBUG, SPAM, or ALL
  -gen   The directory into which generated files will be
written for review
  -style Script output style: OBF[USCATED], PRETTY, or
DETAILED (defaults to OBF)
  -eaDebugging: causes the compiled output to check assert
statements.
  -serverSpecifies a different embedded web server to run
(must implement ServletContainerLauncher)
  -startupUrlAutomatically launches the specified URL
  -war   The war directory to write output files into
(defaults to war)
  -extra The directory into which extra, non-deployed files
will be written
  -workDir   The compiler work directory (must be writeable;
defaults to a system temp dir)
  -localWorkers  Specifies the number of local workers to use when
compiling permutations
and
  module[s]  Specifies the name(s) of the module(s) to host


On Oct 7, 11:02 am, mike_mac  wrote:
> Hi ...
>    I'm trying to get hosted mode debugging running using Jboss as the
> server instead of tomcat and I can't get it working ...
>
> I've followed the instructions here 
> ...http://code.google.com/webtoolkit/doc/1.6/FAQ_DebuggingAndCompiling.h...
>
> But when I try to run the google web tool kit development shell with
> eclipse I'm getting
> [ERROR] Unable to find 'main.gwt.xml' on your classpath; could be a
> typo, or maybe you forgot to include a classpath entry for source?
>
> I've specified Main as my entry point module in the gwt tab of the
> launch configuration. Yes I did notice the case difference in the
> name, the module definition was changed to main with
>  and the url was /main/
> main.html ...
> I've tried renamining the gwt.xml to main.gwt.xml but that had no
> effect.
>
> The root src dir with the gwt.xml is on the classpath (in the
> classpath tab).
>
> I've tried explcitly setting the directory with the Main.gwt.xml into
> the classpath which does indeed let eclipse/gwt find the xml file but
> then I get lots of errors along the lines of
>
>  The declared package
> "com.company.product.web.client.uicomponent.menu" does not match the
> expected package "c

hosted mode debugging with -noserver in eclipse

2009-10-07 Thread mike_mac

Hi ...
   I'm trying to get hosted mode debugging running using Jboss as the
server instead of tomcat and I can't get it working ...

I've followed the instructions here ...
http://code.google.com/webtoolkit/doc/1.6/FAQ_DebuggingAndCompiling.html#How_do_I_use_my_own_server_in_hosted_mode_instead_of_GWT%27s

But when I try to run the google web tool kit development shell with
eclipse I'm getting
[ERROR] Unable to find 'main.gwt.xml' on your classpath; could be a
typo, or maybe you forgot to include a classpath entry for source?

I've specified Main as my entry point module in the gwt tab of the
launch configuration. Yes I did notice the case difference in the
name, the module definition was changed to main with
 and the url was /main/
main.html ...
I've tried renamining the gwt.xml to main.gwt.xml but that had no
effect.

The root src dir with the gwt.xml is on the classpath (in the
classpath tab).

I've tried explcitly setting the directory with the Main.gwt.xml into
the classpath which does indeed let eclipse/gwt find the xml file but
then I get lots of errors along the lines of

 The declared package
"com.company.product.web.client.uicomponent.menu" does not match the
expected package "client.uicomponent.menu"

I'm stumped ... could it be the rename-to="main" thats confusing it ?
anyone with any ideas ?

I'm able to run some sample projects in the embedded server no problem
so I can only think that its something to do with running in -noserver
option but I'm lost.

I'm using "Google App Engine for Java 1.2.5 SDK Bundle for Eclipse
3.5" with GWT 1.7

Everything compiles with Maven and runs ok on JBoss ...

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---