How to use spring rest template with SSL enabled domain - java

I have a java web application hosted on aws ec2 linux instance. I bought a domain from amazon's Route 53 service and enabled the SSL from ACM.
I am able to access the application using domain name e.g https://www.example.com.
The problem comes when inside the application there is an API call using Spring Rest Template. Getting the following error.
There was an unexpected error (type=Internal Server Error, status=500).
I/O error on GET request for "https://www.example.com/portal-war/api/get/something/id22222":
Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)
If I access the same api https://www.example.com/portal-war/api/get/something/id22222 outside the application (e.g. in browser or postman) , its working perfectly.
Please help me out to fix this issue!

Related

Allow remote login to LDAP server

I installed LDAP server on my virtual machine(centOS) running on windows, now I want to access it from windows
So how do I enable remote access to LDAP server.
I tried installing 389 Directory Server (which is actually meant for fedora), on some forum I heard its a easy GUI to do the command line jobs easily, but I did not find the option to enable the remote login or any ip filters.
Note:
I am trying to use Java to login the LDAP server for authentication and authorization, for that I am using unboundid api
You can suggest which api should I use, I am just a beginner.
Update:
my java code
LDAPConnection ldap = new LDAPConnection("http://xxx.xx.xx.xxx", 9830);
error
an error occurred while attempting to connect to server http://xxx.xx.xx.xxx:9830: java.io.IOException: An error occurred while attempting to establish a connection to server http://xxx.xx.xx.xxx:9830: java.net.UnknownHostException: http://xxx.xx.xx.xxx')
I also tried ldap://xxx.xx.xx.xxx instead of http://xxx.xx.xx.xxx
Don't specify the server address as a URL. Just specify the address as either an IP address or resolvable name. So instead of "http://xxx.xx.xx.xxx" just use "xxx.xx.xx.xxx".

HTTP status 500 for wso2 carbon application

I tried this tutorial and after entering with admin as in step 8, I got the error as follows:
HTTP Status 500 - Exception while making the decision : org.apache.axis2.AxisFault: Connection refused: connect
org.wso2.carbon.identity.entitlement.filter.exception.EntitlementFilterException: Exception while making the decision : org.apache.axis2.AxisFault: Connection refused: connect
org.wso2.carbon.identity.entitlement.filter.EntitlementFilter.doFilter(EntitlementFilter.java:191)
1)
Is your WSO2 Server running against loclahost only or is it just running on his IP adres? Looks like you are not able to contact the server through this IP and/or port number.
2)
Are there any proxies defined? If so, try to disable them.

Air application - faultCode:Client.Error.MessageSend

I have an AIR application that uses remote objects to communicate with the server. It works perfectly when the application connects to my localhost server. But as soon as I change the url to point to a remote test server, I get the following error:
fault.message: faultCode:Client.Error.MessageSend faultString:'Send failed'
faultDetail:'Channel.Connect.Failed error NetConnection.Call.Failed: HTTP:
Failed: url: 'http://remoteserver:80/app/messagebroker/amf''
fault.name: Error
fault.faultcode: Client.Error.MessageSend
fault.faultstring: Send failed
fault.faultdetail: Channel.Connect.Failed error NetConnection.Call.Failed: HTTP:
Failed: url: 'http://remoteserver:80/app/messagebroker/amf'
What might cause this error? My local server is a glassfish 3.1, the remote one uses apache for load balancing in front of a glassfish.
When I navigate in the browser to the url of amf channel, it displays a blank page (which is fine).
I have also noticed that when I use tcp/ip monitor from eclipse, (I change the url to point to some port on localhost; tcp/ip monitor forwards the request to the remote server), the application works fine, no error occurs. Still, it appends a jsessionid to the url.
How can I resolve this issue?

Cannot connect to MSSQL due to Login-based server access validation failed with an infrastructure error

I have an application (web application) written in Java and database on MS SQL. Both, Tomcat (with application) and database server are on my localhost.
I'm trying run an application but in Java logs I have:
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Login failed for user 'some-user'.)
Caused by: java.sql.SQLException: Login failed for user 'some-user'.
In database logs error looks like:
Logon Error: 18456, Severity: 14, State: 12.
Logon Login failed for user 'some-user'. Reason: Login-based server access validation failed with an infrastructure error. Check for previous errors. [CLIENT: 127.0.0.1]
When I'm tying login to server via Microsoft SQL Server Managment Studio (choosing "SQL Server Authentication") everything is OK.
But with the same credentials my Java application cannot login.
Additional informations:
My connection url is jdbc:jtds:sqlserver://127.0.0.1:1434/some-db
some-user has a public server role and two database roles membership for some-db (db_datawriter and public). Default schema for some-user is db_datawriter.
Additionally some-user has some-db as a default database.
Why are you connecting to port 1434? The default port is TCP 1433 for the database instance; UDP 1434 is used for the browser service, which I suspect is only supported by Microsoft client libraries (I could be wrong, though).

Could not access HTTP invoker remote service

i'm working in a kofax application connected with oracle database.
i found an error as
ERROR markview.viewer.MvViewer
org.springframework.remoting.RemoteAccessException: Could not access HTTP invoker remote service at [ias9:opmn:ormi://uhmvtst.uhhs.com:6003:markview_tst4/mvas/remote/EnterpriseService]; nested exception is java.net.MalformedURLException: unknown protocol: ias9
at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.convertHttpInvokerAccessException(HttpInvokerClientInterceptor.java:211)
i'm getting as connection failed to open. could any one help me to solve this issue.
The Spring HTTP invoker is for HTTP. It's not going to work with that URL you gave it (ias9:opmn:ormi://uhmvtst.uhhs.com:6003:markview_tst4/mvas/remote/EnterpriseService)

Categories

Resources