Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't start xdebug: java.nio.charset.IllegalCharsetNameException #261

Open
mlocati opened this issue Dec 6, 2023 · 3 comments
Open

Can't start xdebug: java.nio.charset.IllegalCharsetNameException #261

mlocati opened this issue Dec 6, 2023 · 3 comments
Labels

Comments

@mlocati
Copy link
Contributor

mlocati commented Dec 6, 2023

Describe the bug
I'm trying to start an Xdebug session of a local PHP script, but it fails and I have the following entry in the log file:

!ENTRY org.eclipse.php.debug.core 4 4 2023-12-06 08:58:36.720
!MESSAGE class org.eclipse.php.internal.debug.core.xdebug.communication.XDebugCommunicationDaemon$CommunicationDaemon : Unexpected Exception: Listener thread still listening
!STACK 0
java.nio.charset.IllegalCharsetNameException: 
	at java.base/java.nio.charset.Charset.checkName(Charset.java:300)
	at java.base/java.nio.charset.Charset.lookup2(Charset.java:496)
	at java.base/java.nio.charset.Charset.lookup(Charset.java:476)
	at java.base/java.nio.charset.Charset.isSupported(Charset.java:517)
	at org.eclipse.php.internal.debug.core.xdebug.dbgp.session.DBGpSession.getCharset(DBGpSession.java:777)
	at org.eclipse.php.internal.debug.core.xdebug.dbgp.session.DBGpSession.determineEncodings(DBGpSession.java:756)
	at org.eclipse.php.internal.debug.core.xdebug.dbgp.session.DBGpSession.setDebugTarget(DBGpSession.java:599)
	at org.eclipse.php.internal.debug.core.xdebug.dbgp.model.DBGpTarget.SessionCreated(DBGpTarget.java:2164)
	at org.eclipse.php.internal.debug.core.xdebug.dbgp.session.DBGpSessionHandler.fireSessionAdded(DBGpSessionHandler.java:121)
	at org.eclipse.php.internal.debug.core.xdebug.communication.XDebugCommunicationDaemon$CommunicationDaemon.startConnection(XDebugCommunicationDaemon.java:223)
	at org.eclipse.php.internal.debug.core.daemon.AbstractDebuggerCommunicationDaemon$ReceiverThread.run(AbstractDebuggerCommunicationDaemon.java:215)
	at java.base/java.lang.Thread.run(Thread.java:1583)

Describe the eclipse environment
Eclipse 2023-09 (4.29)
PDT 8.2.0.202310152040

Describe your system

  • OS: Windows
  • Version 11 23H2
@mlocati mlocati added the bug label Dec 6, 2023
@kristianoye
Copy link

This is happening for me, and it is now July 2024. My configuration is similar to the original poster:

Environment:
Eclipse 2023-09 (4.32)
PDT Eclipse PDT 8.2.0.2023 11292129

System

  • OS: Windows x64
  • Version 11 23H2
  • java 20.0.1 2023-04-18

@kristianoye
Copy link

@mlocati I finally figured out how to fix this myself. I found that the transfer and output encoding values were unset in the launch parameters. You can configure these values using the PHP Debug configuration Window->Preference under PHP/Debug:
image

After I set both values to UTF8 I was able to debug successfully.

@kristianoye
Copy link

FYI: I would still consider this a bug since:

  1. The DBGpSession class' getCharset() was unable to devise a workable, default character set, and,
  2. The debug session entered a sort of "hung" state

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants