Re: Accessing a Tomcat webapp from a PHP webapp

2010-02-18 Thread

Hi Chris!

Interesting. What is the URL you are trying to access?
I tryed access a directory containing images. Each image is accessed
correctly, but the whole directory don't, generating the HTTP 404 status.

Can you give us more details? 
I was using a AJAX request (using JQuery) to load the servlet content into
the page generated by the PHP script. 
I've moved the PHP script to an other machine (better configured) and now
the HTTP status is 200, but the response is blank... 
So, I've tested to use a IFRAME HTML tag instead the AJAX request and it
works... o_O 

Also, if you can enable the AccessLogValve and post the log
file generated by that.
I've never used the AccessLogValve, can you help me? :)

Where do you have Tomcat installed? Where is
your webapp application installed?
Tomcat is installed into my localhost and the PHP script is on an Apache
running into another host.

Finally, please post your webapp's
entire web.xml file and all Host entries from conf/server.xml so we
can see what mappings are being used.
There isn't nothing special in these files - both are with only standard
configuration. (bad behaviour, I know). It's because still in a developing
enviorment... But here we go:

--- web.xml ---
?xml version=1.0 encoding=UTF-8?
web-app version=2.5 xmlns=http://java.sun.com/xml/ns/javaee;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
servlet
servlet-nameservices/servlet-name
servlet-classservlets.services/servlet-class
/servlet
servlet-mapping
servlet-nameservices/servlet-name
url-pattern/services/url-pattern
/servlet-mapping
session-config
session-timeout
30
/session-timeout
/session-config
welcome-file-list
welcome-fileindex.jsp/welcome-file
/welcome-file-list
!-- Chave para usar os serviços do GoogleMaps API --
context-param
param-nameGoogleMapsKey/param-name
param-value
!-- localhost:8080/GISSIVAT --
   
ABQI5aeP66Pg4Yeg-ea2DVew2BSnFOuoISv6yQSBPQUmIaOLMwwm4hRyOR-W7GAD7BADGeiXMiGWHkluHg
!-- localhost:8081/GISSIVAT --
!--
ABQI5aeP66Pg4Yeg-ea2DVew2BTMN1__QsGLCmUyCwFFI1DaYXRtzBSxR0NrrwSzFJ2vR4R58z5Ng5ptIA
--
!-- www.gbd.ibilce.unesp.br:8080/GISSIVAT --
!--
ABQI5aeP66Pg4Yeg-ea2DVew2BRueMid9W0bKUwKJ5AVrvH4WeU3ixRznkBAg90f_dwEcgEij6skHDaM_g
--
/param-value
/context-param
!-- Ativa/Desativa o console de log para debug. --
context-param
param-nameDebugMode/param-name
param-valuetrue/param-value
/context-param
/web-app
-

- Host elements into server.xml --
 Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

!-- SingleSignOn valve, share authentication between web
applications
 Documentation at: /docs/config/valve.html --
!--
Valve className=org.apache.catalina.authenticator.SingleSignOn /
--

!-- Access log processes all example.
 Documentation at: /docs/config/valve.html --
!--
Valve className=org.apache.catalina.valves.AccessLogValve
directory=logs  
   prefix=localhost_access_log. suffix=.txt pattern=common
resolveHosts=false/
--

  /Host
---

Thanks for your help!
José



Christopher Schultz-2 wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 zé,
 
 On 2/17/2010 12:02 PM, zé wrote:
 I don't use any kind of authentication
 
 Ok.
 
 I believe that the directory indexes are disabled due the HTTP 404
 error returned when is tried listing.
 
 Interesting. What is the URL you are trying to access?
 
 It's just a servlet being accessed by a PHP script. The servers aren't in
 the same machine instead of I told before, sorry. May be this the cause?
 May
 the Tomcat refusing a connection requested by a script generated by
 another
 web server, due a security constraint?
 
 It's possible, but it wouldn't be this way by default: you'd have to
 configure your server in a strange way to accomplish that... I'd think
 you'd remember having done that :)
 
 Can you give us more details? The URL(s) you are trying to access would
 be helpful. Also, if you can enable the AccessLogValve and post the log
 file generated by that. Where do you have Tomcat installed? Where is
 your webapp application installed? Finally, please post your webapp's
 entire web.xml file and all Host entries from conf/server.xml so we
 can see what mappings are being used.
 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

Accessing a Tomcat webapp from a PHP webapp

2010-02-17 Thread

Hi!

I'm trying to access a Java web application, hosted on a Tomcat 6.0.20, from
a PHP application hosted on a Apache, located at the same machine. The PHP
app must request a Java app with few parameters and, the Java app must
respond with some data encoded in a JSON response. Perhaps I got a HTTP 403
error. How to fix this?

Thanks.
José
-- 
View this message in context: 
http://old.nabble.com/Accessing-a-Tomcat-webapp-from-a-PHP-webapp-tp27622126p27622126.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Accessing a Tomcat webapp from a PHP webapp

2010-02-17 Thread

Hi Chris!

Thanks for response! 
I don't use any kind of authentication and, I believe that the directory
indexes are disabled due the HTTP 404 error returned when is tried listing.
It's just a servlet being accessed by a PHP script. The servers aren't in
the same machine instead of I told before, sorry. May be this the cause? May
the Tomcat refusing a connection requested by a script generated by another
web server, due a security constraint?

Thanks.


Christopher Schultz-2 wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 zé,
 
 On 2/17/2010 6:06 AM, zé wrote:
 I'm trying to access a Java web application, hosted on a Tomcat 6.0.20,
 from
 a PHP application hosted on a Apache, located at the same machine. The
 PHP
 app must request a Java app with few parameters and, the Java app must
 respond with some data encoded in a JSON response. Perhaps I got a HTTP
 403
 error. How to fix this?
 
 HTTP 403 is Forbidden which suggests a resource that is not available
 to the current user. Are you using any kind of authentication? Are you
 trying to access a directory (instead of a file) and do you have
 directory indexes disabled?
 
 There are other reasons to get this error but these are the most common
 I can think of.
 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
 iEYEARECAAYFAkt8Ba4ACgkQ9CaO5/Lv0PBNRACgockj7LFsG9A/3CiobkxDchcs
 r+sAoIZcnWvLW8h8XCFkRWcDdiwblL4u
 =aXPj
 -END PGP SIGNATURE-
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Accessing-a-Tomcat-webapp-from-a-PHP-webapp-tp27622126p27626939.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org