Hello,

I tried to restart the server using Automation Framework but it throws the
following exception.

java.lang.NullPointerException
at
org.wso2.carbon.automation.extensions.servers.carbonserver.CarbonServerManager.restartGracefully(CarbonServerManager.java:306)
at
org.wso2.carbon.iot.integration.web.ui.test.samples.SampleInstallationTest.serverRestartTest(SampleInstallationTest.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1198)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1123)
at org.testng.TestNG.run(TestNG.java:1031)
at
org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:295)
at
org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)
at
org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:90)
at
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)


I used the following piece of code for restart.

CarbonServerManager serverManager = new CarbonServerManager(automationContext);
try {
    serverManager.restartGracefully();
} catch (AutomationFrameworkException e) {
    log.error("Restart failed....");
}

When I debug the code, I get null values for all the fields of
serverManager.
I have attached the screenshot here.

​
What would be the reason for this?

Thank you very much
Menaka Madushanka
-- 
Menaka Madushanka Jayawardena
Software Engineering Intern
[email protected]
Mobile:- +94 71 8851183/ +94 71 3505470
LinkedIn - Menaka Jayawardena <https://lk.linkedin.com/in/menakajayawardena>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to