Message Boards
Liferay Uni Exercise: Components and Services, errors on osgi-service build
Liferay Uni Exercise: Components and Services, errors on osgi-service build
New Member Posts: 13 Join Date: 9/28/20 Recent PostsWhen my "osgi-service" project is created, it immediately has 23 errors in the build. No annotations are recognized and nothing "Liferay" is either. Here are the errors I have:
I'm new to dev studio, but I followed all of the directions given to me. What is the problem here?
Attachments:
- image--tempRandomSuffix--1EHvywOJ.png (25 KB)
- image--tempRandomSuffix--1SPKUxhl.png (61 KB)
- image--tempRandomSuffix--8WpqDWPq.png (97 KB)
- image--tempRandomSuffix--9nHqf6gY.png (57 KB)
- image--tempRandomSuffix--JArF7tQ6.png (339 KB)
- image--tempRandomSuffix--kGzxx2ap.png (58 KB)
- image--tempRandomSuffix--Qc8BWh4K.png (63 KB)
- image--tempRandomSuffix--RaKQuFyg.png (44 KB)
- image--tempRandomSuffix--tU6g1HrN.png (30 KB)
- image--tempRandomSuffix--yalDjj03.png (58 KB)
RE: Exercise: Components and Services - Errors on osgi-service build
Liferay Legend Posts: 6403 Join Date: 9/23/08 Recent Posts
I am following the instruction step-by-step when creating the Bnd OSGi Project 'osgi-service'. I created both the workspace and project the way the directions show below: ...
It would help knowing which instructions you followed, and if you used all the same versions as used in that exercise. I'm assuming that you went through one of the Liferay University courses - please state which version it is for, which version (of DevStudio, Liferay) you're using, and if you're using Java 8 or 11
RE: Exercise: Components and Services - Errors on osgi-service build
New Member Posts: 13 Join Date: 9/28/20 Recent PostsRE: Exercise: Components and Services - Errors on osgi-service build
Liferay Legend Posts: 1554 Join Date: 9/24/09 Recent PostsInstead of that, I recommend that you follow the Liferay documentation and create a Liferay Module Workspace and then a module project. That way, you can leverage the workspace features and the wizards implemented by Liferay to create new module projects.
https://help.liferay.com/hc/en-us/articles/360017885072-Creating-a-Liferay-Workspace-with-Dev-Studio
RE: Exercise: Components and Services - Errors on osgi-service build
New Member Posts: 13 Join Date: 9/28/20 Recent PostsRE: Liferay Uni Exercise: Components and Services, errors on osgi-service b
Liferay Legend Posts: 1554 Join Date: 9/24/09 Recent PostsI am not sure, where the problem is, but I suspect it has to do with maven. Maven(https://de.wikipedia.org/wiki/Apache_Maven ) is used to find the dependencies and it obviously doesn't in your case.
1) Are you connected to the internet when you try to build? (It has to download the dependencies)
2) Can you check, if you have a C:\Users\<YourUser>\.m2 folder? Is it there (Note: You can change it in the Eclipse Preferences -> Maven -> User settings. Did you do that by chance?)
Maybe you could remove the Developer studio and install it from scratch? Something is wrong and it is really hard to say what. IMHO it has nothing to do with the project type, something else is wrong. But it is hard to say, what it is.
RE: Liferay Uni Exercise: Components and Services, errors on osgi-service b
New Member Posts: 13 Join Date: 9/28/20 Recent PostsI checked that path you suggested, and I do see a .m2 folder there. I also checked the maven user settings in eclipse, I see the path to that folder under the "User Settings" and "Local Repository" file paths. The file path for "Global settings" is empty though. Could this empty file path be the issue?I have removed and re-installed the developer studio a few times already, but get the same result. I have even completely started the exercises from scratch, starting with the first exercise to make sure I did not miss anything.
RE: Liferay Uni Exercise: Components and Services, errors on osgi-service b
Liferay Legend Posts: 1554 Join Date: 9/24/09 Recent PostsYou could also try to use the command line mvn command and try "mvn clean install".
RE: Liferay Uni Exercise: Components and Services, errors on osgi-service b
New Member Posts: 13 Join Date: 9/28/20 Recent PostsRE: Liferay Uni Exercise: Components and Services, errors on osgi-service b (Answer)
New Member Posts: 13 Join Date: 9/28/20 Recent PostsI was able to narrow the issue down to a consistent problem when downloading dependencies. My machine is authenticated by my company's certificate, so I had to add an entry to the java cert store for the IDE to recognize network activity as valid.
This is the command I ran (as admin) in cmd (Windows 10):
keytool -importcert -file ".crt file path" -keystore "C:\Program Files\Java\jre1.8.0_271\lib\security\cacerts" -alias "my alias"
This is the article I referenced when creating the command https://stackoverflow.com/questions/684081/importing-ssl-certificate-into-eclipse
Hopefully this reaches anyone who might be running into this same problem. I could not find anything about this issue on the community or Liferay's documentation.