I have an application run on port 8082, config to working with spring security and keycloak (keycloak-springboot-2-adapter, spring-boot-starter-security, ..) And run the standalone keycloak server on port 8080.
Everything working well, but I meet an issue like that:
When I call a web-view by chrome to application 8082 without logging before, the request will be direct to login-page by keycloak manage (I'm using credentials), after I login success and go to the web-view have a button generate random string on the screen.
Stop here and then I restart the application on 8082 (server keycloak still running on 8080). when the application restarts success, I try to click on the button to make an AJAX request to application (api generate random string), but ajax response an error 401 Unauthorized and I don't see any error or exception on both application or keycloak server, just show on console of chrome like that
If I reload the page and click button again or open link error in console with new tab will return the random string I want. The important thing is I still logging and call another webview success.
If instead restart application 8082 I restart keycloak server and do everything as above again so the button still working well
I hope you can help me to find out the problem. Sorry for my English if you feel hard to understand my question because english isn't my native language.
Thank you very much for reading!
Related
For the past 2 months, I've been working on a project for my final year in uni. I've developed a web app in Java (Eclipse) and I used to test it by benefiting the Tomcat servlet containers. However, at the final stage now I want to deploy it on the university servers, but I am experiencing a strange error. I am not sure what I've haven't configured correctly on the uni server-side, that's why I will be thankful if anyone can direct me to resolutions to the problem.
The problem is that in Eclipse when I launch the app I am given a login form, which when I type my credentials let me in my account. However, on the university server-side after I generated a war that I placed in the webapps folder I restarted the Tomcat server, but I am getting HTTP Status 404 - /auction/login error after I submit my credentials.
The conclusion is that in Eclipse everything runs smoothly, however, on the university server-side I get HTTP Status 404 - /auction/login after I type my credentials in the login form
I've checked many solutions discussed in here, but nothing seemed to be similar to what I'm experiencing. I have suspicions I've missed to configure something on the university side, but I am not sure what.
I've got a web application running on a Windows Server 2008 machine. The app is running under spring tcserver.
When the server group setup the box they created a service account that I run the application under. They also created a admin account for me.
Within the app through java it's executing a web service.
Most of the time the app works fine. Every once in a while if I'm logged onto the server with the admin account I'll get a HTTP status code 403 as a response when using the app. After a while (sometimes 10 mins, sometimes 30 mins) it will start working again. Talking to other developers # work they're saying that it's an issue on the remote server that the web service resides on. I've sent the errors to the owner of the webservice to see if they see any issues from their side. Being that it's only occurred when I'm logged on to the server I'm skeptical whether it could be somehow using my profile instead. Through task manager I can see the app running under the correct account.
So long story short, is there a way to retrieve the actual account the app is running under. When I try System.getproperty("user.name") this just returns system. It returns that the times when I get the error & also when it's working properly. Is there another method of retrieving the user account.
Also let me know if you think I'm wasting my time & that you also think it's an issue on the remote server.
Any other suggestions please let me know.
Thanks
currently I'm starting to learn JavaEE. I created a simple donation-management-system which is secured by a login form. In the past I've just deployed my code to JBoss AS 7.1.1 and accessed it via browser.
However I would like to debug my application using Eclipse, as my application is starting to get bigger. I found several tutorials on the web and here at so but they didn't bring the expected result.
Here is what I did:
I edited the "standalone.conf.bat" and uncommented the line
set "JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
Then I created a new "Remote Java Application"-Configuration in Eclipse using localhost as hostname and 8787 as port.
Now my problem is as follows:
When I try to debug the application, the integrated eclipse browser opens up and show the expected web page, but when I enter the credentials and click "Login" I this exception:
HTTP Status 408 - The time allowed for the login process has been exceeded. If you wish to continue you must either click back twice and re-click the link you requested or close and re-open your browser
When I open my application in f.e. Firefox everything works fine.
Any ideas how to fix that? I'm already getting grey hair..
Edit: For the Login-Form I use the j_security_check
Could potentially be an issue with the integrated browser in Eclipse. Perhaps it's not handling session cookies properly.
To eliminate that possibility, I believe that in your general Eclipse preferences you can change the "Web Browser" setting to an external web browser (like Firefox) and see if you still have the issue.
So I just got internship at this company, and they would like me to complete a project(Web application) which someone else did but didn't finish two years ago. But the person didn't leave any documentation about this web app. Right now I would like to run and test this web app, but I couldn't get it started.
So it's running on WebSphere Application Server in IBM Rational Application Developer, the code is written in java and javascript. (I could start the server, but I don't know where to go and open up the web app)
Sorry I'm really new to this, questions might be stupid, appreciate any help:)
Do you know what port it's running on? You should be able to access it from a web browser on the host machine by going to
http://127.0.0.1:XX
where XX is the port in question. If you don't know, try 80 - that's the default HTTP port and it's worth a shot.
The default websphere web port is 9080, so try http://localhost:9080/
So it's running on WebSphere Application Server in IBM Rational Application Developer
and
I could start the server
Assuming you are able to start the server via RAD as I assume from the above and you are able to publish the app to WebSphere via RAD, you should then be able to right click on the project folder and choose "Run on Server." It will walk you through publishing the app to the server and will then launch a browser to the index page or URL via the context path and web project settings. You can have RAD use an embedded browser (default) or adjust it to launch an external browser via Preferences -> Web Browser.
To manually check where a webapp will be deployed you can either check application.xml (if you have one) OR you can right click on the project root folder in RAD, choose Properties, and Web Project Settings. The context path is in a field there.
Run-On-Server will show you both server/hostname (usually localhost), port, and application context path in one operation.
I have the following problem with my javafx application:
I'm using RMI to connect client app to server, and everything goes fine, until I run application in web browser or standalone mode. In this case, RMI doesn't work properly, but don't throw any exceptions. I cant send any message to server. Problem disappears when I run program in IDE or by clicking on jar file.
I think, that it can be connected with some browser privileges, and application launched in that context probably doesn't have access to network adapter.
Any ideas how to fix that?
EDIT: There was an exception that was invisible for me: java.net.SocketPermission. So as I thought, access to socked is denied. What is the solution to this problem?
An unsigned applet can only connect to the host it was loaded from. So, either change your topology or sign the applet.