Debugging lucee in vs code


#1

anyone using vs code to debug lucee? if so can you provide some info on how to get setup to build and debug the source? I followed the below link, but it seems like I am only getting errors trying to use maven in vs code.


#2

I think if you are debugging the actual lucee codebase I would suggest you use Eclipse as (AFAIK) that is how @micstriit and @isapir do it.

I don’t think Code is setup to debug Java? I could be wrong though.


#3

I use IntelliJ IDEA, but right.


#4

I have used VS Code for some other java projects with maven. It kind of works with this project, but it always fails when running the tests. Also, it sets up some default debugging configurations (I assume this is based on the pom.xml file), but none of them seem to work.

I tried IntelliJ and imported the maven project. It imports 2 modules “Core” and “Loader”. I tried to debug both of them and receive the below error message. Maybe I am missing something, any help would be appreciated. I haven’t tried eclipse yet, so maybe I will make that my next attempt.

[INFO] Scanning for projects...
[INFO] Inspecting build with total of 1 modules...
[INFO] Installing Nexus Staging features:
[INFO]   ... total of 1 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.301s
[INFO] Finished at: Mon Jun 18 18:00:04 MDT 2018
[INFO] Final Memory: 7M/16M
[INFO] ------------------------------------------------------------------------
[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoGoalSpecifiedException

#5

as per the docs, i think you need to pass in either test or fast to maven?


#6

Cool IDE - pity they had to remove the debugging capabilities years ago! I hope they take another look at re-introducing it for Lucee.


#7

I found this video https://www.youtube.com/watch?v=CXA728Rin64 in another post searching for some tips. So I think my approach is all wrong anyways. How can you make changes to the lucee code and be able to step into it using the java debugger? Is there some type of main method or something to start from or do you have to create a tomcat project and add the jar in some way to step into it?


#8

has anyone tried this new debugging approach called time travelling?

here is a interesting debugging adventure with the webkit javascript engine

this software lets you do the same with java (free license for open source)
http://chrononsystems.com/what-is-chronon/technology


#9

It is time for us to get a debugger that works in VSCode. IntelliJ, nice but not nice. Who loads an entire app to step out of code flow to do debugging? Eclipse, like thinking there. We want to grow the community and inline with the IDE is the only way to provide what all the other popular platforms are providing inside VSCode.


#10

What do you mean “get” ? Why not contribute one rather than expect to be given stuff?

I understood this thread was to actually debug Lucee Java code rather than CFML application code?


#11

There WAS a plain class that started up a simple server that you can then debug the Java line execution. As you say, doing ant builds is all well and good to get the latest version but what you need is how you debug as you are writing code to extend Lucee.

Maybe @micstriit can chime in and let us know?

In Railo there was a runner but for the life of me I cannot remember the name of the class. It basically created a Jetty instance and added the RailoServelet and configs and what not.


#12


This is the Lucee debug project, it has a file that will create a jetty instance and set-up all the contexts and servlets for you. The file that does it is RunAsJavaApplication.


#13

Aha, thanks for that! This is what you run under Eclipse in debug mode (as a Java Application) that allows you to step through the Lucee Java Code.