【发布时间】:2014-03-13 12:44:35
【问题描述】:
我正在尝试重放通过 RMI 对服务器客户端-服务器应用程序进行调用的负载运行程序脚本。 RMI 服务和注册表在服务器上运行良好,因为其他应用程序能够连接并正常工作。
当我尝试重放 LoadRunner 脚本时,我低于堆栈跟踪:
Virtual User Script started at : 2014-03-13 11:03:29
Starting action vuser_init.
Ending action vuser_init.
Running Vuser...
Starting iteration 1.
Starting action Actions.
java.rmi.registry.LocateRegistry.getRegistry("mycompamny.abc.xyz.com", 25002, [RMIClientSocketFactory])
sun.rmi.registry.RegistryImpl_Stub.lookup("XMLS")
Error: System.err: java.net.MalformedURLException--Error
System.err: at java.net.URL.<init>(URL.java:601)--Error
System.err: at java.net.URL.<init>(URL.java:464)--Error
System.err: at java.net.URL.<init>(URL.java:413)--Error
System.err: at murex.shared.fs.Connection.<init>(Connection.java:43)--Error
System.err: at murex.shared.property.Properties.fillRMIProperties(Properties.java:231)--Error
System.err: at murex.shared.property.Properties.getObjProperty(Properties.java:91)--Error
System.err: at murex.shared.property.Properties.getProperty(Properties.java:80)--Error
System.err: at murex.apps.middleware.client.core.server.transport.rpc.tcp.socket.SocketUtilities.setSocket(SocketUtilities.java:81)--Error
System.err: at murex.apps.middleware.client.core.server.transport.rpc.tcp.socket.CompressedRMISocketFactory.createSocket(CompressedRMISocketFactory.java:29)--Error
System.err: at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)--Error
System.err: at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)--Error
System.err: at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)--Error
System.err: at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)--Error
System.err: at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)--Error
System.err: at Actions.action(Actions.java:105)--Error
Error: System.err: java.lang.NullPointerException--Error
System.err: at murex.apps.middleware.client.core.server.transport.rpc.tcp.socket.CompressedSocket.getOutputStream(CompressedSocket.java:67)--Error
System.err: at sun.rmi.transport.tcp.TCPConnection.getOutputStream(TCPConnection.java:66)--Error
System.err: at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:202)--Error
System.err: at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)--Error
System.err: at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)--Error
System.err: at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)--Error
System.err: at Actions.action(Actions.java:105)--Error
Error: java.lang.NullPointerException
Error: at murex.apps.middleware.client.core.server.transport.rpc.tcp.socket.CompressedSocket.getOutputStream(CompressedSocket.java:67)
at sun.rmi.transport.tcp.TCPConnection.getOutputStream(TCPConnection.java:66)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:202)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at Actions.action(Actions.java:105)
Abort was called from an action.
Ending Vuser...
Starting action vuser_end.
Ending action vuser_end.
Vuser Terminated.
我看到“MalformedURLException”,但我们传递的 URL 没有问题。请帮我解决这个问题。
【问题讨论】:
-
你传递的网址到底是什么?您可能认为它“很好”,但不幸的是 Java 不同意您的看法。
-
是的,这个 URL 很好,虽然我在论坛里把它掩盖了一点。其他内部工具正在使用相同的 URL 进行连接,我也可以 ping 它。
-
不,该 URL 不是“好”,否则您不会得到异常。你需要接受这一点,并停止相反的断言。 什么是 URL? 在 murex.shared.fs.Connection.
(Connection.java:43) 构造函数中构造的那个? -
我在由 LoadRunner 生成的 Actions.java 中传递如下 URL:_registry1 = java.rmi.registry.LocateRegistry.getRegistry("abcd.usa.mycompany.com", 26001, _compressedrmisocketfactory1 ); Connection.java 和许多其他支持类是由 LoadRunner 创建的。
标签: java rmi performance-testing loadrunner malformedurlexception