[CLOSED][Oracle] Invalid connection string format

Note: please leave bug reports and feature requests on GitHub

[CLOSED][Oracle] Invalid connection string format

Postby TheBlackReverand » Fri May 13, 2016 1:31 pm

Hello,

First, sorry for my bad English :roll:

I use DBEaver 3.6.7 Enterprise and that work fine with basic connection but with TNSNames I have problem.

When I test my connection I have this message
IO Error: Invalid connection string format, a valid format is: "host:port:sid"
oracle.net.ns.NetException: Invalid connection string format, a valid format is: "host:port:sid"



In my research I see it's not a DBEaver problem but an interpretation of Java or Oracle.
But I use Toad et SqlDevelopper to and they can use my TNSNames.

Maybe a wrong configuration in my part?

I have 3 native client on my computer
    => 12.1.0.2.0
    => 11.2.0.3.0
    => 11.2.0.3.0 instantClient

I use drivers 11gR2
    => ~\11gR2 jdbc drivers\ojdbc6.jar
    => ~\11gR2 jdbc drivers\orai18n.jar

I try URL Template but nothing work
    => jdbc:oracle:thin:@{host}:{port}:{database}
    => jdbc:oracle:thin:@host:port:DBMSname
    => (empty)


If I use jdbc:oracle:thin:@{host}:{port}:{database} and replace value in Custom Connection that works...


in dbeaver-debug.log I have this
Code: Select all
2016-05-13 15:25:14.593 - Connect with 'jdbc:oracle:thin:@MAG.world' (oracle_thin-154aa49c984-49cd34e9499346da)
2016-05-13 15:25:14.594 - Connection failed (oracle_thin-154aa49c984-49cd34e9499346da)
2016-05-13 15:25:14.596 - org.jkiss.dbeaver.model.exec.DBCConnectException: IO Error: Invalid connection string format, a valid format is: "host:port:sid"
org.jkiss.dbeaver.model.exec.DBCConnectException: IO Error: Invalid connection string format, a valid format is: "host:port:sid"
   at org.jkiss.dbeaver.model.impl.jdbc.JDBCDataSource.openConnection(JDBCDataSource.java:173)
   at org.jkiss.dbeaver.ext.oracle.model.OracleDataSource.openConnection(OracleDataSource.java:113)
   at org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext.connect(JDBCExecutionContext.java:73)
   at org.jkiss.dbeaver.model.impl.jdbc.JDBCDataSource.<init>(JDBCDataSource.java:94)
   at org.jkiss.dbeaver.ext.oracle.model.OracleDataSource.<init>(OracleDataSource.java:83)
   at org.jkiss.dbeaver.ext.oracle.OracleDataSourceProvider.openDataSource(OracleDataSourceProvider.java:127)
   at org.jkiss.dbeaver.registry.DataSourceDescriptor.connect(DataSourceDescriptor.java:608)
   at org.jkiss.dbeaver.runtime.jobs.ConnectJob.run(ConnectJob.java:74)
   at org.jkiss.dbeaver.ui.dialogs.connection.ConnectionWizard$ConnectionTester.run(ConnectionWizard.java:227)
   at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:99)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.sql.SQLRecoverableException: IO Error: Invalid connection string format, a valid format is: "host:port:sid"
   at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:489)
   at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
   at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:254)
   at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
   at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
   at org.jkiss.dbeaver.model.impl.jdbc.JDBCDataSource.openConnection(JDBCDataSource.java:159)
   ... 10 more
Caused by: oracle.net.ns.NetException: Invalid connection string format, a valid format is: "host:port:sid"
   at oracle.net.resolver.AddrResolution.resolveSimple(AddrResolution.java:498)
   at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:437)
   at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:693)
   at oracle.net.ns.NSProtocol.connect(NSProtocol.java:251)
   at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1140)
   at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:340)
   ... 15 more


Looks that parts in log => jdbc:oracle:thin:@MAG.world
MAG.world is my TNSNames entry


with the Custom connection I have this log
Code: Select all
2016-05-13 15:27:54.828 - Connect with 'jdbc:oracle:thin:@COMPUTER_NAME:1526:MAG' (oracle_thin-154aa49c984-49cd34e9499346da)
2016-05-13 15:27:54.944 - Connected (oracle_thin-154aa49c984-49cd34e9499346da)


MAG is my SID.

Do you have any idea?

Many people want use it in my professional structure but TNSNames is obligatory... :(


Thanks a lot



Edit:
I juste found another JDBC URL.
I take the value in my TNSNames and I use it in Connection Custom and that work fine
Code: Select all
jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (COMMUNITY = tcp.world) (PROTOCOL = TCP) (Host = COMPUTER_NAME) (Port = 1526) ) ) (CONNECT_DATA = (SID = MAG) ) )
Last edited by TheBlackReverand on Mon May 23, 2016 8:46 am, edited 1 time in total.
TheBlackReverand
 
