• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Strange error when uploading files

 
Greenhorn
Posts: 5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm working on a j2ee application.
While testing this application on local host, everything works fine.
Now that's deployed to the production, I found some strange errors, for example when I'm uploading a file using forms, this message appears: "The specified URL cannot be found. "
The error above happens only if I used the DNS (ex: www.domaineName.com), but when I'm connected to the application using the IP address everything works fine.
Just to make things clear, here is some examples:
when typing this address www.domain.com/Portal/reclamation
then choosing a file and submitting the form i got : The specified URL cannot be found.
but if I type the IP: xx.yy.zz.aa:8080/Portal/reclamation
I successfully upload any file I want.
Thanks for your help.
 
Ranch Hand
Posts: 326
Android Mac OS X Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

the adress www.domain.com/Portal/reclamation, is that hidden behind another web server such as Apache HTTPD and then forwarded to IP: xx.yy.zz.aa:8080/Portal/reclamation??

If not, then you should try calling www.domain.com:8080/Portal/reclamation to see that the DNS really points out the IP: xx.yy.zz.aa.

There is no such thing as automatic port resolving in a DNS.
 
Otmane Malih
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ove Lindström,
When I'm trying to connect to www.domain.com:8080/Portal i get this error: The page cannot be displayed.
The j2ee application is deployed in a tomcat server.
When you enter www.domain.com it's like you type xx.yy.zz.aa:8080/Portal
The problem exist only if you are connected to our server using DNS
 
Ove Lindström
Ranch Hand
Posts: 326
Android Mac OS X Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you use the command:



does it give you the same ip as xx.yy.zz.aa?

If not, then the domain is not setup as it should.

You might also have an entry in your host-file that overrides the DNS.

If you type http://xx.yy.zz.aa:8080/Portal does that to give you a "404: Page not found"?
 
Ove Lindström
Ranch Hand
Posts: 326
Android Mac OS X Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Otmane Malih wrote:
When you enter www.domain.com it's like you type xx.yy.zz.aa:8080/Portal



Well... No.... there are no such thing a port resolving in a DNS entry. You can do it if you have a proxy that receives all the calls on www.domain.com and forwards them to xx.yy.zz.aa:8080. In Apache HTTPD it is done using the mod_proxy. (http://httpd.apache.org/docs/2.2/mod/mod_proxy.html)

Edit: And, if you have a rule that states "forward everything that comes to www.domain.com to xx.yy.zz.aa:8080/Portal", then all your servlet mappings will be invalid if they are using /Portal.
 
Otmane Malih
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ove Lindström wrote:
If you use the command:



does it give you the same ip as xx.yy.zz.aa?



No, it give me an other different ip.

Ove Lindström wrote:
You might also have an entry in your host-file that overrides the DNS.



Where can I find the host-file?

Ove Lindström wrote:
If you type http://xx.yy.zz.aa:8080/Portal does that to give you a "404: Page not found"?



No, it take me to the home page of my application.

For now i think it's a problem of permission. I think when the application tries to write the file to the temp directory, an exception is thrown, so when it tries to log it to the log file an other exception is thrown since the application can't write to the log file

 
Otmane Malih
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ove Lindström wrote:

Otmane Malih wrote:
When you enter www.domain.com it's like you type xx.yy.zz.aa:8080/Portal



Well... No.... there are no such thing a port resolving in a DNS entry. You can do it if you have a proxy that receives all the calls on www.domain.com and forwards them to xx.yy.zz.aa:8080. In Apache HTTPD it is done using the mod_proxy. (http://httpd.apache.org/docs/2.2/mod/mod_proxy.html)



Well you were right. The xx.yy.zz.aa:8080/Portal works only on local network.
 
Ove Lindström
Ranch Hand
Posts: 326
Android Mac OS X Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Otmane Malih wrote:

For now i think it's a problem of permission. I think when the application tries to write the file to the temp directory, an exception is thrown, so when it tries to log it to the log file an other exception is thrown since the application can't write to the log file



No, I think it is because you don't really know your server setup...

I would think that when you enter http://www.domain.com/ it calls server with ip aa.aa.aa.aa that looks at the call and think "Lets forward this to xx.yy.zz.aa:8080/Portal".

The Tomcat at xx.yy.zz.aa then receives the call and tries to interpret it, but can't resolve any mapping that matches.

How does you servlet mapping look like?
 
Otmane Malih
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ove Lindström wrote:

Otmane Malih wrote:

For now i think it's a problem of permission. I think when the application tries to write the file to the temp directory, an exception is thrown, so when it tries to log it to the log file an other exception is thrown since the application can't write to the log file



No, I think it is because you don't really know your server setup...

I would think that when you enter http://www.domain.com/ it calls server with ip aa.aa.aa.aa that looks at the call and think "Lets forward this to xx.yy.zz.aa:8080/Portal".

The Tomcat at xx.yy.zz.aa then receives the call and tries to interpret it, but can't resolve any mapping that matches.

How does you servlet mapping look like?



I don't think that's the problem.
Let's say that I have this form:



You will notice that I have an input file here for uploads.
If I leave this input file blank, everything works fine, but when I'm trying to upload a file it crashes.
So the problem is a problem of permission. The application can't write the file to the server.
 
reply
    Bookmark Topic Watch Topic
  • New Topic