cloudstack-users-cn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "hellozengsong@gmail" <hellozengs...@gmail.com>
Subject 源码中的XenApi引用对象是指哪个对象
Date Tue, 28 May 2013 08:26:31 GMT
各位好,今天在研究cloudstack源码对xenserver操作时,需要传入个ref也就是:
  /**
     * The XenAPI reference to this object.
     */
    protected final String ref;

在测试对xenserver操作类中我是这样写的:
Host host=new Host("");
String hostName=host.getHostname(conn);
System.out.println(hostName);

run jUnit

show error:
You gave an invalid object reference.  The object may have recently been deleted.  The class
parameter gives the type of reference given, and the handle parameter echoes the bad value
given.
at com.xensource.xenapi.Types.checkResponse(Types.java:195)
at com.xensource.xenapi.Connection.dispatch(Connection.java:356)
at com.xensource.xenapi.Host.getHostname(Host.java:887)
at com.cloud.hypervisor.xen.resource.XenServerTest.testConn(XenServerTest.java:38)
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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
不知有哪位可以为小弟解惑。



hellozengsong@gmail
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message