NullPointerException when recording

I am not able to record anything. I think this is due to a Catalon recorder needing a port that is already being used. Is there a way to specify what port should be used? However, even if this is possible, I dont think the system should throw a nullpointerexception. So maybe the Devs should look into this? Here is the log with the errors for reference:

MultiException[java.net.BindException: Address already in use: bind, java.net.BindException: Address already in use: bind]
at org.eclipse.jetty.server.Server.doStart(Server.java:353)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at com.kms.katalon.objectspy.websocket.AddonSocketServer.start(AddonSocketServer.java:62)
at com.kms.katalon.composer.webui.recorder.dialog.RecorderDialog$1.run(RecorderDialog.java:266)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
Suppressed: java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:317)
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:235)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.server.Server.doStart(Server.java:390)
… 4 more
Caused by: java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:317)
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:235)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.server.Server.doStart(Server.java:390)
… 4 more
Warning: NLS unused message: HAND_INSTANT_BROWSERS_DIA_MESSAGE in: com.kms.katalon.objectspy.constants.objectspyMessages
Warning: NLS unused message: HAND_INSTANT_BROWSERS_DIA_TITLE in: com.kms.katalon.objectspy.constants.objectspyMessages
Warning: NLS unused message: INSTANT_BROWSER_PREFIX in: com.kms.katalon.objectspy.constants.objectspyMessages
Warning: NLS unused message: MENU_ITEM_INSTANT_BROWSERS in: com.kms.katalon.objectspy.constants.objectspyMessages
Warning: NLS unused message: PREF_LBL_INSTANT_BROWSER_PORT in: com.kms.katalon.objectspy.constants.objectspyMessages
Warning: NLS unused message: PREF_LBL_INSTANT_BROWSER_PORT_DO_NOT_SHOW_WARNING_DIALOG in: com.kms.katalon.objectspy.constants.objectspyMessages
Mär 02, 2018 9:31:00 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFORMATION: Detected dialect: W3C

!ENTRY org.eclipse.e4.ui.workbench 4 0 2018-03-02 09:31:01.301
!MESSAGE
!STACK 0
java.lang.NullPointerException
at com.kms.katalon.composer.webui.recorder.core.RecordSession.handleForFirefoxAddon(RecordSession.java:73)
at com.kms.katalon.objectspy.core.InspectSession.runSeleniumWebDriver(InspectSession.java:187)
at com.kms.katalon.objectspy.core.InspectSession.run(InspectSession.java:152)
at java.lang.Thread.run(Thread.java:745)
Mär 02, 2018 9:31:02 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFORMATION: Detected dialect: W3C

!ENTRY org.eclipse.e4.ui.workbench 4 0 2018-03-02 09:31:16.241
!MESSAGE
!STACK 0
java.lang.NullPointerException
at com.kms.katalon.composer.webui.recorder.core.RecordSession.handleForFirefoxAddon(RecordSession.java:73)
at com.kms.katalon.objectspy.core.InspectSession.runSeleniumWebDriver(InspectSession.java:187)
at com.kms.katalon.objectspy.core.InspectSession.run(InspectSession.java:152)
at java.lang.Thread.run(Thread.java:745)

Can you provide more steps how do you observe this issue? Any screenshots will help

katalon_error.png

Hi Marco,

Thanks for your screenshot. The root cause of this error message is Firefox can’t be started due to allocated port has been used somewhere. It’s strange because Firefox will use random port number from your machine to start this.

Do you have Firefox opened currently? Can you try to terminate your Firefox process and try again?

Hello Vinh Nguyen, thank you for getting back to me I really apreciate that.

To answer your question, there is currenty no Firefox instance running (i have double checked this using netstat -anb). For reference here are the versions im using:

Firefox 58.0.2 (64-Bit)
Windows 10 Pro 64-bit
Katalon Version: 5.3.1

Question: there is no way to tell either Katalon recorder or Firefox (or the geckodriver.exe) what port should be used? I think if i could specify what port to use this might be enough to solve my Problem.

Best regards,
Marco

Just another potentialy important bit of Information: it is not that Firefox doesn’t start. It does start. The recording however is what is not working (when I use Firefox).

Hi Marco,

Can you use the following commands to see if there any applications using these ports?

netstat -na | find “8080”

netstat -na | find “50001”

hey there was indeed a process running at port 50001. After I killed it it worked beautifully. Thanks a lot Vinh :slight_smile: