An error occurred while initializing the Runtime: java.lang.reflect.InvocationTargetException

0
I get the following message “An error occurred while initializing the Runtime: java.lang.reflect.InvocationTargetException” when i try to preview an application in studio pro.  I have this problem in 9.17 and 9.18 version of Mendix.   I hope somebody can help me.
asked
4 answers
2

Hey pierre,

Well, the solution is to add system property as jvm env var: -Daws.region=US-EAST-1

 

You can decompile aws jars to read their code and find the property name.

 

And can you please send the error log messages, so that i can understand the issue better.

Hope it helps!

answered
0

below you find the stack track. I don't know where to add the jav propertie you have writen down. 
Please can you provide me with a screenshot. 

An error occurred while initializing the Runtime: java.lang.reflect.InvocationTargetException

--------

com.mendix.m2ee.api.AdminException: An error occurred while initializing the Runtime: java.lang.reflect.InvocationTargetException
    at com.mendix.basis.impl.MxRuntimeImplBase.start(MxRuntimeImplBase.java:267)

Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: java.lang.reflect.InvocationTargetException
    at com.mendix.basis.conf.CertificateProcessor.afterConfigurationUpdated(CertificateProcessor.scala:38)

Caused by: java.lang.reflect.InvocationTargetException: null
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at com.mendix.container.support.EventProcessorDelegate.$anonfun$sendEvent$3(EventProcessorDelegate.scala:18)
    at scala.collection.immutable.List.foreach(List.scala:333)
    at com.mendix.container.support.EventProcessorDelegate.sendEvent(EventProcessorDelegate.scala:16)
    at com.mendix.container.support.EventProcessor.sendEvent(EventProcessor.scala:24)
    at com.mendix.basis.conf.CertificateProcessor.afterConfigurationUpdated(CertificateProcessor.scala:36)
    at com.mendix.basis.impl.MxRuntimeImplBase.start(MxRuntimeImplBase.java:228)
    at com.mendix.m2ee.appcontainer.actions.StartAction.startRuntime(StartAction.scala:30)
    at com.mendix.m2ee.appcontainer.actions.StartAction.execute(StartAction.scala:17)
    at com.mendix.m2ee.appcontainer.server.handler.HttpAdminHandlerBase.service(HttpAdminHandlerBase.java:128)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:750)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:764)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:529)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1378)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:484)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1300)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
    at org.eclipse.jetty.server.Server.handle(Server.java:562)
    at org.eclipse.jetty.server.HttpChannel.lambda$handle$0(HttpChannel.java:505)
    at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:762)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:497)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:282)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:319)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
    at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
    at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:412)
    at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:381)
    at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:268)
    at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.produce(AdaptiveExecutionStrategy.java:190)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:894)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1038)
    at java.base/java.lang.Thread.run(Thread.java:834)

Caused by: com.amazonaws.SdkClientException: Unable to find a region via the region provider chain. Must provide an explicit region in the builder or setup environment to supply a region.
    at com.amazonaws.client.builder.AwsClientBuilder.setRegion(AwsClientBuilder.java:462)
    at com.amazonaws.client.builder.AwsClientBuilder.configureMutableProperties(AwsClientBuilder.java:424)
    at com.amazonaws.client.builder.AwsSyncClientBuilder.build(AwsSyncClientBuilder.java:46)
    at com.mendix.storage.s3.internal.S3ClientBuilder.build(S3ClientBuilder.scala:48)
    at com.mendix.storage.s3.internal.ClientProvider.createAmazonClient(ClientProvider.scala:93)
    at com.mendix.storage.s3.internal.ClientProvider.updateClient(ClientProvider.scala:53)
    at com.mendix.storage.s3.internal.ClientProvider.onCertificateProcessorReady(ClientProvider.scala:74)
    at com.mendix.storage.s3.internal.AmazonS3StorageService.handleEvent(AmazonS3StorageService.scala:57)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at com.mendix.container.support.EventProcessorDelegate.$anonfun$sendEvent$3(EventProcessorDelegate.scala:18)
    at scala.collection.immutable.List.foreach(List.scala:333)
    at com.mendix.container.support.EventProcessorDelegate.sendEvent(EventProcessorDelegate.scala:16)
    at com.mendix.container.support.EventProcessor.sendEvent(EventProcessor.scala:24)
    at com.mendix.basis.conf.CertificateProcessor.afterConfigurationUpdated(CertificateProcessor.scala:36)
    at com.mendix.basis.impl.MxRuntimeImplBase.start(MxRuntimeImplBase.java:228)
    at com.mendix.m2ee.appcontainer.actions.StartAction.startRuntime(StartAction.scala:30)
    at com.mendix.m2ee.appcontainer.actions.StartAction.execute(StartAction.scala:17)
    at com.mendix.m2ee.appcontainer.server.handler.HttpAdminHandlerBase.service(HttpAdminHandlerBase.java:128)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:750)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:764)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:529)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1378)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:484)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1300)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
    at org.eclipse.jetty.server.Server.handle(Server.java:562)
    at org.eclipse.jetty.server.HttpChannel.lambda$handle$0(HttpChannel.java:505)
    at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:762)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:497)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:282)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:319)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
    at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
    at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:412)
    at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:381)
    at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:268)
    at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.produce(AdaptiveExecutionStrategy.java:190)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:894)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1038)
    at java.base/java.lang.Thread.run(Thread.java:834)

answered
0

I have found the location and after adding the parameter the preview is working.
Thanks a lot.!

answered
0

Hello everyone,

 

I encountered the same problem as Pierre and was able to resolve the issue using a different method, so I just wanted to share this info with the group.

 

The problem generated three different errors and one was related to runtime port 8080 already being in use.  I created a second configuration in the app settings menu and set the runtime port to 8070 and switched to the new configuration prior to running the application locally.  After that, the application started right up without any issues.  See the image below for more details.

 

answered