MongoDB.live, free & fully virtual. Register Now MongoDB.live, free & fully virtual. Register Now

Question about mflix project of M220J: MongoDB for Java Developers course by university.mongodb.com

Good morning,

I downloaded mflix project, I added tools.jar library in libs jdk (setted at 1.8 jdk version) folder as externalJar and I imported mflix project as Existing Maven Project. After Eclipse IDEE wanted import all maven dependencies but that doesn’t work. Also I added the database uri like reported on the course (like linked Atlas DB with MongoDB Compass) inside spring.mongodb.uri and I tried also too execute command in course mvn spring-boot:run. But that gave me connection error to see more I used -e and -X command that said me the same errors but with more logs and more exception about all. -X (mvn spring-boot:run -X) said many more than other 2 command like -e (mvn spring-boot:run -e) and without nothing (mvn spring-boot:run). After that I tried to delete all maven dipendecies that I needed to re-imported on .m2 but always the same. And at least to see problems on others not only as cmd (that said me connection problem like I wrote first and it said me an error similar too cannot import dependecy and connect to server from pom.xml for application e build dependecies at ip address 10.229.232.154). So I said differences between the old libraries and the new libraries and old libraries have .jar and .pom files otherwise the new library inside pom.xml as application and build dependecies no them have only .lastUpdated files and .properties file. I attach all imeges.

Thank you.

Antonio Fabrizio


–You can see dependecies all in vertical blue line



–blue vertical underlines I used to saperate of missing to missing other horizontal underlines I used to see better on .m2 folder (folder where you can find all maven dependecies)




–like if cannot connect to MongoDB Java Application Server 10.229.232.154 and so cannot
–import dependecies




-information about pc and enviroment variables and debug tools










–and so on for all other dependecies untill build failed


-.m2 old repositories for other all projects I imported and for mflix project and see difference between that 2 I tried

–new dependecy for mflix project

–old dependecy for an old project

–file inside last lastUpdated and property about new maven dependecies like connection error with server (10.229.232.154) and cannot import




–file inside pom.xml and the properties that describe uri server where download that dependency



–all urls schemaLocation in that prospective

Good morning,
I found the error was in setting.xml of my .m2 because my company said me to paste inside for projects that I will go to do.

So now the question is it: Can I reject .setting.xml as properties for my new Eclipse workspace?

I can’t share images so I copy and paste here and I sent images in other community see:
https://discourse.university.mongodb.com/t/chapter-1-labs-6-7/71823

Thank you.

Antonio Fabrizio

Hello @Antonio_Fabrizio,

I did the same course sometime back. What I tried, I can explain. Please try the following and see if it works for you.

This is using Eclipse IDE with Java SE 8.

Unzip the mflix-java ZIP folder, and you will find mflix folder and a README.rst file.

  • README.rst has all the instructions.
  • The mflix folder is your project.

From the Eclipse IDE:

  • File -> Import Projects From File System or Archive
  • Import Source: Directory… Select the mflix directory
  • (Once the mflix directory is selected, you will see in Folder: Import as Maven and mflix)
  • Click the Finish button.

Navigate to the src/main/resources/applicationproperties

  • Edit the following (include your URI):
  • spring.mongodb.uri=mongodb+srv://yourid:yourpassword@mflix-abcd.mongodb.net/test

Run the application: As Spring Boot Application

That is all.
I tried this just now, and it worked fine.

NOTE:

Before doing the above, make sure you:

  • Have the Atlas Cluster setup, and verify you could connect from Compass
  • Import data into Atlas

Good evening,
I already did that first you wrote me but doesn’t work can’t import the dependecies.
I tried to remove RELEASE one time but also didn’t work also maybe our versions of Eclipse are different because I have only Import and I filiter like Existing Maven project like in images that you can see in other community because I can’t attach here. Like you can see it finds dependecies at server 10.229.232.154 is the server project I will do here in my company as soon as they will activate VPN. Like you can saw in other link with images upstair. In image you will see that is configured in settings.xml that my company said me to copy in .m2 folder. Do you know if it is possible that server 10.229.232.154 hasn’t that dependecies?

Thank you.

Antonio Fabrizio

links images:
https://discourse.university.mongodb.com/t/chapter-1-labs-6-7/71823

You can try these two steps:

  • Have the Atlas Cluster setup, and verify you could connect from Compass
  • Import data into Atlas

And, then run the application from the operating system command prompt.

  • Navigate to the mflix directory
  • mvn spring-boot:run

Make sure Maven is installed on your computer, and you have an open internet connection.

Good morning,
I tried to started with springboot application and I tried to started in cmd too but that didn’t download dependecies and didn’t work like you can see in images here of all over this conversations.

I am trying to import project with another pc that has not 10.229.232.154 (that I need to use for GIANOS project of company that I am working now) and I will see if can import mflix project.

Thank you.

Antonio Fabrizio

Good afternoon here,
I saw that it worked on my other no business laptop without connection at server GIANOS 10.229.232.154.
I attached image on other community you can see at link:
https://discourse.university.mongodb.com/t/chapter-1-labs-6-7/71823

Thank you also @Prasad_Saya and at all read or saw my post.

Antonio Fabrizio