Thanks a lot Thusitha... It worked perfectly. :-) Menaka
On Fri, Feb 26, 2016 at 12:00 PM, Menaka Jayawardena <men...@wso2.com> wrote: > Thank you very much Thusitha for the quick reply. > I'll try it. > > On Fri, Feb 26, 2016 at 11:57 AM, Thusitha Thilina Dayaratne < > thusit...@wso2.com> wrote: > >> Hi Menaka, >> >> According to the debug info that you attached, AFAIU this caused because >> inputStreamHandler >> is null and inputStreamHandler.getOutput() throws NPE. >> I think you can use ServerConfigurationManager instead of CarbonServerManager >> to do the restart. >> >> e.g. >> >> ServerConfigurationManager serverConfigManager = new >> ServerConfigurationManager(automationContext); >> serverConfigManager.restartForcefully(); >> >> >> Thanks >> Thsuitha >> >> On Fri, Feb 26, 2016 at 11:47 AM, Menaka Jayawardena <men...@wso2.com> >> wrote: >> >>> 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 >>> men...@wso2.com >>> Mobile:- +94 71 8851183/ +94 71 3505470 >>> LinkedIn - Menaka Jayawardena >>> <https://lk.linkedin.com/in/menakajayawardena> >>> >>> _______________________________________________ >>> Dev mailing list >>> Dev@wso2.org >>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>> >>> >> >> >> -- >> Thusitha Dayaratne >> Software Engineer >> WSO2 Inc. - lean . enterprise . middleware | wso2.com >> >> Mobile +94712756809 >> Blog alokayasoya.blogspot.com >> About http://about.me/thusithathilina >> >> > > > -- > Menaka Madushanka Jayawardena > Software Engineering Intern > men...@wso2.com > Mobile:- +94 71 8851183/ +94 71 3505470 > LinkedIn - Menaka Jayawardena > <https://lk.linkedin.com/in/menakajayawardena> > -- Menaka Madushanka Jayawardena Software Engineering Intern men...@wso2.com Mobile:- +94 71 8851183/ +94 71 3505470 LinkedIn - Menaka Jayawardena <https://lk.linkedin.com/in/menakajayawardena>
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev