Home » Eclipse Projects » Eclipse Scout » Easiest way to run the UI on computer
Easiest way to run the UI on computer [message #1861843] |
Wed, 08 November 2023 01:05 |
Pr Nico Messages: 21 Registered: February 2021 |
Junior Member |
|
|
Currently, I have an Eclipse Scout application (UI + server) deployed on a remote Tomcat server.
For specific development needs, I need to run the client part of my application locally on a computer.
I need this application to continue to access the server part on the remote Tomcat server.
I tried to implement an embedded Tomcat for the ui.html.war project:
public class EmbeddedTomcat {
public static void main(String[] args) throws Exception {
Tomcat tomcat = new Tomcat();
tomcat.setPort(8082);
String webappDirLocation = "src/main/webapp/";
StandardContext ctx = (StandardContext) tomcat.addWebapp("", new File(webappDirLocation).getAbsolutePath());
// Other configurations
tomcat.start();
tomcat.getServer().await();
}
}
I no longer have any errors in the console, but I can't access my application via localhost:8082
I tried to explore the JettyServer option, but I lack the necessary knowledge.
What is the easiest way to achieve my goal?
EDIT : of course I know I can install a local tomcat on my pc, deploy the client etc. But in the end it is directed to my final users, so I want to create a one-click button to launch the client, so I need something embedded.
Thank you
[Updated on: Wed, 08 November 2023 01:07] Report message to a moderator
|
|
| |
Re: Easiest way to run the UI on computer [message #1862232 is a reply to message #1861854] |
Sun, 19 November 2023 23:26 |
Pr Nico Messages: 21 Registered: February 2021 |
Junior Member |
|
|
Hello, thank you for your suggestion. Apologies for my delayed response.
I've been experimenting with the Jetty method and here's what I've done so far:
I copied the JettyServer class from org.eclipse.scout.dev.jetty into my project at myproject.ui.html.app.dev.
Running it manually from Eclipse seems successful it launches my client on localhost:8080 and successfully connects to the remote server's war file.
To build a jar, I've updated the pom.xml in my ui.html.app.dev project as follows:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>
snippet.JettyServer
</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
This modification successfully builds the jar. However, when I attempt to run it, I encounter an error: the config.properties file cannot be read, even though it's correctly placed in src/main/resources. I've also tried moving the config.properties file to the same location as the .jar, but this hasn't resolved the issue.
(I have also extracted the jar and the config.properties seems to be correctly put in it)
I am getting closer but I definitely need your advices here
java -jar project.ui.html.app.dev-1.0.0-SNAPSHOT-jar-with-dependencies.jar
2023-11-20 00:21:47,083 INFO [main] org.eclipse.scout.rt.platform.config.ConfigPropertyProvider.parse(ConfigPropertyProvider.java:115) - Reading properties from jar:file:/.../target/project.ui.html.app.dev-1.0.0-SNAPSHOT-jar-with-dependencies.jar!/config.properties using org.eclipse.scout.rt.platform.config.DefaultConfigFileLoader
2023-11-20 00:21:47,112 INFO [scout-platform-starter] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateHeadless(PlatformImplementor.java:174) - Headless mode: scout.headless=true, java.awt.headless=true (automatically set by Scout), GraphicsEnvironment.isHeadless()=true
2023-11-20 00:21:47,117 INFO [scout-platform-starter] org.eclipse.scout.rt.platform.inventory.ClassInventory.<clinit>(ClassInventory.java:37) - Building jandex class inventory using rebuild strategy IF_MISSING...
2023-11-20 00:21:47,136 INFO [scout-platform-starter] org.eclipse.scout.rt.platform.inventory.ClassInventory.<clinit>(ClassInventory.java:43) - Finished building jandex class inventory in 22.610781 ms. Total class count: 12
2023-11-20 00:21:47,139 INFO [scout-platform-starter] org.eclipse.scout.rt.platform.internal.PlatformImplementor.createBeanManager(PlatformImplementor.java:221) - Collected 0 beans in 1.550395 ms
2023-11-20 00:21:47,139 INFO [scout-platform-starter] org.eclipse.scout.rt.platform.internal.PlatformImplementor.createBeanManager(PlatformImplementor.java:226) - Registered 0 beans in 0.259599 ms
2023-11-20 00:21:47,142 ERROR [scout-platform-starter] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:194) - Config property with key 'scout.application.name' does not exist or has an invalid value.
2023-11-20 00:21:47,142 ERROR [scout-platform-starter] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:194) - Config property with key 'scout.devMode' does not exist or has an invalid value.
2023-11-20 00:21:47,142 ERROR [scout-platform-starter] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:194) - Config property with key 'scout.auth.privateKey' does not exist or has an invalid value.
2023-11-20 00:21:47,142 ERROR [scout-platform-starter] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:194) - Config property with key 'scout.cspEnabled' does not exist or has an invalid value.
2023-11-20 00:21:47,142 ERROR [scout-platform-starter] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:194) - Config property with key 'scout.application.version' does not exist or has an invalid value.
2023-11-20 00:21:47,143 ERROR [scout-platform-starter] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:194) - Config property with key 'scout.client.userArea' does not exist or has an invalid value.
2023-11-20 00:21:47,143 ERROR [scout-platform-starter] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:194) - Config property with key 'scout.auth.cookieSessionValidateSecure' does not exist or has an invalid value.
2023-11-20 00:21:47,144 ERROR [scout-platform-starter] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:194) - Config property with key 'scout.cspDirective[img-src]' does not exist or has an invalid value.
2023-11-20 00:21:47,144 ERROR [scout-platform-starter] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:194) - Config property with key 'scout.backendUrl' does not exist or has an invalid value.
2023-11-20 00:21:47,144 ERROR [scout-platform-starter] org.eclipse.scout.rt.platform.internal.PlatformImplementor.start(PlatformImplementor.java:146) - Error during platform startup
org.eclipse.scout.rt.platform.exception.PlatformException: Cannot start platform due to 9 invalid config properties: [scout.application.name, scout.devMode, scout.auth.privateKey, scout.cspEnabled, scout.application.version, scout.client.userArea, scout.auth.cookieSessionValidateSecure, scout.cspDirective[img-src], scout.backendUrl]
at org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:198)
at org.eclipse.scout.rt.platform.internal.PlatformImplementor.start(PlatformImplementor.java:139)
at org.eclipse.scout.rt.platform.internal.PlatformStarter.run(PlatformStarter.java:29)
[Updated on: Sun, 19 November 2023 23:33] Report message to a moderator
|
|
| |
Re: Easiest way to run the UI on computer [message #1862342 is a reply to message #1862326] |
Mon, 27 November 2023 11:00 |
J D Messages: 102 Registered: February 2021 |
Senior Member |
|
|
Hi there,
Have you tried editing the "service tunnel" section of the config.properties file in your xxx. ui.html.app.dev package? Since the value of the "scout.backendUrl" property is "http://localhost:8080", changing it to the address of your remote Tomcat production server, might just work. for you. I've never tried it though. It is just a suggestion for you to try out.
### Service tunnel
scout.backendUrl=http://localhost:8080
scout.auth.privateKey=xYzxYZ
Cheers,
JD
[Updated on: Mon, 27 November 2023 11:01] Report message to a moderator
|
|
| | |
Re: Easiest way to run the UI on computer [message #1863507 is a reply to message #1863489] |
Tue, 06 February 2024 23:40 |
Pr Nico Messages: 21 Registered: February 2021 |
Junior Member |
|
|
Hello Stephan, thank you very much, I have done some experiments and it is exactly what I was looking for.
I will slowly migrate my apps and wait for March.
What I don't understand is why I cannot change the front port, even if I play with the value of scout.app.port=8443, it goes at https://mydomain:8082. but not 8443... I am using a signed certificate and had no trouble with tomcat (it was correctly running at HTTPS/8443). I don't understand from where the 8082 comes from.
edit : ok I just noticed It comes from the starting script ... lol. It overrides the config.properties!
set JVM_ARGS=-Xms64m -Xmx512m -XX:-OmitStackTraceInFastThrow -Dscout.app.port=8082
Amazing work on the framework.
[Updated on: Tue, 06 February 2024 23:44] Report message to a moderator
|
|
| |
Re: Easiest way to run the UI on computer [message #1863551 is a reply to message #1863508] |
Thu, 08 February 2024 23:45 |
Pr Nico Messages: 21 Registered: February 2021 |
Junior Member |
|
|
Thank you for the update. I have successfully completed the migration of an application, overcoming some initial challenges with the transition from javax to jakarta namespaces using hibernate, as well as resolving issues related to dependencies convergence. The command mvn clean verify executes without any issues, and everything appears to be functioning correctly at this stage. that is very great!
However, when I attempt to perform an 'update maven' operation on my projects, I encounter an infinite loop. Despite attempting to reimport my project into a new workspace, the problem reoccurs after a few builds. While this issue is not critical, I know it is a beta but thought it was important to bring it to your attention.
Additionally, I am experiencing some confusion regarding the Maven configuration. I encountered issues with duplicate classes and found it necessary to explicitly include the following duplicate-finder-maven-plugin configuration in each project's pom.xml file:
<plugin>
<groupId>org.basepom.maven</groupId>
<artifactId>duplicate-finder-maven-plugin</artifactId>
<executions>
<execution>
<phase>none</phase>
</execution>
</executions>
</plugin>
In previous versions, it was sufficient to specify this plugin only in the parent pom.xml. This change in requirement has added to the complexity of managing the project configuration.
And finally, when I use Ctrl+Space to create a column or a field, it doesn't seem to work. It is reproductible in the helloworld project.
I am currently using Eclipse 2023-12 with the 23.1 beta version.
[Updated on: Fri, 09 February 2024 01:12] Report message to a moderator
|
|
| | |
Re: Easiest way to run the UI on computer [message #1863580 is a reply to message #1863557] |
Mon, 12 February 2024 21:56 |
Pr Nico Messages: 21 Registered: February 2021 |
Junior Member |
|
|
Hello,
You're right, it's my fault. I was using the wrong Eclipse (2023-12 instead of the future 2024-03), It solves the autocomplete issue (well present in 2023-12 though, what ever the version of scout I pick). Also, yes, I migrated from javax to jakarta.
Regarding the duplicate dependencies, it's after adding Hibernate, which seems to create a lot of duplicates. I haven't had the time to thoroughly analyze all of this yet, I reused the dependencies from my 22.x project where I know everything works to save time. For now I simply duplicated my disabling of the duplicate-finder in each pom.
|
|
|
Goto Forum:
Current Time: Sat Oct 05 09:50:56 GMT 2024
Powered by FUDForum. Page generated in 0.04842 seconds
|