Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect Atoti with MongoDB #729

Open
kiimot opened this issue Dec 15, 2022 · 6 comments
Open

Connect Atoti with MongoDB #729

kiimot opened this issue Dec 15, 2022 · 6 comments
Assignees
Labels
🐛 bug unexpected or wrong behavior

Comments

@kiimot
Copy link

kiimot commented Dec 15, 2022

Hi! We are trying to connect a MongoDB database with Atoti but it doesn't work

We have carried out tests based on MongoDB and from other environments if we can connect (MongoDBCompass, DBeaver, Python locally, Python in Jupyter Lab...). But from Atoti we can't. We are using version 6.0.3 of MongoDB.

The imported drivers have also been checked and are correct. We have obtained them from the following page: https://unityjdbc.com/mongojdbc/mongo_jdbc_free.php

A MongoDB database has been created on another machine but it replicates the same error.

And finally, it has also been tested to make connections with Oracle and MySQL that have been successful.

Steps to reproduce

image

Actual Result

This is the error:
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.qfs.content.service.IContentService]: Factory method 'contentService' threw exception; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

I attach logs in case they help.
server.log

Expected Result

With this code snippet, we hope to be able to connect to the MongoDB database and extract data to feed the Atoti cube.

Environment

  • atoti: 0.7.2
  • Python: 3.10.8
  • Operating System: Windows 10 Enterprise x64

Logs (if relevant)

@kiimot kiimot added the 🐛 bug unexpected or wrong behavior label Dec 15, 2022
@tibdex
Copy link
Member

tibdex commented Dec 15, 2022

The java.lang.NoClassDefFoundError: jdk/net/ExtendedSocketOptions is a clue that some classes you need may be missing in https://pypi.org/project/jdk4py which is what atoti uses to execute its underlying Java process. Can you try installing another JDK 17 on your machine, set the ATOTI_JAVA_HOME to its path, and restart your session?

@kiimot
Copy link
Author

kiimot commented Dec 16, 2022

Hi! We have reviewed what you have told us.

We have everything configured correctly as you say:

https://pypi.org/project/jdk4py
image

JDK 17.0.5
image

Variables de entorno
image

We have done everything you have indicated, the same error continues to appear

@rcolle
Copy link
Member

rcolle commented Dec 16, 2022

Hi,
Could you please execute the following code to make sure of what is actually picked up by atoti?

import os
import atoti

print(os.environ["ATOTI_JAVA_HOME"])
print(atoti._get_java_executable_path.get_java_executable_path())

If these show the expected values, can you please upload the latest server logs with the issue now that the relevant JDK has been set?
Thanks!

@kiimot
Copy link
Author

kiimot commented Dec 17, 2022

Hi! Yes, the values are as expected.
image

I attach the logs with updated JDK, the same issue still appears: server.log

Thank you very much for your time!

@tibdex
Copy link
Member

tibdex commented Dec 19, 2022

The custom JDK made the first error (java.lang.NoClassDefFoundError: jdk/net/ExtendedSocketOptions) disappear but the main one remains the same: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set.

I've added this issue to our backlog but I can't tell when we'll have time to work on it. In the meantime, can you try backing your user content storage with another DB?

@mfabiani-av
Copy link

mfabiani-av commented Jan 11, 2023

Hi @tibdex ,

there was a misunderstanding here with the developers at NTT Data: for the user_content_storage, they are going to use an Oracle database so it should be ok.
The plan is to use MongoDB to load data into the datastores (i.e. "JDBC source" in Java) instead of CSV. So if anything, we should test if atoti_sql works with MongoDB drivers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug unexpected or wrong behavior
Projects
None yet
Development

No branches or pull requests

4 participants