Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7443653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:21:54+00:00 2026-05-29T11:21:54+00:00

In a Java app, should it be possible open a stream on a URL

  • 0

In a Java app, should it be possible open a stream on a URL which has the same domain as the server running the app?

For example, I am running a Play! Framework app on:

http://www.my-domain.com/

And the URL I am trying to open an InputStream on is:

http://www.my-domain.com/public/zipfile.zip

When I try to access the inputstream via the URL openStream() method, the the app hangs (but still runs) and does not proceed any further (as if it has become locked).

The line of code causing the problem is as follows:

InputStream is = new BufferedInputStream(url.openStream(), 1024);

Extra Information

The code works as expected when accessing a URL from a different domain, eg:

http://www.different-domain.com/public/zipfile.zip

I have tried using 127.0.0.1, I have tried my network IP address and I have faked a real domain using hosts. None of these have worked, which leads me to believe this is a problem with a url being referenced from the same domain as the same as the app which is running it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:21:55+00:00Added an answer on May 29, 2026 at 11:21 am

    I’m not sure what you call ‘self referencing’ but if you mean that ‘server’ and ‘client’ are within the same application perhaps it’s threading issue (like the same thread is trying to read and write to the stream at the same time)? I would take a thread dump ‘jps’ then ‘jstack’ from command line while your application is running and see what thread is blocking on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a standalone Java app that has some licensing code that I want
I'm writing a java app using eclipse which references a few external jars and
I am working to create a Java based web app that also has ability
I'm writing a diagram editor in java. This app has the option to export
Possible Duplicate: Event listener in Java without app having focus? (Global keypress detection) I
I want to develop a java app that should run in Palm Z22. Will
Possible Duplicate: nullPointerException in multi column list I have following app which fetches data
I am building a Java web app, using the Play! Framework . I'm hosting
Context: MySQL server deployed with MysqldResource java class (Connector/MXJ lib). They app using mysql
Our Java app writes to MQ Series queues via a Weblogic JMS Message Bridge.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.