GWT 2.0 with PHP on apache2 (xampp)

91 views
Skip to first unread message

PC_Nerd

unread,
Feb 4, 2010, 8:46:29 PM2/4/10
to Google Web Toolkit
Hi,

I've been playing with GWT and managed to get a basic XML request
working to response.xml. However after reading through
http://code.google.com/webtoolkit/doc/latest/FAQ_DebuggingAndCompiling.html#How_do_I_use_my_own_server_in_hosted_mode_instead_of_GWT%27s
I'm slightly confused as to whether or not this will allow me to run
my PHP from apache, and still be able to serve that content to the GWT
app.

When requesting response.xml ( which is just plain xml, no server side
code at all) from a jetty instance, default setup It all works...
However the app loads when -noserver is added, but the request does
not complete ( response.getStatusCode() is 0).

a) does response.getStatusCode() ==0 mean that there was no response
at all?
b) is there any way to get PHP content(JSON or XML) served from eg
127.0.0.1:80 where the app is intejected through the browser plugin
from 9997? I suspect that what I'm running into is a SOP issue, but
the SOP I'm catching is not thrown/displayed

Thanks for any ideas on how to get PHP backend running.

Jeff Chimene

unread,
Feb 5, 2010, 11:28:53 AM2/5/10
to google-we...@googlegroups.com
On 02/04/2010 06:46 PM, PC_Nerd wrote:
> Hi,
>
> I've been playing with GWT and managed to get a basic XML request
> working to response.xml. However after reading through
> http://code.google.com/webtoolkit/doc/latest/FAQ_DebuggingAndCompiling.html#How_do_I_use_my_own_server_in_hosted_mode_instead_of_GWT%27s
> I'm slightly confused as to whether or not this will allow me to run
> my PHP from apache, and still be able to serve that content to the GWT
> app.
>
> When requesting response.xml ( which is just plain xml, no server side
> code at all) from a jetty instance, default setup It all works...
> However the app loads when -noserver is added, but the request does
> not complete ( response.getStatusCode() is 0).
>
> a) does response.getStatusCode() ==0 mean that there was no response
> at all?
> b) is there any way to get PHP content(JSON or XML) served from eg
> 127.0.0.1:80 where the app is intejected through the browser plugin
> from 9997?

Sure. Many on this list test using this technique. I don't know how many
use XAMPP.

You should be using a URL like

http://127.0.0.1/MyWebPage.html?gwt.codesvr=127.0.0.1:9997

You don't need "80", as that's the default. When you're talking to
Jetty, the URL will usually be

http://127.0.0.1:8888/MyWebPage.html?gwt.codesvr=127.0.0.1:9997

I suspect that what I'm running into is a SOP issue, but
> the SOP I'm catching is not thrown/displayed

No, that's not the problem.

> Thanks for any ideas on how to get PHP backend running.

Check your Apache access/error logs to see if there's anything interesting.

PC_Nerd

unread,
Feb 6, 2010, 8:26:25 AM2/6/10
to Google Web Toolkit
Hi,

I've received this entry in my error.log from apache when I attempt to
load the developer mode url/page.

[Sun Feb 07 00:18:26 2010] [error] [client 127.0.0.1] File does not
exist: C:/xampp/htdocs/sampleapplication/sampleapplication, referer:
http://localhost/SampleApplication/SampleApplication.html?gwt.codesvr=192.168.0.10:9997

There is obviously no application/executable/file located at said
location, however I do not know what is meant to be there to actually
run.

Thanks,
PC_Nerd

On Feb 6, 3:28 am, Jeff Chimene <jchim...@gmail.com> wrote:
> On 02/04/2010 06:46 PM, PC_Nerd wrote:
>
>
>
> > Hi,
>
> > I've been playing with GWT and managed to get a basic XML request
> > working to response.xml.  However after reading through

> >http://code.google.com/webtoolkit/doc/latest/FAQ_DebuggingAndCompilin...

Jeff Chimene

unread,
Feb 6, 2010, 7:52:39 PM2/6/10
to google-we...@googlegroups.com
On Sat, Feb 6, 2010 at 6:26 AM, PC_Nerd <isjack...@gmail.com> wrote:
Hi,

I've received this entry in my error.log from apache when I attempt to
load the developer mode url/page.

