I'm building CRUD interface for ArangoDB as Java service.
My ArangoDB service has dynamic IP, but static URL. Thus I want to specify URL instead of IP and port.
But when I set it in arangodb.properties file I get the following exception:
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.netcracker.unm.activeinventory.services.ArangoService]: Constructor threw exception; nested exception is com.arangodb.ArangoDBException: Could not load property-value arangodb.hosts=127.0.0.1:8538,127.0.0.1:8529,http://arangodb-nms-infra.sdnoshm05.com:443. Expected format ip:port,ip:port,...
How can I do it?
Update
I have figured out that I have to connect to https server. How can I specify it in my arangodb.properties file?
I have tried to connect to the servers endpoint using unix wget command. It doesn't connect if I dont specify https protocol. And so my ArangoDB client doesn't, if there is plain ip:port. I just get java.net.ConnectException: Connection refused exception.
I don't believe you can do that since the service needs to bind to an IP address. Usually, when dealing with dynamic IP addresses your ISP is changing the IP but internally you can configure your IP address statically. Bind to your internal static IP and configure your router to port forward to that internal IP address. Many routers support dynamic DNS through various providers that will map the domain to your changing IP address. I hope that helps.
Update: Setting up HTTPS should be pretty easily done, just follow the docs here: https://docs.arangodb.com/3.2/Manual/Administration/Configuration/SSL.html
Related
I don't know why this is happening error
I'm trying to simply connect my database to jdbc
In the url jdbc:mysel://localhost:test you set the host as localhost and the port as test
There is no such port called test, you need to provide a port number.
Most likely you are using the default port for mysql, so you might need to provide one at all.
I have Rundeck installed on an instance that is on a VPC in Amazon AWS. This isn't the default VPC - it is one I have created with different subnets and security groups. My issue is this: Rundeck runs and acts fine except when sending email. I get this error:
2014-10-01 18:05:42,758 [quartzScheduler_Worker-2] ERROR grails.app.services.rundeck.services.NotificationService - Error sending notification email to email#domain.com for Execution 109: Mail server connection failed; nested exception is javax.mail.MessagingException: 501 5.0.0 HELO requires domain address . Failed messages: javax.mail.MessagingException: 501 5.0.0 HELO requires domain address
This is only when the instance is created in my VPC. It is in a public subnet that accesses the internet directly via an internet gateway so it has no Nat instance between it. ACLs are default for this subnet, and the security group is set to allow all outbound.
The weird thing is this works in the Amazon default VPC, but not in my created one. They are setup the exact same. Only difference is IP range obviously - both have public IPs and the security groups are setup the same. Sendmail can send email, but Java appears to not be able to.
Any ideas on what the issue is? I've tried a few things and I am stumped.
I couldn't get it to work with Amazon SES, but I did get it to work with Gmail smtp by using the Rundeck groovy config located here: https://gist.github.com/gschueler/5707281
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".
resolving a hostname to an IP address is rather easy in Java by using the InetAddress class like this:
InetAddress address = InetAddress.getByName("www.example.com");
But this method uses the DNS server which is used by the running system.
Is there any way to specify the DNS server that should be used for resolving?
If you use Sun Java, you can use this code:
//Override system DNS setting with Google free DNS server
System.setProperty("sun.net.spi.nameservice.nameservers", "8.8.8.8");
System.setProperty("sun.net.spi.nameservice.provider.1", "dns,sun");
See this blog post: How to set a custom DNS server with Java System properties for more details.
I am running a Java web application using tomcat to send generated reports via emails to the users.
I am able to send the emails but after few hours the server stops sending emails, with the following error.
javax.mail.MessagingException: Unknown SMTP host: mail.mydomain.co.uk;
nested exception is:
java.net.UnknownHostException: mail.mydomain.co.uk
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1970)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:642)
at javax.mail.Service.connect(Service.java:317)
at javax.mail.Service.connect(Service.java:176)
at javax.mail.Service.connect(Service.java:125)
at javax.mail.Transport.send0(Transport.java:194)
at javax.mail.Transport.send(Transport.java:124)
at com.turnkey.email.SendEmail.sendMail(SendEmail.java:119)
at com.turnkey.thread.CommunicationThread.run(CommunicationThread.java:399)
Caused by: java.net.UnknownHostException: mail.mydomain.co.uk
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:195)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:319)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:233)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1938)
... 8 more
After some time the server starts sending emails again.
Can anyone tell me what could be the problem.
And how do I solve this problem?
Thanks
This looks like a failure in your name service. The JDK isn't able to look up the host name to find its internet address. Since this works sometimes and not others, it looks like an intermittent failure of the name service. The name service failure could be due to some failure in your local operating system, or it could be due to some network failure communicating with your DNS server or other name service server, or it could be a failure in that DNS server or name service server itself. Determining the exact cause of the failure will require some debugging. Note that the JDK caches the results of name server lookups for some time so you'll need to factor that into your debugging.
Also make sure there is no space at the end of smtp hostname eg. mail.google.comSPACEHERE . Surprisingly this happened to me and finally after removing this space there was no complain about smtp host . Email was successfully sent
Set for host the ip address of the domain name instead of the domain name.
use nslookup mail.mydomain.co.uk on cmd to find the ip address.
It worked for me.
Specially for AIX or Linux OS environment,
We need to add the hostname in the etc/hosts file.. to sole this.
Windows operating system , this may work on Windows system as there is no strict security check however AIX or Linux must add host name to etc/hosts file in order for ping the SMTP server.
avoid doing this may lead Unknown host issue