Posts: 15
Joined: Mon Mar 21, 2016 4:47 pm

Re: [Oracle] Invalid connection string format

Postby Serge » Fri May 13, 2016 6:14 pm

This seems to be the same problem: https://github.com/serge-rider/dbeaver/issues/355
Thanks for additional info
Serge
 
Posts: 1526
Joined: Sat Feb 26, 2011 8:24 pm
Location: SPb

Re: [Oracle] Invalid connection string format

Postby TheBlackReverand » Tue May 17, 2016 8:52 am

Great!! Thanks a lot, EA version works great with standard TNSNames.

Just have a limitation because I have # in my TNSNames and that don't work for now

MAG.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
# (Host = BASE_1)
(Host = BASE_2)
# (Host = BASE_3)
(Port = 1526) )
)
(CONNECT_DATA =
(SID = MAG)
)
)


I use this because application use MAG.WORLD and sometimes I need to switch environnement with no-rebuilt


I have
IO Error: NL Exception was generated
oracle.net.ns.NetException: NL Exception was generated


In dbeaver-debug.log I have this. I think it's a one line bug. comment are included in the line

016-05-17 10:53:32.602 - Connect with 'jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (COMMUNITY = tcp.world) (PROTOCOL = TCP)# (Host = BASE_1) (Host = BASE_2)# (Host = BASE_3)(Port = 1526) ) ) (CONNECT_DATA = (SID = MAG) ) )' (oracle_thin-154bdddb552-3b5dc10729063bc7)
2016-05-17 10:53:32.604 - Connection failed (oracle_thin-154bdddb552-3b5dc10729063bc7)
2016-05-17 10:53:32.605 - org.jkiss.dbeaver.model.exec.DBCConnectException: IO Error: NL Exception was generated
org.jkiss.dbeaver.model.exec.DBCConnectException: IO Error: NL Exception was generated
at org.jkiss.dbeaver.model.impl.jdbc.JDBCDataSource.openConnection(JDBCDataSource.java:173)
at org.jkiss.dbeaver.ext.oracle.model.OracleDataSource.openConnection(OracleDataSource.java:113)
at org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext.connect(JDBCExecutionContext.java:73)
at org.jkiss.dbeaver.model.impl.jdbc.JDBCDataSource.<init>(JDBCDataSource.java:94)
at org.jkiss.dbeaver.ext.oracle.model.OracleDataSource.<init>(OracleDataSource.java:83)
at org.jkiss.dbeaver.ext.oracle.OracleDataSourceProvider.openDataSource(OracleDataSourceProvider.java:145)
at org.jkiss.dbeaver.registry.DataSourceDescriptor.connect(DataSourceDescriptor.java:608)
at org.jkiss.dbeaver.runtime.jobs.ConnectJob.run(ConnectJob.java:74)
at org.jkiss.dbeaver.ui.dialogs.connection.ConnectionWizard$ConnectionTester.run(ConnectionWizard.java:227)
at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:103)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.sql.SQLRecoverableException: IO Error: NL Exception was generated
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:489)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:254)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
at org.jkiss.dbeaver.model.impl.jdbc.JDBCDataSource.openConnection(JDBCDataSource.java:159)
... 10 more
Caused by: oracle.net.ns.NetException: NL Exception was generated
at oracle.net.resolver.AddrResolution.resolveAddrTree(AddrResolution.java:648)
at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:443)
at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:693)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:251)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1140)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:340)
... 15 more




Comment header of TNSNames section doesn't work to
# BASE_1 LABEL
BASE_1.WORLD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = TCP.WORLD)
(PROTOCOL = TCP)
(HOST = BASE_1)
(PORT = 1526)))
(CONNECT_DATA = (SID = CTB84))
)

# BASE_2 LABEL
BASE_2.WORLD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = TCP.WORLD)
(PROTOCOL = TCP)
(HOST = BASE_2)
(PORT = 1526)))
(CONNECT_DATA = (SID = CTB84))
)
TheBlackReverand
 
Posts: 15
Joined: Mon Mar 21, 2016 4:47 pm

Re: [Oracle] Invalid connection string format

Postby Serge » Tue May 17, 2016 11:38 am

Yeah, it's a bug in TNS parser.
Thanks for report.
Serge
 
Posts: 1526
Joined: Sat Feb 26, 2011 8:24 pm
Location: SPb

Re: [Oracle] Invalid connection string format

Postby TheBlackReverand » Mon May 23, 2016 8:46 am

Works fine with 3.6.8.

Thanks
TheBlackReverand
 
Posts: 15
Joined: Mon Mar 21, 2016 4:47 pm


Return to Support



Who is online

Users browsing this forum: No registered users and 28 guests