0

I am trying to access a webservice from Flex. The webserivce is deployed on Glassfish 3.1 application server. Now, Flex needs a "crossdomain.xml" file at the root (top-level) of the server.

Here is the problem: I searched and found that the crossdomain file should be inside the docroot directory (c:\Glassfish3\Glassfish\domains\domain1\docroot). That is exactly the where I put it, and yet I get a 404 when I try to reach it.

I also tried putting it under applications but it didn't work.

What should I do?

Thank you, Ido

Ido Barash
  • 4,856
  • 11
  • 41
  • 78
  • it seems weird. If you type http://localhost:8080 does it show you the glassfish default page? (I assume your http port is 8080) – Alf Aug 22 '12 at 08:10
  • Yes, and if I try to access http://localhost:8080/crossdomain.xml I get the file. But I need this file to be accessible through IP address. – Ido Barash Aug 22 '12 at 09:03
  • If you try with h ttp://x.y.z.w do you get the default glassfish page? All your virtual servers have the same document root directory, or have you set a different document root directory for some of them? – Alf Aug 22 '12 at 12:32
  • Thank you for you help. I didn't do anything. I just installed glassfish and deployed a simple WAR through it's admin console - nothing more. I need to access the service with an IP address: h ttp://10.0.0.7/crossdomain.xml. – Ido Barash Aug 22 '12 at 13:50
  • as far as i can see you have glassfish that listen on 8080 but you want to access it from port 80. Did you set the firewall properly to redirect 80 to 8080? – Alf Aug 22 '12 at 15:02
  • Im sorry, I wrote it wrong. I want to access it like this: h ttp://10.0.0.7:8080/crossdomain.xml. It does not work. – Ido Barash Aug 22 '12 at 19:19
  • If you type h ttp://10.0.0.7:8080 what page do you see? Do you get a 404 error? – Alf Aug 23 '12 at 07:42

1 Answers1

0

OK, I found the answer, though I'm not sure that this is recommended.

Inside Glassfish admin console, under configurations --> server-config --> Network config --> http-listener-1.

I changed the address from "0.0.0.0" to the actual IP address of the server.

Now It works fine and I am getting access to crossdomain.xml, but as I said, I am not so sure that this action is recommended and won't make other errors.

Thank you.

Ido Barash
  • 4,856
  • 11
  • 41
  • 78
  • In this way you can't access the crossdomain.xml from http://localhost:8080/crossdomain.xml or any other address that point to your machine. Try it – Alf Aug 23 '12 at 14:39
  • Actualy, It is just a server so I don't mind if localhost is unreachable - It'll do for me. But still, Is there a way to solve this without making localhost unreachable? – Ido Barash Aug 24 '12 at 10:48
  • I think the issue is elsewhere. I use glassfish in a public server and with no specific configuration I'm able to see files in doocroot. On the other hand listener=0.0.0.0 manages all incoming requests, even those direct to 10.0.0.7 So I don't understand where the problem is. sorry. If you find out a solution in the future let us know – Alf Aug 24 '12 at 14:05