Access Denied (authentication_falied) Issue in Java web application [closed] - java

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 4 days ago.
Improve this question
Your credentials could not be authenticated: "Credentials are missing.
You will not be permitted access until your credentials can be
verified.
This is typically caused by an incorrect username and/or password; but
could also be caused by network problems.
Above error is intermittently appearing in a Java web application hosted in Tomcat on a Windows 10 machine that communicates to a internet server through a proxy server. The proxy server requires authentication which is passed by the application code. The Windows machine is in an Active Directory domain.
The surprising part is that whenever such error occurs logging into the Windows machine resolves the issue.
Looking for a permanent solution where the application runs without having to log into the Windows machine.
I tried keeping the machine power mode active, so that it doesn't go into sleep mode, but still issue not resolved.

Related

HTTP Proxy - upstream connect error or disconnect/reset before headers. reset reason: protocol error [closed]

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 ?

Why do we get HTTP 503 service unavailable? [closed]

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 2 years ago.
Improve this question
I know that http 503 means that the "server is unavailable" as mentioned in mozilla docs. But, if the server is unavailable or offline, then how is that server able to return a 503 response ? Is the client getting timed out and assuming a 503?
UPDATE -
I learned that there is often "middle man" such as a load balancer which gives the 503 when the backend is down. So, what if there is no middle man? Would you get an http 408 in that case?
PS - Java and Python tags are added only to get more attention from developers who are likely to know the answer to this question.
50x errors are for application errors. This means that if you have for example Apache2 or Nginx web server and that server communicate with backend application which is currently unavailable (down, starting, freezed, etc) you get this 503 error.
YOU -----> Apache2/Nginx web server ------> app backend = you will get 200
response.
YOU -----> Apache2/Nginx web server --XXX--> app backend = you will get 503
error.

RMI Remote connection fails [closed]

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.

Java Linux ServerSocket does not do much [closed]

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 9 years ago.
Improve this question
I am running Linux Fedora 18 and all I want is my java code to print hello linux in a web browser I type in http:// myhostname. I have use my code in windows and it work find. However in Linux I use port 80 got a permission denied. So I then I use port 8080 no permission denied but it didn't work. Using port 80 the client dose accept and I can send and receive information only on machine the seversocket not on a different even if it is connect ton the network.Last thing I have made policy file to allow port 80 to work but it was useless and I still not sure I to set a policy file in my code. Sorry if this long question but I have been researching this issue for a month not so please don't tell me to google it. So I guess my main question why can't the serverSocket broadcast anything out of the linux machine and how to fix it?
Thank you
On Linux, you need to be root to use system ports from 0 to 1023. Tomcat has ways of opening port 80 without leaving the process running as root, but they are a bit complicated to discuss here. Linux provides ways to give permissions to access these port, but usually I just use port 8080.
If you use port 8080, you need to redirect this using your router to port 80, or you will have to specify that you want to connect to port 8080. Your browser only assumes port 80. e.g. http://yourhost:8080/
To connect to this server from another machine, your firewalls have to be setup so you connect to it all. A firewall is designed to stop traffic you haven't explicitly allowed. This means you may need to open your firewall on your server, and you network router and put the your public IP address (not your internal one) in the hosts file of your client.
I did a yum update and the code work just fine now.

JDBC not working on production server [closed]

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.

Categories