Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Migration problems from Neon to Oxygen
Migration problems from Neon to Oxygen [message #1767269] Tue, 04 July 2017 11:53 Go to next message
Andreas Christ is currently offline Andreas ChristFriend
Messages: 32
Registered: April 2016
Member
For our project I just changed the Scout version from "6.0.200.0" to the latest "7.0.0.008_Oxygen". Some tiny error occured due to AbstractPage's method update: from (old) initTable() to (new) createTable(). OK, that's easy.

But If we start our Scout app, we get some Exceptions:
2017-07-04 13:35:23,534 INFO  [main] org.eclipse.jetty.util.log.initialized(Log.java:192) - Logging initialized @340ms to org.eclipse.jetty.util.log.Slf4jLog - MDC[]
2017-07-04 13:35:23,589 INFO  [main] org.eclipse.scout.dev.jetty.JettyServer.createWebApp(JettyServer.java:154) - Starting Jetty with resourceBase=/home/a3798/git/CustomerCareScout/customercare.server.app.dev/src/main/webapp - MDC[]
2017-07-04 13:35:23,602 INFO  [main] org.eclipse.jetty.server.Server.doStart(Server.java:372) - jetty-9.4.3.v20170317 - MDC[]
2017-07-04 13:35:23,667 INFO  [main] org.eclipse.jetty.webapp.StandardDescriptorProcessor.visitServlet(StandardDescriptorProcessor.java:281) - NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet - MDC[]
2017-07-04 13:35:23,678 INFO  [main] org.eclipse.jetty.server.session.doStart(DefaultSessionIdManager.java:360) - DefaultSessionIdManager workerName=node0 - MDC[]
2017-07-04 13:35:23,678 INFO  [main] org.eclipse.jetty.server.session.doStart(DefaultSessionIdManager.java:365) - No SessionScavenger set, using defaults - MDC[]
2017-07-04 13:35:23,680 INFO  [main] org.eclipse.jetty.server.session.startScavenging(HouseKeeper.java:146) - Scavenging every 660000ms - MDC[]
2017-07-04 13:35:23,690 INFO  [Thread-9] org.eclipse.scout.rt.platform.config.PropertiesHelper.parse(PropertiesHelper.java:989) - Reading properties from file:/home/a3798/git/CustomerCareScout/customercare.server.app.dev/target/classes/config.properties using org.eclipse.scout.rt.platform.config.DefaultConfigFileLoader - MDC[]
2017-07-04 13:35:23,694 INFO  [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateHeadless(PlatformImplementor.java:171) - Headless mode: scout.headless=true, java.awt.headless=true (automatically set by Scout), GraphicsEnvironment.isHeadless()=true - MDC[]
2017-07-04 13:35:23,849 INFO  [Thread-9] org.eclipse.scout.rt.platform.inventory.ClassInventory.<clinit>(ClassInventory.java:40) - Building jandex class inventory with 2210 classes in 152.569016 ms using rebuild strategy ALWAYS - MDC[]
2017-07-04 13:35:24,013 INFO  [Thread-9] com.sixt.leasing.core.service.client.ldap.endpoint.UserLoginService.<init>(UserLoginService.java:58) - User login service configuration loaded - MDC[]
2017-07-04 13:35:24,056 INFO  [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.createBeanManager(PlatformImplementor.java:213) - Collecting 380 beans in 361.053594 ms - MDC[]
2017-07-04 13:35:24,091 INFO  [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.createBeanManager(PlatformImplementor.java:218) - Registering 380 beans in 34.987372 ms - MDC[]
2017-07-04 13:35:24,093 INFO  [Thread-9] org.eclipse.scout.rt.platform.job.internal.DevelopmentThreadNameDecorator.stateChanged(DevelopmentThreadNameDecorator.java:100) - +++ Development thread name decoration - MDC[]
2017-07-04 13:35:24,096 INFO  [Thread-9] org.eclipse.scout.rt.platform.logger.LoggerPlatformListener.registerLoggerSupportBean(LoggerPlatformListener.java:105) - registered logger support [org.eclipse.scout.rt.platform.logger.LogbackLoggerSupport] - MDC[]
2017-07-04 13:35:24,099 INFO  [Thread-9] org.eclipse.scout.rt.shared.services.common.code.CodeTypeRegistrator.stateChanged(CodeTypeRegistrator.java:32) - 1 code type classes registered. - MDC[]
2017-07-04 13:35:24,104 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'SwopSixtOfferService.password' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,104 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'OfferService.serviceUrl' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,104 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'ContractLifecycleService.serviceUrl' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,105 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'DocumentManagementService.serviceUrl' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,105 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'OfferService.username' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,105 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'com.sixt.leasing.scout.server.services.restclient.SxCodeService.servicePrefix' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,105 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'user.area' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,105 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'ContractProcessService.serviceUrl' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,106 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'ContractLifecycleService.password' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,106 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'ContractProcessService.username' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,106 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'DocumentManagementService.username' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,106 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'ContractProcessService.servicePrefix' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,106 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'ContractLifecycleService.servicePrefix' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,106 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'com.sixt.leasing.scout.server.services.restclient.OfferService.servicePrefix' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,106 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'ContractProcessService.password' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,106 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'com.sixt.leasing.scout.server.services.restclient.SxCodeService.serviceUrl' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,106 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'DocumentManagementService.password' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,106 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'DocumentManagementService.servicePrefix' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,106 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'OfferService.servicePrefix' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,106 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'OfferService.version' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,106 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'EligibilityService.password' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,106 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'SwopSixtOfferService.username' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,106 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'SwopSixtOfferService.servicePrefix' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,107 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'EligibilityService.servicePrefix' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,107 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'EligibilityService.username' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,107 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'OfferService.password' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,107 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'com.sixt.leasing.scout.server.services.restclient.OfferService.serviceUrl' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,107 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'EligibilityService.serviceUrl' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,107 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'ContractLifecycleService.username' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,107 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:191) - Config property with key 'SwopSixtOfferService.serviceUrl' does not exist or has an invalid value. - MDC[]
2017-07-04 13:35:24,108 ERROR [Thread-9] org.eclipse.scout.rt.platform.internal.PlatformImplementor.start(PlatformImplementor.java:143) - Error during platform startup - MDC[]
org.eclipse.scout.rt.platform.exception.PlatformException: Cannot start platform due to 30 invalid config properties: [SwopSixtOfferService.password, OfferService.serviceUrl, ContractLifecycleService.serviceUrl, DocumentManagementService.serviceUrl, OfferService.username, com.sixt.leasing.scout.server.services.restclient.SxCodeService.servicePrefix, user.area, ContractProcessService.serviceUrl, ContractLifecycleService.password, ContractProcessService.username, DocumentManagementService.username, ContractProcessService.servicePrefix, ContractLifecycleService.servicePrefix, com.sixt.leasing.scout.server.services.restclient.OfferService.servicePrefix, ContractProcessService.password, com.sixt.leasing.scout.server.services.restclient.SxCodeService.serviceUrl, DocumentManagementService.password, DocumentManagementService.servicePrefix, OfferService.servicePrefix, OfferService.version, EligibilityService.password, SwopSixtOfferService.username, SwopSixtOfferService.servicePrefix, EligibilityService.servicePrefix, EligibilityService.username, OfferService.password, com.sixt.leasing.scout.server.services.restclient.OfferService.serviceUrl, EligibilityService.serviceUrl, ContractLifecycleService.username, SwopSixtOfferService.serviceUrl]
	at org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:195)
	at org.eclipse.scout.rt.platform.internal.PlatformImplementor.start(PlatformImplementor.java:136)
	at org.eclipse.scout.rt.platform.internal.PlatformStarter.run(PlatformStarter.java:29)
Exception in thread "Thread-9" org.eclipse.scout.rt.platform.exception.PlatformException: Cannot start platform due to 30 invalid config properties: [SwopSixtOfferService.password, OfferService.serviceUrl, ContractLifecycleService.serviceUrl, DocumentManagementService.serviceUrl, OfferService.username, com.sixt.leasing.scout.server.services.restclient.SxCodeService.servicePrefix, user.area, ContractProcessService.serviceUrl, ContractLifecycleService.password, ContractProcessService.username, DocumentManagementService.username, ContractProcessService.servicePrefix, ContractLifecycleService.servicePrefix, com.sixt.leasing.scout.server.services.restclient.OfferService.servicePrefix, ContractProcessService.password, com.sixt.leasing.scout.server.services.restclient.SxCodeService.serviceUrl, DocumentManagementService.password, DocumentManagementService.servicePrefix, OfferService.servicePrefix, OfferService.version, EligibilityService.password, SwopSixtOfferService.username, SwopSixtOfferService.servicePrefix, EligibilityService.servicePrefix, EligibilityService.username, OfferService.password, com.sixt.leasing.scout.server.services.restclient.OfferService.serviceUrl, EligibilityService.serviceUrl, ContractLifecycleService.username, SwopSixtOfferService.serviceUrl]
	at org.eclipse.scout.rt.platform.internal.PlatformImplementor.validateConfiguration(PlatformImplementor.java:195)
	at org.eclipse.scout.rt.platform.internal.PlatformImplementor.start(PlatformImplementor.java:136)
	at org.eclipse.scout.rt.platform.internal.PlatformStarter.run(PlatformStarter.java:29)
2017-07-04 13:35:24,109 WARN  [main] org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:549) - Failed startup of context o.e.s.d.j.P_WebAppContext@1445d7f{/,file:///home/a3798/git/CustomerCareScout/customercare.server.app.dev/src/main/webapp/,UNAVAILABLE} - MDC[]
org.eclipse.scout.rt.platform.exception.PlatformException: The platform is in an invalid state.
	at org.eclipse.scout.rt.platform.internal.PlatformImplementor.throwOnPlatformInvalid(PlatformImplementor.java:93)
	at org.eclipse.scout.rt.platform.internal.PlatformImplementor.awaitPlatformStarted(PlatformImplementor.java:83)
	at org.eclipse.scout.rt.server.commons.WebappEventListener.contextInitialized(WebappEventListener.java:43)
	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:876)
	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:532)
	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:839)
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:344)
	at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1480)
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1442)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:799)
	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:261)
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:540)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
	at org.eclipse.jetty.server.Server.start(Server.java:452)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
	at org.eclipse.jetty.server.Server.doStart(Server.java:419)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.eclipse.scout.dev.jetty.JettyServer.start(JettyServer.java:95)
	at org.eclipse.scout.dev.jetty.JettyServer.main(JettyServer.java:56)
2017-07-04 13:35:24,118 INFO  [main] org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:280) - Started ServerConnector@2aa3cd93{HTTP/1.1,[http/1.1]}{0.0.0.0:8080} - MDC[]
Exception in thread "main" org.eclipse.scout.rt.platform.exception.PlatformException: The platform is in an invalid state.
	at org.eclipse.scout.rt.platform.internal.PlatformImplementor.throwOnPlatformInvalid(PlatformImplementor.java:93)
	at org.eclipse.scout.rt.platform.internal.PlatformImplementor.awaitPlatformStarted(PlatformImplementor.java:83)
	at org.eclipse.scout.rt.server.commons.WebappEventListener.contextInitialized(WebappEventListener.java:43)
	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:876)
	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:532)
	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:839)
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:344)
	at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1480)
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1442)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:799)
	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:261)
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:540)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
	at org.eclipse.jetty.server.Server.start(Server.java:452)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
	at org.eclipse.jetty.server.Server.doStart(Server.java:419)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.eclipse.scout.dev.jetty.JettyServer.start(JettyServer.java:95)
	at org.eclipse.scout.dev.jetty.JettyServer.main(JettyServer.java:56)


Cannot read properties? That's not true. We debugged the code and all properties (keys and values) are properly read. But this Exception said, "Config property with key 'XXXX.key' does not exist or has an invalid value." Well.... What let the program come to that conclusion?