[Sun Feb 07 00:18:26 2010] [error] [client 127.0.0.1] File does not
exist: C:/xampp/htdocs/sampleapplication/sampleapplication, referer:
http://localhost/SampleApplication/SampleApplication.html?gwt.codesvr=192.168.0.10:9997

There is obviously no application/executable/file located at said
location, however I do not know what is meant to be there to actually
run.

Thanks,
PC_Nerd

The  "Debugging and Compling" link you referred to earlier describes what must go into that directory. According to your Apache configuration, that is the location in which Apache expects to find SampleApplication.html. Did you copy the files to that directory?

The rest of the path info is swallowed by the Google FF plugin and used to make a connection with the runtime debugging session.

--
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-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


PC_Nerd

unread,
Feb 6, 2010, 11:43:05 PM2/6/10
to Google Web Toolkit
Hi,

I'm not sure I understand correctly which parts of what url's are used
for the FF plugin.

From what I can read into the error message above ( from apache's
error.log) the SampleApplication.html is found, and it makes a
reference or call to this "file/executable/thing" named
sampleapplication which is in ./ yes?

This unknown thing is then not found, but is this the part where the
rest of the url is swallowed by the FF plugin? I'm certain that the
SampleApplication.html is found - all of the HTML is rendered but the
locations where the button/ui from GWT are added to the page, none of
these GWT elements are rendered/created.

If this is the case then what am I missing in my directory? The
current file list is:

hosted.html
response.php
SampleApplication.css
SampleApplication.html
sapleapplication.nocache.js

Thanks,
PC_Nerd


On Feb 7, 11:52 am, Jeff Chimene <jchim...@gmail.com> wrote:


> On Sat, Feb 6, 2010 at 6:26 AM, PC_Nerd <isjackawes...@gmail.com> wrote:
> > Hi,
>
> > I've received this entry in my error.log from apache when I attempt to
> > load the developer mode url/page.
>
> > [Sun Feb 07 00:18:26 2010] [error] [client 127.0.0.1] File does not
> > exist: C:/xampp/htdocs/sampleapplication/sampleapplication, referer:
>

> >http://localhost/SampleApplication/SampleApplication.html?gwt.codesvr...

> > google-web-tool...@googlegroups.com<google-web-toolkit%2Bunsu...@googlegroups.com>

Jeff Chimene

unread,
Feb 7, 2010, 11:06:04 AM2/7/10
to google-we...@googlegroups.com
On Sat, Feb 6, 2010 at 9:43 PM, PC_Nerd <isjack...@gmail.com> wrote:
Hi,

I'm not sure I understand correctly which parts of what url's are used
for the FF plugin.
The stuff after the "?"

From what I can read into the error message above ( from apache's
error.log) the SampleApplication.html is found, and it makes a
reference or call to this "file/executable/thing" named
sampleapplication which is in ./  yes?

If that's "C:/xampp/htdocs/sampleapplication/",  then yes. I think there's also a filename case matching error. However, you say that the basic page is rendered, so it's obviously finding something.


This unknown thing is then not found, but is this the part where the
rest of the url is swallowed by the FF plugin?

Apache doesn't use the URL query compnent to find the file, it uses the path component.
 
I'm certain that the
SampleApplication.html is found - all of the HTML is rendered but the
locations where the button/ui from GWT are added to the page, none of
these GWT elements are rendered/created.

If this is the case then what am I missing in my directory?  The
current file list is:

hosted.html
response.php
SampleApplication.css
SampleApplication.html
sapleapplication.nocache.js

You're missing the stuff in step 4 from the URL mentioned earlier
Compile your application once using the ant build target. Ideally, you can use GWT's -war option to generate output files directly into your external server's static content folder. Otherwise, you'll need to copy the the GWT output folder from war/<moduleName> to your external server's static content.

PC_Nerd

unread,
Feb 7, 2010, 4:13:12 PM2/7/10
to Google Web Toolkit
Yay!!! working!

Thankyou soo much.

It was that /SampleApplication.html is actually meant to be in ../
compared to the compiled gwt code... so when I placed it all in
SampleApplication/ it was actually requesting /SampleApplicaton/
sampleapplication/sampleapplication.nocache.js - therefore causing a
404 in access.log.

Is there any way for me to set it that it is all in the same
directory, ie that I dont have to have a SampleApplication/ ?

Thanks,
PC_Nerd

On Feb 8, 3:06 am, Jeff Chimene <jchim...@gmail.com> wrote:

Reply all
Reply to author
Forward
0 new messages