Link to home
Start Free TrialLog in
Avatar of OTSSolutions
OTSSolutionsFlag for India

asked on

JDBC JayBird Firebird connection failed

Hi,

I am facing an issue. I am using JDBC for connecting to firebird DB.
in some PCs works fine and some failed.  I am getting the following error.

org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544583. SQLDA missing or
incorrect version, or incorrect number/type of variables

The above exception getting when I am trying to connect.

If I reinstalls the firebird, works fine. if I restarts the Pc, again fails to connect.( this is not on all Pcs.)


Thanks and Regards,
VIJESH V.NAIR
Avatar of Thlware
Thlware

Are you trying to connect to InterBase  ?
What is your daba server and version ?
what is the version of your jaybird?
Post the code snipped where you trying to connect
Avatar of OTSSolutions

ASKER

HI
Thanks Thlware,

Answers as follows.

I am connecting to Firebird 2.1.
I am using jaybird-full-2.1.6.jar

Code Snippet as follows. Please note I am using a property file.


Thanks and Regards
VIJESH V.NAIR

dbUrl = new DbConnection().backlashReplace(pro.getProperty("dbUrl"));
 userName = pro.getProperty("userName");
password = pro.getProperty("password");


Class.forName("org.firebirdsql.jdbc.FBDriver");
driver  =  java.sql.DriverManager.getDriver(dbUrl);
conn = DriverManager.getConnection(dbUrl,userName,password);

Open in new window

Can you post the form of your dbUrl as well
dbUrl=jdbc:firebirdsql:192.168.1.22:C:\\Program Files\\2LS\\GRIP\\data\\grip.fdb?sql_dialect=1
ASKER CERTIFIED SOLUTION
Avatar of Thlware
Thlware

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I tried. but failed.

org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544344. I/O error for fil
e CreateFile (open) "C:/Program Files/2LS/GRIP/data/grip"
Error while trying to open file
null
Reason: I/O error for file CreateFile (open) "C:/Program Files/2LS/GRIP/data/gri
p"
Error while trying to open file
null
        at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:122
)
        at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:185)
        at com._2LS.seevee.DbConnection.getConnection(DbConnection.java:102)
        at com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:75)
        at com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)
at org.firebirdsql.gds.GDSException: I/O error for file CreateFile (open) "C:/Pr
ogram Files/2LS/GRIP/data/grip"
Error while trying to open file
null
        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.readStatusVector(Ab
stractJavaGDSImpl.java:2169)
        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.receiveResponse(Abs
tractJavaGDSImpl.java:2119)
        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.internalAttachDatab
ase(AbstractJavaGDSImpl.java:434)
        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscAttachDatabase(A
bstractJavaGDSImpl.java:369)
        at org.firebirdsql.jca.FBManagedConnection.<init>(FBManagedConnection.ja
va:86)
        at org.firebirdsql.jca.FBManagedConnectionFactory.createManagedConnectio
n(FBManagedConnectionFactory.java:477)
        at org.firebirdsql.jca.FBStandAloneConnectionManager.allocateConnection(
FBStandAloneConnectionManager.java:69)
        at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:119
)
        at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:185)
        at com._2LS.seevee.DbConnection.getConnection(DbConnection.java:102)
        at com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:75)
        at com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)
Nov 23, 2010 7:05:57 PM com._2LS.seevee.DbConnection getConnection
INFO: org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:122)
org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)
java.sql.DriverManager.getConnection(DriverManager.java:582)
java.sql.DriverManager.getConnection(DriverManager.java:185)
com._2LS.seevee.DbConnection.getConnection(DbConnection.java:102)
com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:75)
com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)

Nov 23, 2010 7:05:57 PM com._2LS.seevee.SearchCVFiles Search
INFO:  indexpath : C:\Program Files\2LS\GRIP\spool\ndx
Searching for: contents:sql
Nov 23, 2010 7:05:57 PM com._2LS.seevee.SearchCVFiles Search
INFO: com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:103)
com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)

Nov 23, 2010 7:05:57 PM com._2LS.seevee.SearchCVFiles Search
INFO: Connection closed
message===>successindexpath:C:\Program Files\2LS\GRIP\spool\ndx
   4 total matching documents
Exception:java.lang.NullPointerException
Connection closed

Open in new window

I think you getting somewhere cause I see the error is different

check on your url if you have put  the ext  .fdb

then check if file is in the exact file structure

C:/Program Files/2LS/GRIP/data/grip.fdb

Thanks.
I checked the path. C:/Program Files/2LS/GRIP/data/grip.fdb is exists.

I am attaching the log when tried to
bUrl=jdbc:firebirdsql:192.168.1.22/3080:C:/Program Files/2LS/GRIP/data/grip.fdb?sql_dialect=3

Log attached
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544583. SQLDA missing or
incorrect version, or incorrect number/type of variables
Reason: SQLDA missing or incorrect version, or incorrect number/type of variable
s
        at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:122
)
        at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:185)
        at com._2LS.seevee.DbConnection.getConnection(DbConnection.java:102)
        at com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:75)
        at com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)
at org.firebirdsql.gds.GDSException: SQLDA missing or incorrect version, or inco
rrect number/type of variables
        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.parseAttachDatabase
Info(AbstractJavaGDSImpl.java:624)
        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.internalAttachDatab
ase(AbstractJavaGDSImpl.java:441)
        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscAttachDatabase(A
bstractJavaGDSImpl.java:369)
        at org.firebirdsql.jca.FBManagedConnection.<init>(FBManagedConnection.ja
va:86)
        at org.firebirdsql.jca.FBManagedConnectionFactory.createManagedConnectio
n(FBManagedConnectionFactory.java:477)
        at org.firebirdsql.jca.FBStandAloneConnectionManager.allocateConnection(
FBStandAloneConnectionManager.java:69)
        at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:119
)
        at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:185)
        at com._2LS.seevee.DbConnection.getConnection(DbConnection.java:102)
        at com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:75)
        at com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)
Nov 23, 2010 7:49:57 PM com._2LS.seevee.DbConnection getConnection
INFO: org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:122)
org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)
java.sql.DriverManager.getConnection(DriverManager.java:582)
java.sql.DriverManager.getConnection(DriverManager.java:185)
com._2LS.seevee.DbConnection.getConnection(DbConnection.java:102)
com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:75)
com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)

Nov 23, 2010 7:49:57 PM com._2LS.seevee.SearchCVFiles Search
INFO:  indexpath : C:\Program Files\2LS\GRIP\spool\ndx
Searching for: contents:sql
Nov 23, 2010 7:49:58 PM com._2LS.seevee.SearchCVFiles Search
INFO: com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:103)
com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)

Nov 23, 2010 7:49:58 PM com._2LS.seevee.SearchCVFiles Search
INFO: Connection closed
message===>successindexpath:C:\Program Files\2LS\GRIP\spool\ndx
   4 total matching documents
Exception:java.lang.NullPointerException
Connection closed

Open in new window

note // after  jdbc:firebirdsql:
should work if your file exist and check access right on the folder and file

dbUrl=jdbc:firebirdsql://192.168.1.22/3050:C:/Program Files/2LS/GRIP/data/grip.fdb?sql_dialect=1

Open in new window

I tried, again failed.
log attached
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544721. Unable to complet
e network request to host "3050".
Failed to locate host machine.
The specified name was not found in the hosts file or Domain Name Services.
Reason: Unable to complete network request to host "3050".
Failed to locate host machine.
The specified name was not found in the hosts file or Domain Name Services.
        at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:122
)
        at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:185)
        at com._2LS.seevee.DbConnection.getConnection(DbConnection.java:102)
        at com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:75)
        at com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)
at org.firebirdsql.gds.GDSException: Unable to complete network request to host
"3050".
Failed to locate host machine.
The specified name was not found in the hosts file or Domain Name Services.
        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.readStatusVector(Ab
stractJavaGDSImpl.java:2169)
        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.receiveResponse(Abs
tractJavaGDSImpl.java:2119)
        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.internalAttachDatab
ase(AbstractJavaGDSImpl.java:434)
        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscAttachDatabase(A
bstractJavaGDSImpl.java:369)
        at org.firebirdsql.jca.FBManagedConnection.<init>(FBManagedConnection.ja
va:86)
        at org.firebirdsql.jca.FBManagedConnectionFactory.createManagedConnectio
n(FBManagedConnectionFactory.java:477)
        at org.firebirdsql.jca.FBStandAloneConnectionManager.allocateConnection(
FBStandAloneConnectionManager.java:69)
        at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:119
)
        at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:185)
        at com._2LS.seevee.DbConnection.getConnection(DbConnection.java:102)
        at com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:75)
        at com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)
Nov 23, 2010 8:41:35 PM com._2LS.seevee.DbConnection getConnection
INFO: org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:122)
org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)
java.sql.DriverManager.getConnection(DriverManager.java:582)
java.sql.DriverManager.getConnection(DriverManager.java:185)
com._2LS.seevee.DbConnection.getConnection(DbConnection.java:102)
com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:75)
com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)

Nov 23, 2010 8:41:35 PM com._2LS.seevee.SearchCVFiles Search
INFO:  indexpath : C:/Program Files/2LS/GRIP/spool/ndx
Searching for: contents:sql
Nov 23, 2010 8:41:36 PM com._2LS.seevee.SearchCVFiles Search
INFO: com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:103)
com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)

Open in new window

Your DB is running on port 3050 or 3080
I tested on Both Ports, Both are Failed.
you  said
if I restarts the Pc, again fails to connect
Can you check if your firebird service is set to start automatically when you restart your machine

Open Control Panel -> Services (NT) or Control Panel -> Administrative Tools -> Services (2000, XP)

Is this a remote machine ? if yes can you ping the ip if not try use localhost

Thanks for comments.


 Firebird Guardian Used. Its starttype is already automatic.

I want it to work locally and through network.


But before making it work on the network is it working locally ?
Is that IP same machine where the code is.
Can we troubleshoot locally first then once we got it right try over network.

Do you have that IP  defined in your host file ?
But before making it work on the network is it working locally ?
  NO
Is that IP same machine where the code is.
  yes
Do you have that IP  defined in your host file ?
 yes
Can you post your host file content ?
dbUrl=jdbc:firebirdsql:localhost/3050:C:/Program Files/data/MYDB.fdb
userName=sysdba
password=masterkey
writeFlag=1
No not your properties file but hosts file    (you can block out you ips)

C:\WINDOWS\system32\drivers\etc\hosts

if not in that directory search it in


C:\WINDOWS\


 
Sorry,
I am attaching

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost
127.0.0.1         localhost
127.0.0.1         mpa.one.microsoft.com     #for XP/2003/2007
127.0.0.1         sls.microsoft.com             #for Vista
127.0.0.1         genuine.microsoft.com
The ip you trying to use on dbUrl is not in this file.
Can you try your connection using the local host ip 127.0.0.1
I tried 127.0.0.1/3050
Failed.
Can you send me your code one java file that makes connection and included libraries jaybird and related libs
 (Not db will use my own)
Thanks ThlWare,
 I resolved it. I had interbase installed in the PC. This made some mismatch with jdbc driver. When I uninstalled Interbase, its Working Well.

Thank you for giving the attention to this Question.

Thanks and Regards,
VIjesh V.Nair
The Developer comments is fine. Didn't made the complete resolution to the issue.
Hi OTSSolutions glad you got resolution.
Funny I was reading our troubleshooting conversations and you seem to have missed the first question on my first comment
 
Are you trying to connect to InterBase  ?