Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I cannot connect to a IPv6 server through HttpsURLConnection, getInputStream() returns null when I sent a request.
I didn't find any useful information: Android developer guide said HttpURLConnection can transparent support IPv6, but didn't mention HttpsURLConnection can support IPv6 or not. Does anyone have experience about this?
Update - 1:
On server side I found a error log when connection failed:
[error] Hostname [xxxx:xxxx:x:xx::xxx] provided via SNI and
hostname xxxx:xxxx:x:xx::xxx provided via HTTP are different
To connect to same IPv6 Apache server (version 2.2.27), Apache HttpClient works without any problem, but HttpsURLConnection doesn't. So it may not be a server side issue. Does anyone see this error before when using HttpsURLConnection?
Java supports IPv6, and has done for many years. HttpsURLConnection supports whatever Java supports.
You might also have noticed that HttpsURLConnection extends HttpURLConnection.
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 months ago.
Improve this question
I created two spring boot application one serving APIs and another acting as a HTTP proxy to that API (which internally uses CloseableHttpClient to bounce on the another url, fetches the data adds cors and pushes back the response.)
I deployed both into GCP cloud run but when I run it locally it works but not when using the cloud run endpoint.
It resulting in error like this -
upstream connect error or disconnect/reset before headers. reset reason: protocol error
What it is I am messing up ?
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
I have a very simple RMI server/client that works fine on the same machine. I'm trying to now execute the server on one machine and client on another both are on the same network. I've set the property to network ip using:
System.getProperty("java.rmi.server.hostname", "192.168.x.x");
& disabled firewall on both machines but connection still fails.
Client code uses this to connect to server (the server uses createRegistry on 8888):
Registry registry = LocateRegistry.getRegistry("192.168.x.x",8888);
ITest stub = (ITest) registry.lookup("ITest");
However the execption being caught seems to show an IP not the same as the one given eg 192.168.x.x vs 169.254.x.x:
Client exception: java.rmi.ConnectionException: Connection refused to host: 169.254.x.x; nested exception is ...
As dave_thompson_085 said I was calling System.getProperty which was a typo that I completely missed. Calling System.setProperty corrects this problem and now works.
There could be couple of reasons for this exception:
You have not started your rmiregistry in background.
You are trying to connect to the wrong port number.
Your firewall maybe blocking the connections.
Also make sure to check and disable any routers firewall restriction if any.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am developing an app where I should be able to remotely access laptop camera's using my app. But how do I write a socket programming as I am new to android, I don't know if by just using Java socket programming is it possible to access laptop cameras
There is a Socket class and a ServerSocket class in Java. You give both of the clients sockets and have them connect to the ServerSocket. If you're remotely connecting to the laptop from your Android device from a different network, then you may need to set up a server to host the ServerSocket part on. Google App Engine can help with that. It also lets you deploy your Java app directly to the app engine via a plugin in Eclipse.
You need to write a simple tcp server-client application, as soon as both devices are on the same network is going to work like charm...
on the Android:
The client which must search and find the server (in this case the pc)
on the PC:
a server client waiting for the android (actually waiting for a tcp client)
As soon as both connect, send some formatted string that will be predefined by you and interpreted by the server as Commands...
with those commands try to turn-off/on the camera, disconnect the app, take a picture etc etc
if you look properly you will find 10000 of examples of java tcp server clients...
good luck!
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Ok, so I am a little bit stuck with this problem and could really use some guidance...I have a java application that I have written in Java on eclipse and I also have a database created in mySQL on the same computer, now say I want to copy my java application to another computer on a different network but connect to that same database on my original computer on mySQL, what modifications do I have to make so I can connect to my database on different networks and areas? any guidance or help would be greatly appreciated. Beginner in Java and Databases so please try to explain thoroughly.
Since you use a pure JDBC application you simply need to set the JDBC URL to match with your requirements knowing that the format is something like:
jdbc:mysql://[host1][:port1][,[host2][:port2]]...[/[database]][?propertyName1=propertyValue1[&propertyName2=propertyValue2]...]
So assuming that your hostname is foo and the port is 3306, the first thing that you will have to do is to change the current JDBC URL of your application for something like jdbc:mysql://foo:3306 (assuming that your host is accessible from the other computer and you configured your firewall to accept connections on the port of your database).
More info here
For the second part of the job to do (assuming that you have a static IP address), you will need to configure a port forwarding rule at your internet modem level such that any access to your public IP on a given port will be directly routed to the local IP address of your machine on the mysql port. Check the documentation of your modem to know how to do such thing. Here is more info about port forwarding
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I have jdbc and hibernate working just fine on my local web app, but when I deploy it to a remote server, I get this error:
HTTP Status 401 - Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Could not open connection
The server is on the same machine as the mysql database. Could that be a problem? If not, what could it be?
It is no problem to have application and database on one machine. Check the connection string of the database for IP/hostname, user name, password and database port in related configuration file or JNDI resource. There is more information needed to put specific answer. The driver may also be the problem here.