Open Nyllian opened 7 months ago
Nothing is planned at the moment, but whether it is possible depends on how the frmsal.jar works. If it works in a similar way to jnlp (downloading necessary jars locally) then it should be possible. Can you attach a frmsal.jar here?
Attached frmsal.jar frmsal.zip
At first glance the frmsal does exactly the same as the jnlp: connect to the server, download the application jars and then runs them. If the appliation jars haven't changed (and there's no changes in the JDK), then attaching the java agent should work in the same way as it does for JNLP.
I assume you've tried changing the application start command to launching frmsal instead of the jnlp?
Start Application | myjavaapp | java -jar frmsal.jar |
Yes I did and the application starts, but I cannot interact with it. I'm getting the following error : Failed to start application
Here is the log. Testrobotframework_FormsLibrary_LOG.txt
Looks like you are starting the agent on port 50250, but then try to connect to port 50229 instead...
20240418 08:35:52.245 : INFO : Set JAVA_TOOL_OPTIONS=' -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n -javaagent:"C:\Users\IND761\git\IBM_Testrobot\target\pythonlibs\formslibrary.jar"=127.0.0.1:50205:DEBUG'
failed: Connecting remote server at http://127.0.0.1:50229
I think it's radomly generated these ports? I can change the javaagent port and the apport but still the same result. When port & apport are the same, the app starts but is not reported back to the robotframework.
20240418 12:44:07.881 : INFO : Set JAVA_TOOL_OPTIONS=' -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n -javaagent:"C:\Users\IND761\git\IBM_Testrobot\target\pythonlibs\formslibrary.jar"=127.0.0.1:61111:APPORT=61111:DEBUG' 20240418 12:44:07.887 : INFO : Set _JAVA_OPTIONS='-Djava.security.policy="C:\Users\IND761\AppData\Local\Temp\grant_all_e9ztv6xr.policy" -Drobot.output_dir="C:\Users\IND761\git\IBM_Testrobot"' 20240418 12:44:07.888 : INFO : Starting process: "C:\Program Files\Java\jre1.8.0_131\bin\java" -jar "C:\Program Files\Mecoms\lib\frmsal.jar" -url "https://imdms-frm-o1.al.ndis.be/forms/frmservlet?config=ENV" 20240418 12:45:07.902 : INFO : Failed to start application: Traceback (most recent call last): File "C:\Users\IND761\git\IBM_Testrobot\target\pythonlibs\formslibrary.jar\FormsLibrary.py", line 382, in start_application self._application_started(alias, timeout=timeout, name_contains=name_contains, accept_old=False) File "C:\Users\IND761\git\IBM_Testrobot\target\pythonlibs\formslibrary.jar\FormsLibrary.py", line 430, in _application_started url = self._get_agent_address(name_contains, accept_old) File "C:\Users\IND761\git\IBM_Testrobot\target\pythonlibs\formslibrary.jar\FormsLibrary.py", line 451, in _get_agent_address raise FormsLibraryTimeoutError('Agent port not received before timeout') FormsLibrary.FormsLibraryTimeoutError: Agent port not received before timeout
20240418 12:45:07.903 : INFO : Waiting for process to complete. 20240418 12:45:07.916 : INFO : Process did not complete in 10 milliseconds. 20240418 12:45:07.917 : INFO : Leaving process intact. 20240418 12:45:07.917 : INFO : Process is running, but application startup failed 20240418 12:45:07.918 : INFO : starting process "C:\Program Files\Java\jre1.8.0_131\bin\java" -jar "C:\Program Files\Mecoms\lib\frmsal.jar" -url "https://imdms-frm-o1.al.ndis.be/forms/frmservlet?config=ENV" 20240418 12:45:07.918 : FAIL : FormsLibraryTimeoutError: Agent port not received before timeout
mmm.. maybe the ports aren't supposed to be the same. It's been a while since I worked on this...
Can you try if the agent part alone is working, by starting the application and then checking if it is listening on the port? (e.g. using netstat -an
Use something like this to set the environment variable and start the application (adjust if needed for the shell that you are using...)
Set JAVA_TOOL_OPTIONS=' -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n -javaagent:"C:\Users\IND761\git\IBM_Testrobot\target\pythonlibs\formslibrary.jar"=127.0.0.1:50205:DEBUG'
C:\Program Files\Java\jre1.8.0_131\bin\java -jar "C:\Program Files\Mecoms\lib\frmsal.jar" -url "https://imdms-frm-o1.al.ndis.be/forms/frmservlet?config=ENV"
If that works, then try to use the connect to application
instead of start application
to connect the robot to the running application...
The agent is (kinda) working when I run the test - however it's starting on a different port than supplied.
The remote server cannot start because of the refused connection.
Set JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,address=8800,server=y,suspend=n -javaagent:"C:\Users\IND761\git\IBM_Testrobot\target\pythonlibs\formslibrary.jar"=127.0.0.1:61111:DEBUG
Still it started the app on port 63401.
Trying to connect to Class:javax.swing.JFrame Name:frame0 Visible:false AppContext:sun.awt.AppContext[threadGroup=system]
Trying to connect to Class:java.awt.Frame Name:frame1 Visible:false AppContext:sun.awt.AppContext[threadGroup=system]
Trying to connect to Class:oracle.forms.engine.Splashscreen Name:win0 Visible:true AppContext:sun.awt.AppContext[threadGroup=system]
Trying to connect to Class:oracle.ewt.swing.JBufferedFrame Name:JBufferedFrame0 Visible:true AppContext:sun.awt.AppContext[threadGroup=system]
Connected to Class:oracle.ewt.swing.JBufferedFrame Name:JBufferedFrame0 Visible:true AppContext:sun.awt.AppContext[threadGroup=system]
Forms sessie-ID is WLS_FORMS.formsapp.568
De proxyhost is null en de proxypoort is 0.
Native HTTP-implementatie wordt gebruikt voor de verbinding.
De verbindingsmodus is HTTPS.
Using org.netbeans.jemmy.drivers.DefaultDriverInstaller driver installer
log4j:WARN No appenders could be found for logger (org.robotframework.remoteserver.RemoteServer).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
2024-04-18 16:18:35.248:INFO:oejs.Server:jetty-7.x.y-SNAPSHOT
2024-04-18 16:18:35.271:INFO:oejsh.ContextHandler:started o.e.j.s.ServletContextHandler{/,null}
Versie van Forms applet is 12.2.1.4
2024-04-18 16:18:35.331:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:63401
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.
Getting closer. Maybe you also need to set this option to allow access to the agent:
20240418 12:44:07.887 : INFO : Set _JAVA_OPTIONS='-Djava.security.policy="C:\Users\IND761\AppData\Local\Temp\grant_all_e9ztv6xr.policy"
Unfortunatly, same result - I'm even trying from cmd.exe
Launching the app from a .bat file
set JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n -javaagent:"C:\Users\IND761\git\IBM_Testrobot\target\pythonlibs\formslibrary.jar"=127.0.0.1:61111:APPORT=61110:DEBUG set _JAVA_OPTIONS=-Djava.security.policy="C:\Users\IND761\AppData\Local\Temp\grant_all_e9ztv6xr.policy" java.exe -jar "C:\Program Files\Mecoms\lib\frmsal.jar" -url "https://imdms-frm-o1.al.ndis.be/forms/frmservlet?config=ENV&userid=IND761/999_azerty"
When I play around with port & apport - still cannot connect. port 61110 is LISTENING 20240419 12:08:53.534 : INFO : Environment variable 'JAVA_TOOL_OPTIONS' set to value '-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n -javaagent:"C:\Users\IND761\git\IBM_Testrobot\target\pythonlibs\formslibrary.jar"=127.0.0.1:61111:APPORT=61110:DEBUG'. 20240419 12:08:53.535 : INFO : Environment variable '_JAVA_OPTIONS' set to value '-Djava.security.policy="C:\Users\IND761\AppData\Local\Temp\grant_all_e9ztv6xr.policy"'. 20240419 12:08:53.539 : INFO : Link to stdout 20240419 12:08:53.539 : INFO : Link to stderr 20240419 12:08:53.539 : INFO : Set JAVA_TOOL_OPTIONS=' -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n -javaagent:"C:\Users\IND761\git\IBM_Testrobot\target\pythonlibs\formslibrary.jar"=127.0.0.1:57848:APPORT=61110:DEBUG' 20240419 12:08:53.543 : INFO : Set _JAVA_OPTIONS='-Djava.security.policy="C:\Users\IND761\AppData\Local\Temp\grant_all_rk4dmt0z.policy" -Drobot.output_dir="C:\Users\IND761\git\IBM_Testrobot"' 20240419 12:08:53.545 : INFO : Starting process: "C:\Program Files\Java\jre1.8.0_131\bin\java" -jar "C:\Program Files\Mecoms\lib\frmsal.jar" -url "https://imdms-frm-o1.al.ndis.be/forms/frmservlet?config=ENV" 20240419 12:08:53.554 : INFO : connecting to started application at 127.0.0.1:61110 20240419 12:10:04.297 : INFO : Failed to start application: Traceback (most recent call last): File "C:\Python37\lib\site-packages\robot\running\dynamicmethods.py", line 52, in call return self._handle_return_value(self.method(*args)) File "C:\Users\IND761\git\IBM_Testrobot\target\pythonlibs\formslibrary.jar\FormsLibrary.py", line 554, in get_keyword_names kw in self.current.get_keyword_names(attempts=attempts) File "C:\Python37\lib\site-packages\robot\libraries\Remote.py", line 74, in get_keyword_names % (self._uri, error)) RuntimeError: Connecting remote server at http://127.0.0.1:61110 failed: <Fault 0: 'Failed to invoke method get_keyword_names in class org.robotframework.remoteserver.servlet.ServerMethods: java.lang.RuntimeException: No keywords found in the test library'>
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Python37\lib\site-packages\robot\running\testlibraries.py", line 218, in _create_handlers names = self._get_handler_names(libcode) File "C:\Python37\lib\site-packages\robot\running\testlibraries.py", line 398, in _get_handler_names return GetKeywordNames(instance)() File "C:\Python37\lib\site-packages\robot\running\dynamicmethods.py", line 55, in call % (self.method.name, get_error_message())) robot.errors.DataError: Calling dynamic method 'get_keyword_names' failed: Connecting remote server at http://127.0.0.1:61110 failed: <Fault 0: 'Failed to invoke method get_keyword_names in class org.robotframework.remoteserver.servlet.ServerMethods: java.lang.RuntimeException: No keywords found in the test library'>
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Python37\lib\site-packages\robot\libraries\BuiltIn.py", line 2732, in import_library self._namespace.import_library(name, list(args)) File "C:\Python37\lib\site-packages\robot\running\namespace.py", line 123, in import_library notify=notify) File "C:\Python37\lib\site-packages\robot\running\namespace.py", line 128, in _import_library import_setting.alias, self.variables) File "C:\Python37\lib\site-packages\robot\running\importer.py", line 44, in import_library lib = self._import_library(name, positional, named, lib) File "C:\Python37\lib\site-packages\robot\running\importer.py", line 66, in _import_library lib.create_handlers() File "C:\Python37\lib\site-packages\robot\running\testlibraries.py", line 100, in create_handlers self._create_handlers(self.get_instance()) File "C:\Python37\lib\site-packages\robot\running\testlibraries.py", line 222, in _create_handlers % (self.name, message), details) robot.errors.DataError: Getting keyword names from library 'FormsLibrary' failed: Calling dynamic method 'get_keyword_names' failed: Connecting remote server at http://127.0.0.1:61110 failed: <Fault 0: 'Failed to invoke method get_keyword_names in class org.robotframework.remoteserver.servlet.ServerMethods: java.lang.RuntimeException: No keywords found in the test library'>
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\IND761\git\IBM_Testrobot\target\pythonlibs\formslibrary.jar\FormsLibrary.py", line 382, in start_application self._application_started(alias, timeout=timeout, name_contains=name_contains, accept_old=False) File "C:\Users\IND761\git\IBM_Testrobot\target\pythonlibs\formslibrary.jar\FormsLibrary.py", line 435, in _application_started self.ROBOT_NAMESPACE_BRIDGE.re_import_formslibrary() File "C:\Users\IND761\git\IBM_Testrobot\target\pythonlibs\formslibrary.jar\FormsLibrary.py", line 152, in re_import_formslibrary BuiltIn().import_library(name, *self.args) File "C:\Python37\lib\site-packages\robot\libraries\BuiltIn.py", line 2734, in import_library raise RuntimeError(unic(err)) RuntimeError: Getting keyword names from library 'FormsLibrary' failed: Calling dynamic method 'get_keyword_names' failed: Connecting remote server at http://127.0.0.1:61110 failed: <Fault 0: 'Failed to invoke method get_keyword_names in class org.robotframework.remoteserver.servlet.ServerMethods: java.lang.RuntimeException: No keywords found in the test library'>
20240419 12:10:04.298 : INFO : Waiting for process to complete. 20240419 12:10:04.319 : INFO : Process did not complete in 10 milliseconds. 20240419 12:10:04.319 : INFO : Leaving process intact. 20240419 12:10:04.319 : INFO : Process is running, but application startup failed 20240419 12:10:04.320 : INFO : starting process "C:\Program Files\Java\jre1.8.0_131\bin\java" -jar "C:\Program Files\Mecoms\lib\frmsal.jar" -url "https://imdms-frm-o1.al.ndis.be/forms/frmservlet?config=ENV" 20240419 12:10:04.321 : FAIL : Getting keyword names from library 'FormsLibrary' failed: Calling dynamic method 'get_keyword_names' failed: Connecting remote server at http://127.0.0.1:61110 failed: <Fault 0: 'Failed to invoke method get_keyword_names in class org.robotframework.remoteserver.servlet.ServerMethods: java.lang.RuntimeException: No keywords found in the test library'>
I guess some proper debugging will be required to figure out why it's not working. This is about all I can do remotely without access to an oracle forms environment.
Any chance there is gonne be support for the stand-alone version of the Oracle Forms? JNLP worked great but with the new Oracle Java SE subscriptions it is getting difficult to use webstarts.