The migration guide doesn't help us, sorry. Do you have an idea?
Re: Migration problems from Neon to Oxygen [message #1767272 is a reply to message #1767269] Tue, 04 July 2017 12:03 Go to previous messageGo to next message
Matthias OtterbachFriend
Messages: 55
Registered: August 2015
Location: Munich
Member
A new validation for configuration properties has been introduced with the new version of Scout.

You are writing you are debugging the code, do you have the possibility to step into the method org.eclipse.scout.rt.platform.internal.PlatformImplementor.isConfigEntryValid(List<IConfigurationValidator>, Entry<String, String>) for some of the properties reported as invalid? In this method you could check if there are validators for the configuration property (all beans implementing IConfigurationValidator), there should be at least one, and step into the isValid method to check why these properties are reported as invalid.



  • How are the config properties implemented? I suppose they are subclasses of AbstractStringConfigProperty (at least some of them) just providing a getKey and getDefaultValue method?
  • Where are the properties defined? In the config.properties of your project?

[Updated on: Tue, 04 July 2017 12:09]

Report message to a moderator

Re: Migration problems from Neon to Oxygen [message #1767275 is a reply to message #1767272] Tue, 04 July 2017 12:08 Go to previous messageGo to next message
Arthur van Dorp is currently offline Arthur van DorpFriend
Messages: 48
Registered: October 2015
Member
What Matthias said. And have a look at IConfigProperty and the implementing classes. You can have your properties inherit from classes like AbstractBooleanConfigProperty, AbstractIntegerConfigProperty, AbstractMapConfigProperty etc. and get the type validation for free.
[Edit] The documentation has this to say: https://eclipsescout.github.io/7.0/technical-guide.html#sec-config.management

[Updated on: Tue, 04 July 2017 12:23]

Report message to a moderator

Re: Migration problems from Neon to Oxygen [message #1767281 is a reply to message #1767275] Tue, 04 July 2017 12:38 Go to previous messageGo to next message
Andreas Christ is currently offline Andreas ChristFriend
Messages: 32
Registered: April 2016
Member
All of our properties are of type "AbstractStringConfigProperty". I think, a validation if a key or value is a String is trivial. Or do I have to implement a validation class for each of our properties? What is the "new" validation concept, do you have some information? What is the difference to our old Neon validation?
----
UPDATE: thank you for chapter 2.4, I'm going to read it now.

[Updated on: Tue, 04 July 2017 12:41]

Report message to a moderator

Re: Migration problems from Neon to Oxygen [message #1767283 is a reply to message #1767281] Tue, 04 July 2017 12:44 Go to previous messageGo to next message
Arthur van Dorp is currently offline Arthur van DorpFriend
Messages: 48
Registered: October 2015
Member
If they are already of type AbstractStringConfigProperty, I'd try to debug the isValid method as Matthias suggested.
Re: Migration problems from Neon to Oxygen [message #1767285 is a reply to message #1767272] Tue, 04 July 2017 12:55 Go to previous messageGo to next message
Andreas Christ is currently offline Andreas ChristFriend
Messages: 32
Registered: April 2016
Member
1. Our code is as follows:
	@Override
	public String getServiceUrl() {
		return new AbstractStringConfigProperty() {

			@Override
			public String getKey() {
				return SERVICE_URL_KEY;
			}

			@Override
			protected String getDefaultValue() {
				return SERVICE_URL;
			}
		}.getValue();
	}

And I just tried the example with "concrete" classes:
	public class EligibilityServiceUrlProperty extends AbstractStringConfigProperty {

		@Override
		public String getKey() {
			return SERVICE_URL_KEY;
		}

		@Override
		protected String getDefaultValue() {
			return SERVICE_URL;
		}
	}
	
	@Override
	public String getServiceUrl() {
		return CONFIG.getPropertyValue(EligibilityServiceUrlProperty.class);
	}

None succeded:
Config property with key 'EligibilityService.serviceUrl' does not exist or has an invalid value.
2. yes, they are stored in normal config.property files. They are already read by Scout (I can see correct keys and values while debugging the Scout code)
Re: Migration problems from Neon to Oxygen [message #1767286 is a reply to message #1767285] Tue, 04 July 2017 13:00 Go to previous messageGo to next message
Arthur van Dorp is currently offline Arthur van DorpFriend
Messages: 48
Registered: October 2015
Member
Looks like the Bean manager can't get all the IConfigProperty instances with BEANS.all(IConfigProperty.class) (in ConfigPropertyValidator). Why your second example wouldn't work I don't know.
Re: Migration problems from Neon to Oxygen [message #1767290 is a reply to message #1767286] Tue, 04 July 2017 13:13 Go to previous messageGo to next message
Andreas Christ is currently offline Andreas ChristFriend
Messages: 32
Registered: April 2016
Member
In class "PlatformImplementor" method "isConfigEntryValid" the List<IConfigurationValidator> constists only of one element: ConfigPropertyValidator
And validator.isValid(config.getKey(), config.getValue()) gives false for all of my properties, but keys and values are correct.
In ConfigPropertyValidator isValid() returns false for any key, but there are 102 ConfigProperties in getAllConfigProperties()....
Re: Migration problems from Neon to Oxygen [message #1767293 is a reply to message #1767290] Tue, 04 July 2017 13:39 Go to previous messageGo to next message
Arthur van Dorp is currently offline Arthur van DorpFriend
Messages: 48
Registered: October 2015
Member
Strange. Does it go through the line ConfigPropertyValidator:50 (property.getValue();) in the try/catch block? Could you try to have a look at the exception there?
Re: Migration problems from Neon to Oxygen [message #1767296 is a reply to message #1767293] Tue, 04 July 2017 13:56 Go to previous messageGo to next message
Andreas Christ is currently offline Andreas ChristFriend
Messages: 32
Registered: April 2016
Member
Before the program comes to try/catch block (property.getValue();), the following code returns always null.
--> getAllConfigProperties().get(parsedKey) is null (parsedKey is correct; method's parameter "value" is correct, too)
--> IConfigProperty<?> property is null
--> PropertiesHelper.IMPORT_KEY is always (!) "import", therefore ALWAYS not equals any parsedKey --> return false

    IConfigProperty<?> property = getAllConfigProperties().get(parsedKey);
    if (property == null) {
      return PropertiesHelper.IMPORT_KEY.equals(parsedKey); // 'import' key should be accepted although there is no IConfigProperty class for this key.
    }
Re: Migration problems from Neon to Oxygen [message #1767298 is a reply to message #1767296] Tue, 04 July 2017 14:02 Go to previous messageGo to next message
Matthias OtterbachFriend
Messages: 55
Registered: August 2015
Location: Munich
Member
I think we are getting closer to a solution, the all config properties method returns a map initialized in getAllConfigProperties.

I am not sure if the config properties can still be defined as anonymous classes (your first example), also the second example seems to be a subclass inside another class.

Could you try either defining one config property in a separate file or define the config property as a "public static class" (if it is a subclass of another), for example:

public class SomeOtherClass {

    public static class EligibilityServiceUrlProperty extends AbstractStringConfigProperty {

	@Override
	public String getKey() {
		return SERVICE_URL_KEY;
	}

	@Override
	protected String getDefaultValue() {
		return SERVICE_URL;
	}
    }
}


Re: Migration problems from Neon to Oxygen [message #1767299 is a reply to message #1767296] Tue, 04 July 2017 14:02 Go to previous messageGo to next message
Arthur van Dorp is currently offline Arthur van DorpFriend
Messages: 48
Registered: October 2015
Member
PropertiesHelper.IMPORT_KEY is always import, yes, it's a constant. :) The problem is that the variable property is null. My initial suspicion was that the Bean manager doesn't find you IConfigProperty instances. Could you have a look at the m_configProperties-Map and what kind of properties it contains? You said there are 102, but are they "yours"?
[Edit] Missed Matthias post. That's a good approach, ensuring that the Bean manager can find your beans/properties.

[Updated on: Tue, 04 July 2017 14:04]

Report message to a moderator

Re: Migration problems from Neon to Oxygen [message #1767301 is a reply to message #1767298] Tue, 04 July 2017 14:17 Go to previous messageGo to next message
Andreas Christ is currently offline Andreas ChristFriend
Messages: 32
Registered: April 2016
Member
Ah, the magic is static class !

It doesn't go with our anonymous classes, sad, sad.

And now you've got to update
https://eclipsescout.github.io/7.0/technical-guide.html#sec-config.management
with this code:
public static class MyCustomTimeoutProperty extends AbstractLongConfigProperty {
@Override
public String getKey() {
return "my.custom.timeout";
}
@Override
protected Long getDefaultValue() {
return 3600L;
}
}

Re: Migration problems from Neon to Oxygen [message #1767302 is a reply to message #1767301] Tue, 04 July 2017 14:22 Go to previous messageGo to next message
Arthur van Dorp is currently offline Arthur van DorpFriend
Messages: 48
Registered: October 2015
Member
The example code is a standalone class which can't have the static modifier (it is actual code which gets compiled). I'll add a remark it in the text description.
[Edit, quick fingered the submit button]The example works correctly if it lives in its own file, e.g. is a top level and not an inner class.

[Updated on: Tue, 04 July 2017 14:23]

Report message to a moderator

Re: Migration problems from Neon to Oxygen [message #1767304 is a reply to message #1767302] Tue, 04 July 2017 14:37 Go to previous messageGo to next message
Matthias OtterbachFriend
Messages: 55
Registered: August 2015
Location: Munich
Member
If you want to keep the anonymous classes another possibility would be to add your own org.eclipse.scout.rt.platform.config.IConfigurationValidator, just create a new class (either static or in a new file) like:

public class MyConfigPropertyValidator implements IConfigurationValidator {

  private static final String[] KNOWN_PROPERTIES = new String[] {...};

  @Override
  public boolean isValid(String key, String value) {
    return Arrays.asList(KNOWN_PROPERTIES).contains(key);
  }
}
Re: Migration problems from Neon to Oxygen [message #1767315 is a reply to message #1767304] Tue, 04 July 2017 15:33 Go to previous message
Andreas Christ is currently offline Andreas ChristFriend
Messages: 32
Registered: April 2016
Member
Thank you, I'm going to check that.
----
Yeah, that works well, too!! Thank you!

[Updated on: Tue, 04 July 2017 15:42]

Report message to a moderator

Previous Topic:[Blog Post] Machine Learning with Deeplearning4j and Eclipse Scout
Next Topic:Scout doesn't compile (IService not found)
Goto Forum:
  


Current Time: Fri Mar 29 14:12:45 GMT 2024

Powered by FUDForum. Page generated in 0.03622 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top