On my company network we run Remedy 7.64 and want to create Incidents automatically. I setup the development environment using IntelliJ IDEA and the ARAPI-files for my server version. We have no administration access to the server to change anything over there.
The error says
ERROR (90): Can't connect to AR System-Server; Connection refused:
connect <host>.
Mysteriously i can connect to the Web-Interface using Chrome, i can ping the host, i can access it via the Driver & the official Remedy Client and the java tool can get the source code of the web-interface of it as well, so it obviously is possible to connect to the host but the difficulty is somewhere else.
This is my simple demo file
import com.bmc.arsys.api.*;
public static void main(String [ ] args)
{
ARServerUser ctx = new ARServerUser();
ctx.setServer("<server>");
ctx.setUser("<user>");
ctx.setPassword("<pass>");
try {
ctx.login();
System.out.println("works");
} catch (ARException e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
}
This is the list of dependancies
1.8 (java version "1.8.0_65")
[Module source ]
groovy-2.4.5
log4j-1.2.14.jar
arapi7604_build002.jar
You have to provide port number in which AR server is listening on. "ERROR (90): Can't connect to AR System-Server; Connection refused: connect ." means that the server refused to connect as you haven't mentioned the port number to connect. Normally people use 37000 as the AR server port number, but you have to check with your Remedy Admin to know this.
I just came across the same error. My issue was that I tried to connect using the full url as <server> ("https://..."). Using just the name of the server worked.
Related
I am trying to write a Java desktop app that can connect to my database made with Microsoft SQL Server Manager to allow me to view and update it. But, I am having trouble getting the connection to work. I've read through a bunch of tutorials and threads here on Stack Exchange of similar problems, and I'm not sure what I'm doing wrong.
The server is called "SQLEXPRESS" using Windows authentication. I downloaded the JDBC driver found here: https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774 installed it in NetBeans by going to "Services-Databases(right click)-New Connection-Add", but I also added it as a library in my project.
When I try this code, I get the exception that the TCP/IP connection failed either because the server isn't running or port 1433 is locked:
try{
String
URL="jdbc:sqlserver://sqlexpress:1433;DatabaseName=GreenhouseManagement";
Connection conn = DriverManager.getConnection(URL,"","");
System.out.println("connected");
}catch(Exception e){
System.out.println("Oops\n"+e);
}
What do I need to change to fix this?
You might need to reconfigure your connection string into this format.
jdbc:microsoft:sqlserver://HOST:1433;DatabaseName=DATABASE
HOST in this case is most likely to be "localhost" since you are connecting on a local machine.
DATABASE will be the name of your database
Reference: http://alvinalexander.com/java/jdbc-connection-string-mysql-postgresql-sqlserver
I'm working on an openshift tomcat project by using mysql as backend I am trying to connect database and it is not connecting and shows error message "Communications link failure Last packet sent to the server was 0 ms ago" I have connected database using this code
try{
Class.forName("com.mysql.jdbc.Driver");
}catch(ClassNotFoundException ex){
//return(ex.getMessage());
}
con = DriverManager.getConnection(MYSQL_DATABASE_HOST,MYSQL_USERNAME,MYSQL_PASSWORD);
} catch (Exception ex) {
return(ex.getMessage());
}
return "success";
I've provided the database url by hardcoding the database IP and port,when I print System.getenv("OPENSHIFT_MYSQL_DB_HOST"); I'm getting null value. please tell me anyone the error
the problem you are facing occurs when your java code is unable to connect to MySQL server. There is one more way, check if your MySQL is up and running. You can get your MySQL server's ip by
rhc port-forward -a <mysql_gear_name>
You can then explicitly give that IP in DriverManager.getConnection
From the command line, run rhc port-forward to access databases or internal ports directly.
Eg :
rhc port-forward -a <name of the gear including mysql db>
I trying to conncet to my MySQL Database hosted in a virtual machine, but it doesn't work
for me.
Here is my setup:
Newest Ubuntu Server witch Apache2 mysql installed and is working
Database "feedback" with the table "test" set up and filled with test data
The network adapter is bridged. The IP of the server is (if I type in ifconfig) 10.0.0.1 and the IP of my pc is 10.0.0.4.
Port 3306 was manually opened. The jar mysql connector java 5.1.21-bin.jar is a Referenced Libary
Here is the Java Code:
import java.sql.*;
public class Main {
public static void main(String[] args) {
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
System.out.println("Sucess");
Connection con = DriverManager.getConnection("jdbc:mysql://10.0.0.1/feedback","root","myrootpassword");
con.setReadOnly(true);
} catch (Exception e) {
System.err.print("NO CONNECTION");
}
}
}
I hope that someone could help with this, because I'm working on this problem for a while.
Thanks
Just two ideas:
Is MySQL configured to listen on all addresses and not only local ones ? What's the value of the bind-address configuration directive ? 0.0.0.0 means "listen on all interfaces", while 127.0.0.1 means "listen on the localhost interface, for access from this host only".
Maybe you can extract some details about the issue in your catch statement ?
Hope this helps !
If i am correctly understand a question ,To connect VM database,then check for the following steps
1.jdbc:mysql://10.0.0.1/feedback.
2.Make sure there is no firewall blocking the access to port 3306.
3.make sure the user you are connecting with is allowed to connect from this particular hostname.
When trying to connect with a remote Oracle database via JDBC I receive the following exception:
java.sql.SQLRecoverableException: IO-fout: The Network Adapter could not establish the connection
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:419)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:536)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:228)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
at java.sql.DriverManager.getConnection(DriverManager.java:322)
at java.sql.DriverManager.getConnection(DriverManager.java:358)
The following is my set-up:
Database: Oracle 10g Release 2 Standard Edition
JDBC library: ojdbc6.jar
JDBC driver: oracle.jdbc.driver.OracleDriver
JDBC URL: jdbc:oracle:thin:#9.2.2.2:1521:ORCL where ORCL is database's SID
JDBC User/pwd: Correct username / password
Strange about this problem is that the connection works just fine when I work from work. When I try to connect however from home via an AT&T VPN connection, it doesn't work.
I have confirmed that I can reach the IP address and have also telnetted the ip on port 1521, which works just fine. Connecting to the datasource from a local WebLogic Application Server also works alright. Furthermore, when trying to connect to the database via sqldeveloper I can also reach the database.
I need to reach the database however from a standalone application (for testing purposes). Does anyone have an idea why this problem occurs? And whether there are alternatives for connecting to a remote Oracle Database, alternatives which sqldeveloper and weblogic perhaps use?
Here's an excerpt of the code attempting to connect with the database:
public static void main(String args[]) throws ClassNotFoundException, SQLException {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:#9.2.2.2:1521:ORCL", "user", "pwd");
}
When a client connects to an Oracle server, it first connnects to the Oracle listener service. It often redirects the client to another port. So the client has to open another connection on a different port, which is blocked by the firewall.
So you might in fact have encountered a firewall problem due to Oracle port redirection. It should be possible to diagnose it with a network monitor on the client machine or with the firewall management software on the firewall.
If it is on a Linux box, I would suggest you add the database IP name and IP resolution to the /etc/hosts.
I have the same error and when we do the above, it works fine.
Take a look at this post on Java Ranch:
http://www.coderanch.com/t/300287/JDBC/java/Io-Exception-Network-Adapter-could
"The solution for my "Io exception: The Network Adapter could not establish the connection" exception was to replace the IP of the database server to the DNS name."
I had similar problem before. But this was resolved when I started using hostname instead of IP address in my connection string.
hiho,
i intend to develop just a litte network application, something like a chat. so i downloaded xampp for windows and installed it (also as service), mysql included. well, i started the apache (and mysql) as service and just wrote the short line in java:
try {
Socket sock = new Socket("127.0.0.1", 21);
System.out.println("connection established");
} catch ( UnknownHostException e ) {
System.out.println("Can't find host.");
} catch ( IOException e ) {
System.out.println("Error connecting to host. " + e.toString());
}
but directly i got the answer:
Error connecting to host. java.net.ConnectException: Connection refused: connect
the server is runnin'. the localhost is accessible on the browser.
did i forgot something? any ideas?
In your java code you're trying to connect to port 21 (ftp). Don't know what you want to do, but perhaps you should try port 80 (http).
Did you download and install the Tomcat add-on for XAMPP? It's not part of the default install.
After it's extracted into the XAMPP folder you have to run first setup_xampp.bat and then tomcat_start.bat.
Also, Tomcat in XAMPP will use the 8080 port by default.