Problems connecting MongoDB with authentication

Four Stars

Problems connecting MongoDB with authentication

I have a component 'tMongoDBConnection" with the following parameters:

 

Server "127.0.0.1"
Database "test"
Port 30158

The problem is that I need authentication. Talend raises this error: The method authenticate(String, char[]) in the type DB is not applicable for the arguments (String, String).

 

The parameters are:

Username: "test"
Password: "test"

 

What I could do? Thanks.

 

Four Stars

Connecting MongoDB with authentication "Connection Refused"

Hello,

 

I'm trying to connect to MongoDB with the component tMongoDBConnection. The problem is that I need authentication because I have username and password on DB, but it says the following:

Detail Message: The method authenticate(String, char[]) in the type DB is not applicable for the arguments (String, String)

The parameters are the following:

Server: "192.168.56.101"
Database: "test"
Port: 30158

Username: "test"
Password: "test"

If I try to connect without authentication the following error is raised:

Caused by: java.io.IOException: couldn't connect to [/192.168.56.101:30158] bc:java.net.ConnectException: Connection refused: connect

I don't know how to connect to the mongoDB, can anyone help me?

 

Thanks.

Community Manager

Re: Connecting MongoDB with authentication "Connection Refused"

Hello
By default, the port is 27017, just check if you have changed it to 30158. In addition, try to execute the telnet command from CMD to see if you able to to ping to the server with the port.
...>telnet 192.168.56.101 30158
About the error "The method authenticate(String, char[]) in the type DB is not applicable for the arguments (String, String)", it seems you did't input the password value, click the ... button near the Password field to input the password value.

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Two Stars

Re: Connecting MongoDB with authentication "Connection Refused"

To solve this in Talend ESB set password like this: "YourPass".toCharArray()

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch