cannot deploy with setting (blank) to string constant values

1
Hi there! I am facing to a problem deploying to On-premises environment. Because I cannot deploy with setting ''(blank)  to string constant values When I deploy using Mendix service Console with above settings, following error occurs. com.mendix.systemwideinterfaces.MendixRuntimeException: Could not find value for constant 'MyFirstModule.Proxy_Host     at com.mendix.basis.conf.ConfigurationImpl.getConstantValue(ConfigurationImpl.java:453)     at com.mendix.basis.conf.ConfigurationImpl.getConstantValue(ConfigurationImpl.java:466)     at com.mendix.languages.expressions.ConstantExpr.<init>(ConstantExpr.java:13)     at com.mendix.languages.parsers.MxExpressions_ExpressionsParser.constantExpr(MxExpressions_ExpressionsParser.java:1072) .... I want to satisfy the proxy setting of consuming Rest service. In the application , I am consuming some Rest service , and asuume that the services are 'ServiceA', 'ServiceB'.   Local and TEST environment:  'ServiceA' needs proxy but 'ServiceB' doesn't need. Since Rest service doesn't support a JVM paranmeter '-Dhttp.nonProxyHosts' , I had solved this using following questions answer, and I defined proxyhost and port value as constant value. https://community.mendix.com/link/questions/88213 Staging environment: - Both 'ServiceA' and 'ServiceB' don't need proxy. So I set ''(blank) to those constant values, but I cannot deploy the application.   Does Anyone have any idea how to solve this? Thanks in advance! Satomi
asked
3 answers
2

Hi Satomi,

Rather then using constants to achieve what you want I would use the modeler to achieve this. So usually I have a management module or something like that. Then I define a Settings entity, with a microflow to retrieve it which always retrieves the first object and when it isn't found it creates and commits it. Then I define a connection entity or something like that and in your situation you could add an extra boolean attribute which defines if a proxy must be used. Then associate this connection entity to your general settings entity and name this assocation something like ServiceA or ServiceB. Create a page with tabs for all the settings you have and also define a tab connections where you can add the settings per connection/integration you use in your app. It might be a little bit more work then using constants but it's more clear to anyone else what is happening in your app.

Regards,

answered
2

I tried mendix support ticket. And they said that 'this problem will be fixed in a future version of the Mendix Windows Service'. I will use workaround until this is fixed.

answered
1

Hi Satomi,

 

when I don’t need to set a value for a constant, I use an empty string. So just add a space for your constants value and then you should be able to deploy

answered