-
Notifications
You must be signed in to change notification settings - Fork 6
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
coc-java-debug for tomcat7 in docker #8
Comments
Based on the Docker configuration you provided, it looks like you're mapping your host port 9000 to the Java debugger on port 8000 in the container. In that case it would be my expectation to set your "Java Attach" port to 9000 in your .vimspector.json file instead of 5005. {
"adapters": {
"java-debug-server": {
"name": "vscode-java",
"port": "${AdapterPort}"
}
},
"configurations": {
"Java Attach": {
"adapter": "java-debug-server",
"configuration": {
"request": "attach",
"host": "localhost",
"port": "9000"
},
"breakpoints": {
"exception": {
"caught": "N",
"uncaught": "N"
}
}
}
}
} |
@dansomething it hangs on My steps:
here is my docker inspect output maybe there is something in Maven? To ensure that application is debugable: Thanks! |
It does seem like Vimspector may not be connecting to the Java debug server "Adapter". When you debugged it from vscode, what Java debug port did you attach to? Also, what do you see in Vim when you run [coc.nvim] Starting Java debug server...
[coc.nvim] Java debug server started on port: 52737
[coc.nvim] Launching Vimspector with settings: {"AdapterPort":52737}
Paused in thread 1 due to breakpoint |
here is Server configuration file: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener"/>
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on"/>
<Listener className="org.apache.catalina.core.JasperListener"/>
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml"/>
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t "%r" %s %b"/>
</Host>
</Engine>
</Service>
</Server> for debugging in vscode no launch.json need I've realised that I was using tomcat-server debugger in vscode, not vscode-java-debug |
It does look like your Vim is connecting to the debug adapter server since it got a port and is passing that to Vimspector. Its possible Vimspector isn't able to connect to that port, but its unclear why. Are you able to debug a Java project that isn't running in Tomcat or Docker? |
Another thing I noticed, and I'm not that familiar with Docker Compose, is it looks like the way you're defining Based on the Docker compose docs I'd expect your config to look like: environment:
- JPDA_ADDRESS=8000
- JPDA_TRANSPORT=dt_socket |
You were right: Thank you! |
Good day to you!
I have java spring application that runs in docker-container (tomcat7) and I want to debug it from vim.
here is my docker-compose.yml for java app :
my .vimspector.json:
after container runs I'm calling
:CocCommand java.debug.vimspector.start
and
m
after that it loads hangs in 'Attaching in debugee...'
Before that I've had a problem with running java server and it was resolved by using answer:
neoclide/coc-java#99 (comment)
My thoughts, that I have incorrect .vimspector.json config, but at the moment can't figure out what to do.
Will appreciate any help!
Thanks!
The text was updated successfully, but these errors were encountered: