Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
721 views
in Technique[技术] by (71.8m points)

firebird - GDS Exception. 335544421. connection rejected by remote interface

I am trying to connect to a firebird db using the jaybird jdbc driver. Firebird is running under ubuntu. I have created a simple database located under /tmp/hellofb.fdb (yeah not the best place, just for testing). I am running firebird superserver 3.0. The firebird service is up and running sudo service firbird3.0 status:

firebird3.0.service - Firebird Database Server ( SuperServer )
   Loaded: loaded (/lib/systemd/system/firebird3.0.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2017-10-25 22:40:53 CEST; 25min ago
  Process: 23411 ExecStart=/usr/sbin/fbguard -pidfile /run/firebird3.0/default.pid -daemon -forever (code=exited, status=0/SUCC
 Main PID: 23412 (fbguard)
    Tasks: 4 (limit: 4915)
   CGroup: /system.slice/firebird3.0.service
           ├─23412 /usr/sbin/fbguard -pidfile /run/firebird3.0/default.pid -daemon -forever
           └─23413 /usr/sbin/firebird

Okt 25 22:40:53 XPS-L322X systemd[1]: Starting Firebird Database Server ( SuperServer )...
Okt 25 22:40:53 XPS-L322X systemd[1]: Started Firebird Database Server ( SuperServer ).

My spring boot application.properties is given by:

spring.datasource.url:jdbc:firebirdsql://localhost:3050//tmp/hellofb.fdb
spring.datasource.driverClassName:org.firebirdsql.jdbc.FBDriver

However, when I try to connect to the database, I get the following exception:

org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544421. connection rejected by remote interface

I have tried all possible permutations given by the jaybird FAQ, I am running out of options. Any help would be greatly appreciated!

Note: I tried to connect to the databse using flamerobin and everything works just fine

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Given you haven't provided the information I asked for in the comments, I have to guess you are using Firebird 3 with Jaybird 2.2.x based on the described behavior.

The error connection rejected by remote interface can also occur under other conditions than described below.

Possible cause: wire protocol encryption required

Firebird 3 introduces a number of new security features that are enabled by default, but are not supported by Jaybird 2.2. To allow Jaybird 2.2 to connect to Firebird 3 you need to relax some of those settings.

To allow Jaybird 2.2.x to connect, you need to change the following settings in firebird.conf (and restart Firebird after changing the setting):

Relax the WireCrypt setting from its default of Required to Enabled:

WireCrypt = Enabled

Enable support for the legacy authentication protocol:

AuthServer = Srp, Legacy_Auth

You then need to make sure the user you want to use for connecting to Firebird is created with the legacy usermanager by enabling support for the legacy usermanager:

UserManager = Srp, Legacy_UserManager

Restart Firebird to apply these settings, and then - in Flamerobin - with a SYSDBA account (or user with role RDB$ADMIN), create the required user:

CREATE USER youruser PASSWORD 'yourpasw' USING PLUGIN Legacy_UserManager

Alternatively you could upgrade to Jaybird 3.0.4 or higher, which supports the Srp authentication protocol and wire protocol encryption.

These settings are described in more detail on our wiki in article Jaybird and Firebird 3. This information was absent from our FAQ, I have now added it under connection rejected by remote interface (335544421).

Possible cause: no user name or password

With Jaybird 3 or higher and Firebird 3 or higher, this error can be the result of not providing a username or password. The absence of a user name or password causes Jaybird to not try any authentication plugin. This results in Firebird rejecting the connection attempt as at least one authentication attempt should be done.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...