Hi.
I’m trying to run the manager using the IDE, but so far, I haven’t managed to complete the process.
I first tried to use the custom-project template according to User Guide: Custom deployment, but for some reason, npm run serve -- --env config=..\..\..\..\deployment\manager\app returns some errors, and I believe this makes the frontend unavailable at http://localhost:9000/manager/.
Alternatively, I cloned the main openeremote repo directly to see if working on the main project could make any difference. After executing docker-compose -p openremote -f profile/dev-testing.yml up --build -d, I can see the Keycloak and the PostgreSQL containers running properly. Besides, npm run serve -- --env config=..\..\..\..\deployment\manager\app seems to work now. However, I’m not sure how to run the manager backend using the IDE. I’ve downloaded IntelliJ IDEA for the first time, and I don’t know how to configure it properly. I opened the openremote project in the IDE, but it seems that there is no application configuration ready. So I added a new application configuration under run>edit configurations, but I’m not sure how to configure it correctly.
Normally when importing the project in IntelliJ a set of default run configurations are present.
This makes it way easier to get the manager running.
Have you checked the Setting up an IDE wiki page? Especially the ‘Importing a project in an IDE’ and ‘Setting the working directory’ sections could help here.
.
Setting the option “Build and run using” to IntelliJ IDEA in Build, Execution, Deployment -> Build Tools -> Gradle should make the configurations appear like “Demo Setup” and “Empty”:
(screenshot of my IntelliJ IDEA Ultimate instance)
The ‘Running and debugging the Manager’ section also describes a custom configuration in case of using custom projects, since classpath and main class specifications differ there.
.
Hopefully this helped!
Let me know if further issues appear
Yes, I can see the configurations you mentioned, but it seems to work only with the custom-template. However, when I use the custom template, I cannot manage to get the manager frontend up and running ( npm run serve -- --env config=..\..\..\..\deployment\manager\app returns some errors).
Because of this issue, I tried to use directly -at least for now- the openremote main repo, but in this case, I cannot see any configurations appearing on IntelliJ. I’ve also referred to the Setting up an IDE wiki page you mentioned, and it says:
If you are using the custom project repository as starting point the run configurations will already be set up. If not, set up a Run Configuration:
Module/Classpath: custom-project.setup.main for custom projects
Working directory: Must be set to OpenRemote main project directory!
Main class: org.openremote.manager.Main
Any environment variables that customise deployment (usually custom projects have some)
However, I’m probably missing how to set the Module/Classpath.
Am I supposed to see a default set of configurations even working directly on openremote main project?
Am I supposed to see a default set of configurations even working directly on openremote main project?
That is correct. It should run out of the box when importing the project into IntelliJ IDEA. (after following the steps on the wiki page I mentioned)
The screenshot I sent earlier is from the openremote main repo where I’m working on right now.
I can’t remember editing the default one, so here are my run configurations:
. Empty configuration: (no pre-loaded assets)
Module/Classpath: openremote.manager.main
Working directory: /* OpenRemote main project directory (normally ends with "/openremote" folder after cloning) */
Main class: org.openremote.manager.main
Module/Classpath: openremote.setup.main
Working directory: /* OpenRemote main project directory (normally ends with "/openremote" folder after cloning) */
Main class: org.openremote.manager.main
Environment variables: OR_SETUP_TYPE=demo;
Thanks, Martin!
It is working now (at least the main repo).
As you pointed out, the problem was that the repo was cloned in my folder without the /openremote subdirectory.
Thanks a lot!
Dario
@martin.peeters , @dario
Hi,
I have follow same process that You have mention above but it not work. while I try to run get the error
I follow the link to set up IDE configuration
“C:\Program Files\Java\jdk-17\bin\java.exe” --enable-preview “-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.2.4\lib\idea_rt.jar=56784:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.2.4\bin” -Dfile.encoding=UTF-8 org.openremote.manager.main
Error: Could not find or load main class org.openremote.manager.main
I’m a bit confused with the file structure I see there. Do you want to set up a custom project using the repository template, or just run OpenRemote with the demo for example?
In any case it seems like not all files are there? Did you pull everything successfully?
It’s as if you have an incomplete folder of OpenRemote and in there put the custom project? The custom project should use openremote as a submodule (that you need to initialize and update).
If openremote was complete and IntelliJ has some time to properly set up the project, it will come with some preset Run Configurations. If not, you will also be able to select something like customer-project-main.manager.main in the -cp field.
The wiki page you mention is about running a custom project with OpenRemote as submodule, so that is confusing things. If you just want to run the demo first, you can follow the quickstart: openremote/README.md at master · openremote/openremote · GitHub
If you do want to run the custom project (for advanced users) then you should follow the wiki page you mentioned and make sure you have the docker containers running using docker-compose -f profile\dev-testing.yml up -d, then run the ‘custom project’ run configuration (top right in IDE), then rune the manager ui as you did.
Hi Don,
First I want to run OpenRemote demo using the code. then I will set up a custom project. For demo openremote I import code on IDE and run using “npm run server” command and give a path “ui/app/manager”. and “http://localhost:9000/manager/” but it open blank page I am expecting login page. so i get logi page need to invoke the this from custom project’s file or there is another method for the same.
Hi, i am unable to interact with ui i want to customize components but because the issue blow in picture.
the issue is occur when i run npm run serve in ui/app/manager