Calling DesiredCapabilities method from one package to other package

Can i call DesiredCapabilities method from one package to other package within my framework where as i am using TestNG to run my test case It means i have made my DesiredCapabilities as a methos in other package to make reusable and i want to call again and again in my TestNg framework whenever my test case fail but in that case getting this error

[TestNG] Running:

log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See for more info.
App installed and open
FAILED: LoginApp
at com.netgearInsight.pageObjectrepoLib.LoginPage.Login(
at com.netgearInsight.testReports.LoginTest.LoginApp(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(
at org.testng.internal.Invoker.invokeMethod(
at org.testng.internal.Invoker.invokeTestMethod(
at org.testng.internal.Invoker.invokeTestMethods(
at org.testng.internal.TestMethodWorker.invokeTestMethods(
at org.testng.TestRunner.privateRun(
at org.testng.SuiteRunner.runTest(
at org.testng.SuiteRunner.runSequentially(
at org.testng.SuiteRunner.privateRun(
at org.testng.SuiteRunnerWorker.runSuite(
at org.testng.TestNG.runSuitesSequentially(
at org.testng.TestNG.runSuitesLocally(
at org.testng.remote.RemoteTestNG.initAndRun(
at org.testng.remote.RemoteTestNG.main(

Default test
Tests run: 1, Failures: 1, Skips: 0

Default suite
Total tests run: 1, Failures: 1, Skips: 0

[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 16 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@57829d67: 20 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@3ac3fd8b: 61 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@2812cbfa: 14 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@1e643faf: 181 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@71be98f5: 18 ms

If anybody have idea please help me