Array passing for input parameter

techhunt
2011-06-16
2012-11-29
  • techhunt

    techhunt - 2011-06-16

    I am finding difficulty in passing array of bytes as an argument .

    This is the class definiton:
    class __PARAMETERS
    {
                                              uint16 PasswordLen;
                                              uint8 Password;
    };

    I am trying to pass this password in parameter as follows :

    inParams = setAssetTag.getInParameters();

    Byte scancodes = {30,46,18,19,0,0,0,0};
    JIArray codes = new JIArray(scancodes);

    inParams.getObjectDispatcher().put("PasswordLen", new JIVariant(4));
    inParams.getObjectDispatcher().put("Password", new JIVariant(codes));

    It is always giving exception
    org.jinterop.dcom.impls.automation.JIAutomationException: Exception occurred. 

    how to create and pass input parameter array?

     
  • GFeng

    GFeng - 2012-09-13

    I meet this problem as well. Anyone know the solution?

    I have tried input the array itself, but doesn't work.

     
  • GFeng

    GFeng - 2012-09-13

    the full stack trace is

    16473  ERROR test.TestMainApp  - Exception occurred. 
    16473  ERROR test.TestMainApp  - Exception occurred. 
    16474  ERROR test.TestMainApp  - org.jinterop.dcom.impls.automation.JIAutomationException: Exception occurred. 
    at org.jinterop.dcom.impls.automation.JIDispatchImpl.invoke(JIDispatchImpl.java:333)
    at org.jinterop.dcom.impls.automation.JIDispatchImpl.put(JIDispatchImpl.java:391)
    at org.jinterop.dcom.impls.automation.JIDispatchImpl.put(JIDispatchImpl.java:662)
    at org.abc.hyperv2.migration.MsvmVirtualSystemMigrationService.checkSystemCompatibilityInfo(MsvmVirtualSystemMigrationService.java:58)
    at test.MigrationTest.testGetSystemCompatibilityInfo(MigrationTest.java:111)
    at test.MigrationTest.testGetServiceSWbemServices(MigrationTest.java:81)
    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:601)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    at org.junit.runners.Suite.runChild(Suite.java:128)
    at org.junit.runners.Suite.runChild(Suite.java:24)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:136)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:117)
    at test.TestMainApp.main(TestMainApp.java:23)
    Caused by: org.jinterop.dcom.common.JIRuntimeException: Exception occurred. 
    at org.jinterop.dcom.core.JICallBuilder.readResult(JICallBuilder.java:1082)
    at org.jinterop.dcom.core.JICallBuilder.read(JICallBuilder.java:960)
    at ndr.NdrObject.decode(NdrObject.java:36)
    at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:137)
    at rpc.Stub.call(Stub.java:113)
    at org.jinterop.dcom.core.JIComServer.call(JIComServer.java:959)
    at org.jinterop.dcom.core.JIComServer.call(JIComServer.java:914)
    at org.jinterop.dcom.core.JIComObjectImpl.call(JIComObjectImpl.java:268)
    at org.jinterop.dcom.core.JIComObjectImpl.call(JIComObjectImpl.java:155)
    at org.jinterop.dcom.impls.automation.JIDispatchImpl.invoke(JIDispatchImpl.java:315)
    … 36 more

    16474  ERROR test.TestMainApp  - org.jinterop.dcom.impls.automation.JIAutomationException: Exception occurred. 
    at org.jinterop.dcom.impls.automation.JIDispatchImpl.invoke(JIDispatchImpl.java:333)
    at org.jinterop.dcom.impls.automation.JIDispatchImpl.put(JIDispatchImpl.java:391)
    at org.jinterop.dcom.impls.automation.JIDispatchImpl.put(JIDispatchImpl.java:662)
    at org.abc.hyperv2.migration.MsvmVirtualSystemMigrationService.checkSystemCompatibilityInfo(MsvmVirtualSystemMigrationService.java:58)
    at test.MigrationTest.testGetSystemCompatibilityInfo(MigrationTest.java:111)
    at test.MigrationTest.testGetServiceSWbemServices(MigrationTest.java:81)
    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:601)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    at org.junit.runners.Suite.runChild(Suite.java:128)
    at org.junit.runners.Suite.runChild(Suite.java:24)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:136)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:117)
    at test.TestMainApp.main(TestMainApp.java:23)
    Caused by: org.jinterop.dcom.common.JIRuntimeException: Exception occurred. 
    at org.jinterop.dcom.core.JICallBuilder.readResult(JICallBuilder.java:1082)
    at org.jinterop.dcom.core.JICallBuilder.read(JICallBuilder.java:960)
    at ndr.NdrObject.decode(NdrObject.java:36)
    at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:137)
    at rpc.Stub.call(Stub.java:113)
    at org.jinterop.dcom.core.JIComServer.call(JIComServer.java:959)
    at org.jinterop.dcom.core.JIComServer.call(JIComServer.java:914)
    at org.jinterop.dcom.core.JIComObjectImpl.call(JIComObjectImpl.java:268)
    at org.jinterop.dcom.core.JIComObjectImpl.call(JIComObjectImpl.java:155)
    at org.jinterop.dcom.impls.automation.JIDispatchImpl.invoke(JIDispatchImpl.java:315)
    … 36 more

     

Log in to post a comment.