I have tried to create a Mysql connection between Server & Client System. My admin system ip address is (192.168.1.5). And I have a database "test". I downloaded the mysql-connector-java-5.1.29 and added with Java Buildpath.
The ScreenShot is shown below:
Whenever i tried to test the connection, it shows the error like this..
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1129)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:358)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2498)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2535)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2320)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:347)
at org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection.createConnection(JDBCConnection.java:214)
at org.eclipse.datatools.connectivity.DriverConnectionBase.internalCreateConnection(DriverConnectionBase.java:105)
at org.eclipse.datatools.connectivity.DriverConnectionBase.open(DriverConnectionBase.java:54)
at org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection.open(JDBCConnection.java:73)
at org.eclipse.datatools.enablement.internal.mysql.connection.JDBCMySQLConnectionFactory.createConnection(JDBCMySQLConnectionFactory.java:28)
at org.eclipse.datatools.connectivity.internal.ConnectionFactoryProvider.createConnection(ConnectionFactoryProvider.java:83)
at org.eclipse.datatools.connectivity.internal.ConnectionProfile.createConnection(ConnectionProfile.java:359)
at org.eclipse.datatools.connectivity.ui.PingJob.createTestConnection(PingJob.java:76)
at org.eclipse.datatools.connectivity.ui.PingJob.run(PingJob.java:59)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:308)
... 22 more
I have attached the Screenshot too..
Please help me to solve this issue.. Thanks in advace..
Change your url to : jdbc:mysql://192.168.1.5:3306/
And your database name to atrics instead of test.
HTH.
Check out http://itsolutionsforall.com/eclipse_sql.php
Updated Solution:
MySQL Connectivity between Client/Server Network using Eclipse:
•Download the Latest MySQL Software from the http://www.mysql.com/
•Install it to your Administrator System.
•Download the MySQL Connector from the following:
http://dev.mysql.com/downloads/connector/j/
(Only download the .zip or .rar file)
•Extract the file in a specific location. Example,
D:\eclipse\mysql-connector-java-5.1.29
•Now Login to your Admin System and Open “MySQL Command Line Client” from the program list.
•Enter the password. (Which is you provided during the installation of MYSQL. By default “root”
•If you get any kind of error means you need to check the password or reinstall the MySQL.
•If you succeeded means, you will get the mysql command in the next line like this
mysql>
• To view the current databases.
mysql>show databases;
•To use a new database,
MySQL>use database_name;
example:
mysql >use sample;
•To view the tables,
mysql>show tables;
Creating a New User:
• Use the following query to create a new user.
mysql>create user ‘JsAtrics’#’192.168.1.6’ identified by ’root’;
• To give grant privileges,
mysql>grant all privileges on . to ‘JsAtrics’#’192.168.1.6’;
• Once you have finalized the permissions that you want to set up for your new users, always be sure to reload all the privileges.
mysql>flush privileges;
mysql>select user();
mysql>select current_user();
mysql> select host,user,password,Grant_priv,Super_priv FROM mysql.user;
•A list of users will be open. Check your username and check the privileges as “Y”.
•If it is “N”, execute the following,
UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='JsAtrics';
FLUSH PRIVILEGES;
GRANT ALL ON *.* TO 'JsAtrics'#'192.168.1.6';
•Now again check the following:
mysql> select host,user,password,Grant_priv,Super_priv FROM mysql.user;
•If you see “Y” in privileges means that’s all. You finished.
Test Connection in Eclipse:
•Open Eclipse and Click WindowOpen Perspective other Database Development
•Now the Data Source Explorer open in the left or in the bottom.
•Right click on the Database Connections New MySQLNext
•Now a new window will open.
•In the Connection Window Click New Driver (Which was placed in the right of Driver list)
•Select “MySQL JDBC Driver 5.1” and move to the “Jar list” tab and click clear all. And Click “Add Jar” and update the new connector which you downloaded early and extracted in the location D:\eclipse\mysql-connector-java-5.1.29
•After adding the jar file, move to properties tab. In that
Connection url: jdbc:mysql://192.168.1.5:3306/sample
Database Name: sample
Driver Class: com.mysql.jdbc.Driver
Password: root
User ID : JsAtrics
•And Click “OK” Now Click “Save Password”.
•Now we can check the connection. So Click “Test Connection”
•It will displays a message “Ping Succeeded”.
•Click “Ok” and Click “Finish”.
•Now the database connected to your client system..!!!
Note: If you found any errors in this, read the above steps once again and follow the above steps once again.
Related
i want to establish a connection between my Java Program and my Database created with MariaDB on a different server (not localhost). Everything is fine with the ServerIP, Databasename, User and Password.
But i get this error:
Exception in thread "main" java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=MY_SERVER_IP)(port=3306)(type=master) : Connection timed out: connect
at org.mariadb.jdbc.internal.SQLExceptionMapper.get(SQLExceptionMapper.java:136)
at org.mariadb.jdbc.internal.SQLExceptionMapper.throwException(SQLExceptionMapper.java:106)
at org.mariadb.jdbc.Driver.connect(Driver.java:106)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at MySQL_Tester.LoadDriver.main(LoadDriver.java:11)
Caused by: org.mariadb.jdbc.internal.common.QueryException: Could not connect to address= (host=MY_SERVER_IP)(port=3306)(type=master) : Connection timed out: connect
at org.mariadb.jdbc.internal.mysql.MySQLProtocol.connectWithoutProxy(MySQLProtocol.java:629)
at org.mariadb.jdbc.internal.common.Utils.retrieveProxy(Utils.java:541)
at org.mariadb.jdbc.Driver.connect(Driver.java:101)
... 3 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at org.mariadb.jdbc.internal.mysql.MySQLProtocol.connect(MySQLProtocol.java:288)
at org.mariadb.jdbc.internal.mysql.MySQLProtocol.connectWithoutProxy(MySQLProtocol.java:624)
... 5 more
My Code:
package MySQL_Tester;
import java.sql.*;
public class LoadDriver {
static Connection sqlHandler = null;
public static void main(String[]args) throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException {
Class.forName("org.mariadb.jdbc.Driver").newInstance();
sqlHandler=DriverManager.getConnection("jdbc:mysql://MY_SERVER_IP/DATABASENAME?user=USERNAME&password=PASSWORD");
}}
All the versions i use:
MariaDB: 10.1.44
MariaDB-Java-Connector: mariadb-java-client.1.2.0.jar
Java Version: Version 8 Update 161
Eclipse Version: 2019-03 (4.11.0)
You must update your connection string with the real values.
Thank you for your answer davidbuzatto but the problem was easier to solve than i expected.
Here is a Guide how i solved this problem for me:
Step 1: Check your MySQL-Config File with (nano /etc/mysql/my.cnf in Ubuntu)
replacing bind-adress: 172.0.0.1 with bind-adress: 0.0.0.0
When this doesnt help... For me it didnt help....
Step 2: Check the Firewall Settings on your Server and allow the access to the MySQL Server
When this also doesnt help... For me it didnt....
Step 3: Grant Access to your MySQL-Database
Use this MySQL-Query: GRANT ALL ON yourDatabasename.* to yourUser#yourIP identified by 'passwordOfTheUser';
I want to connect Derby Embedded Database to my Swing Application to be exported as executable file.
I've performed following steps.
I've created Embedded Database from Service Tab.
I've created table in our Embedded Database
create table student(id int, name varchar(50), class varchar(10));
insert into student values(1,'Akshay','FYCS'),(2,'Narayan','SYCS');
select * from student;
I've created Swing Project and Added Libraries of Derby Driver
Then I coded for retrieving value from Database
package embeddeddb;
import java.sql.*;
public class EmbeddedDB
{
public static void main(String[] args) throws SQLException, ClassNotFoundException
{
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
Connection con=DriverManager.getConnection("jdbc:derby:myDB","username","password");
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("select NAME from STUDENT where ID=1");
rs.next();
System.out.println(rs.getString(1));
}
}
I got Error like this,
run:
Exception in thread "main" java.sql.SQLException: Database 'myDB' not found.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleDBNotFound(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at embeddeddb.EmbeddedDB.main(EmbeddedDB.java:11)
Caused by: ERROR XJ004: Database 'myDB' not found.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
... 14 more
C:\Users\Dell 7559\AppData\Local\NetBeans\Cache\10.0\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\Dell 7559\AppData\Local\NetBeans\Cache\10.0\executor-snippets\run.xml:94: Java returned: 1
BUILD FAILED (total time: 0 seconds)
I know the problem is with Connection String.
Connection con=DriverManager.getConnection("jdbc:derby:myDB","username","password");
How to solve it? Please Help.
mydb is a relative path, relative to Derby's system directory, which defaults to the current working directory of your application if you use Derby Embedded. If you use the URL in Netbeans, it is relative to NetBeans current working directory, if you use it from your own application, it is relative to that applications current working directory.
In other words, the database used by jdbc:derby:myDB is application specific (or more correct: current working directory specific). In NetBeans your database exists, in your application it doesn't.
You will either need to use an absolute path to your database, or make sure the database is created in an appropriate location (eg the current working directory of your application) or you need to configure Derby to use a specific directory by setting the system property derby.system.home.
See also the Derby documentation Connecting to databases and more specifically Connecting to databases within the system and Defining the system directory
Hi I've just installed Pentaho Data Integration v. 5.01 and I'm trying to connect to a database. However, I'm unable to test the connection as I get the error (pasted below).
I have JDK 1.7 installed on the system as well, however I can't seem to locate ojdbc14.jar anywhere.
I downloaded that and pasted it in pentaho's \lib folder but I still get the same error.
Any solutions to this problem?
Error connecting to database [test] : org.pentaho.di.core.exception.KettleDatabaseException:
Error occured while trying to connect to the database
Driver class 'oracle.jdbc.driver.OracleDriver' could not be found, make sure the 'Oracle' driver (jar file) is installed.
oracle.jdbc.driver.OracleDriver
org.pentaho.di.core.exception.KettleDatabaseException:
Error occured while trying to connect to the database
Driver class 'oracle.jdbc.driver.OracleDriver' could not be found, make sure the 'Oracle' driver (jar file) is installed.
oracle.jdbc.driver.OracleDriver
at org.pentaho.di.core.database.Database.normalConnect(Database.java:415)
at org.pentaho.di.core.database.Database.connect(Database.java:353)
at org.pentaho.di.core.database.Database.connect(Database.java:306)
at org.pentaho.di.core.database.Database.connect(Database.java:294)
at org.pentaho.di.core.database.DatabaseFactory.getConnectionTestReport(DatabaseFactory.java:84)
at org.pentaho.di.core.database.DatabaseMeta.testConnection(DatabaseMeta.java:2459)
at org.pentaho.ui.database.event.DataHandler.testDatabaseConnection(DataHandler.java:541)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:329)
at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:139)
at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:123)
at org.pentaho.ui.xul.swt.tags.SwtButton.access$500(SwtButton.java:26)
at org.pentaho.ui.xul.swt.tags.SwtButton$4.widgetSelected(SwtButton.java:121)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
at org.eclipse.jface.window.Window.open(Window.java:796)
at org.pentaho.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:375)
at org.pentaho.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:301)
at org.pentaho.di.ui.core.database.dialog.XulDatabaseDialog.open(XulDatabaseDialog.java:115)
at org.pentaho.di.ui.core.database.dialog.DatabaseDialog.open(DatabaseDialog.java:62)
at org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate.newConnection(SpoonDBDelegate.java:493)
at org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate.newConnection(SpoonDBDelegate.java:478)
at org.pentaho.di.ui.spoon.Spoon.doubleClickedInTree(Spoon.java:2885)
at org.pentaho.di.ui.spoon.Spoon.access$2300(Spoon.java:332)
at org.pentaho.di.ui.spoon.Spoon$27.widgetDefaultSelected(Spoon.java:5657)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:1227)
at org.pentaho.di.ui.spoon.Spoon.waitForDispose(Spoon.java:7368)
at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:8673)
at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:625)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.pentaho.commons.launcher.Launcher.main(Launcher.java:134)
Caused by: org.pentaho.di.core.exception.KettleDatabaseException:
Driver class 'oracle.jdbc.driver.OracleDriver' could not be found, make sure the 'Oracle' driver (jar file) is installed.
oracle.jdbc.driver.OracleDriver
at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:474)
at org.pentaho.di.core.database.Database.normalConnect(Database.java:399)
... 45 more
Caused by: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:467)
... 46 more
Try placing the odbc jar file (eg: ojdbc5-11.1.0.7.0.jar) inside the "data-integration/lib" directory of your installation. Don't forget to restart Pentaho to make it work.
Here's my setup. I had this problem and managed to fix it as follows.
I have SQLDeveloper running on my machine and it works OK, even under VPN. However, I was running Spoon and noticed that it wouldn't work if I use VPN.
I have tried to put Oracle JDBC drivers shipped with SQLDeveloper into Pentaho. That didn't work.
However, I noticed that one big difference between SQLDeveloper and Spoon is that they use different
Java runtimes and JDBC Oracle drivers! In particular, my version of SQLDeveloper is running on 32-bit JRE version 1.6.0_11, whereas my system-wide JDK is 64-bit version 1.7.0_03.
I have found the JDBC drivers that SQLDeveloper uses and used them as a replacement for the driver that is shipped with Spoon -- no change.
Then I retargeted Spoon to use the Java runtime used by SQLDeveloper.
I set two environment variables: PENTAHO_JAVA and PENTAHO_JAVA_HOME -- and it works OK now!
For reference, here are my envvars:
PENTAHO_JAVA=C:\opt\sqldeveloper\jdk\jre\bin\java.exe
PENTAHO_JAVA_HOME=c:\opt\sqldeveloper\jdk\jre\
If that is relevant, I am on Windows 7 x64.
1. First go to Oracle Site:
http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html
2. Download 1 file: ojdbc6.jar
(2,739,670 bytes) - (SHA1 Checksum: a483a046eee2f404d864a6ff5b09dc0e1be3fe6c)
Classes for use with JDK 1.6. It contains the JDBC driver classes except classes for NLS support in Oracle Object and Collection types.
3. Copy it into Pentaho folder: C:\Program Files\Pentaho\data-integration\lib
4. Close Spoon if it is open and re-open again. (transferred from the comment of #mishkin - thanks him)
That works on my Windows 7 X64 Pro with latest Pentaho 5.3 Stable.
In Pentaho version 6.0 put the driver (ojdbc6.jar) in: "PentahoInstallation"\design-tools\data-integration\lib and restart the Data Integration ide.
See, guys we doesn't need all these stuff. We need to paste oracle jdbc driver (ojdbc6.jar) in the following location.
C:\Program Files\pentaho\design-tools\report-designer\lib\jdbc
C:\Program Files\pentaho\design-tools\data-integration\lib
C:\Program Files\pentaho\design-tools\aggregation-designer\lib
C:\Program Files\pentaho\design-tools\schema-workbench\lib
try to put ojdbc driver in libext/JDBC in your PDI path (location)
Try putting the jar on tomcat library folder, then restart Pentaho.
Should be here .../biserver-ce-6.0.0.0-353/biserver-ce/tomcat/lib
There are already some drivers here.
I could solve this issue by selecting Oralce Native connection > Hostname as Ip address of DB server > instead of SN00XXXX I had used DB00XXX name for the Database name.
I hope this works for such issues with oracle connectivity.
In my case, the error was in Report designer
The fix: only copy ojdbc14.jar to
\prd-ce-5.0.1-stable\report-designer\lib
and restart the tool.
I have a java program Read which reads file from an URL looks like this:
file://myhost/system.log
On Windows I use this command:
java Read "file://myhost/system.log"
and it works flawlessly.
But on Linux when I try to use the same command it gives me this error:
Exception in thread "main" java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.ftp.impl.FtpClient.doConnect(Unknown Source)
at sun.net.ftp.impl.FtpClient.tryConnect(Unknown Source)
at sun.net.ftp.impl.FtpClient.connect(Unknown Source)
at sun.net.ftp.impl.FtpClient.connect(Unknown Source)
at sun.net.www.protocol.ftp.FtpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at read.readInput(ReadHTML.java:53)
at read.readInput.main(ReadHTML.java:76)
Any ideas?
UPDATE:
I think I found the problem:
myhost is not mounted on the Linux machine so that it cannot connect to it by using file://...
Thanks for all the answers, guys!
This is because your program (by virtue of using a file URL on a Linux OS) is attempting to open an FTP connection to the host specified in the URL. The establishment of the FTP connection fails.
This could be due to a variety of issues. Try connecting with ftp directly:
ftp myhost
And I'm guessing it'd fail as well. Do you have an FTP server installed & running?
One of the possible reason can be that hosts.allow does not have entry of your machine.
I suspect you just need a third /. The correct syntax for file uris is file://[path] but [path] should begin with a /.
I am trying to run my Java application in debug mode in Eclipse, but it's not working. It was fine until yesterday when I could properly debug my application. I am able to run my application on the server ( Oracle OC4J Standalone Server 10.1.3) properly. Only while debugging, it continues for a long time and then shows a server time out error. I tried increasing the Server time out, but was of no use.
I also tried removing the Server and creating it again and restarting Eclipse. Is there something I could do about this?
Edit: Strack trace on trying to Run it as Remote Java Application
Exception Stack tace:
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at org.eclipse.jdi.internal.connect.SocketTransportService$2.run(SocketTransportService.java:136)
at java.lang.Thread.run(Unknown Source)
There is an issue with OC4J's debug mode enabling. Sometimes I've noticed that after enabling it (via opmn.xml) it will work for a while then stop working. What I've found to actually work all the time is editing the /bin/oc4j.cmd file and adding the line:
set JVMARGS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=9009,suspend=y,server=y
then start a Remote debugging session from Eclipse on the port 9009