Witam,
Co należy zrobić po dodaniu dependencji MongoDB w POMie, żeby skonfigurować tę bazę?
w application.properties dodałem:
spring.data.mongodb.uri=mongodb://localhost/
ale wywala mi błąd.
Witam,
Co należy zrobić po dodaniu dependencji MongoDB w POMie, żeby skonfigurować tę bazę?
w application.properties dodałem:
spring.data.mongodb.uri=mongodb://localhost/
ale wywala mi błąd.
czy możesz być bardziej dokładny?
jaki to błąd?
poza tym, jak podajesz ip, to dobrze byłoby podać port na którym się łączysz
tutaj jest tutek: https://www.devglan.com/spring-boot/spring-boot-mongodb-configuration
trojanus napisał(a):
czy możesz być bardziej dokładny?
jaki to błąd?
poza tym, jak podajesz ip, to dobrze byłoby podać port na którym się łączysztutaj jest tutek: https://www.devglan.com/spring-boot/spring-boot-mongodb-configuration
Chyba MongoDB jest teraz ok.
Opis błędu:
APPLICATION FAILED TO START
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
Commander300 napisał(a):
trojanus napisał(a):
czy możesz być bardziej dokładny?
jaki to błąd?
poza tym, jak podajesz ip, to dobrze byłoby podać port na którym się łączysztutaj jest tutek: https://www.devglan.com/spring-boot/spring-boot-mongodb-configuration
Chyba MongoDB jest teraz ok.
Opis błędu:
APPLICATION FAILED TO START
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
czyli nie działa:
APPLICATION FAILED TO START
@Commander300: no to nie mam pojęcia. Jedyne co polecam sprawdzić to połączenie z mongo, czyli ustawienie 'url'. Albo możesz zrobić nowy projekt. Albo pokaż co masz w pom.xml, bo takto czaruję z fusów :P
Ja w pom
nic nie dodawałem, jednak przy tworzeniu encji używałem adnotacji @Document
, a w Spring Data moje repozytoria rozszerzały interfejs MongoRepository
.
a nie url
zamiast uri
? ;)