Debug Java

3
I had done it, and now it doesn't work anymore. It might be related to my inadvertently updating the Java JRE to version 19. What happens is this: 1. I run a Mendix application 2. I open Eclipse. It shows the correct javasource in package explorer, it shows all Mendix libraries belonging to the project I run, there's no error in any java source, the java jre is set to the jdk that's used in Mendix, the debug configuration points to the correct javasource and has com.mendix.externalinterface.menu.ConsoleMenu as main class. That's (as far as I know) the same as worked before. However, if I know run debug on this source as a java application, I get the following message on the console: Mendix XML Application Server Version: 2.4.4.1 - r9990 - 2009-10-13 16:09:14 Copyright © 2003-2009 Mendix bv. All rights reserved. Java(TM) SE Runtime Environment (build 1.6.0_16-b01) Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode) Running on x86 Windows XP 5.1 1: Start XAS in DEVELOPMENT mode 2: Start XAS in TESTING mode x: Shutdown Type your choice and press <Enter> to continue: Apparently, it doesn't recognise my XAS is already running. If I choose (what else?) the error message is Error: no files found in WEB-INF/model/ r: Retry reading WEB-INF/model/ x: Shutdown Type your choice and press <Enter> to continue: What can be wrong and how to repair it? Kees
asked
4 answers
3

When debugging java, you should not start the application from the modeler, you should only deploy it (or start and stop it). After the deployment you should be able to start the application (again) by using eclipse using your debug configuration.

In general, you cannot debug an application with eclipse which was started using the modeler*. I am not sure however, whether this incorrect starting of the debug session is related to the files not found error.

(*it is possible using the java -Xdebug flags, but in general there is no reason to use this approach)

answered
3

Dat werkt helaas niet.

Ik deploy (dus geen deploy en run). Dan start ik eclipse op en probeer de applicatie te runnen (run as application, eventueel debug as application). Dat geeft precies de bovenstaande meldingen. Omdat de applicatie dan niet runt, kan ik overigens ook in mijn browser niets doen.

Het lijkt erop dat het juiste main-programma draait. De vraag of de XAS in development of test-modus gedraaid moet worden is een hele redelijke vraag en kan alleen maar uit Mendix komen. En de melding "no files found in WEB-INF/model/" is ook specifiek voor Mendix. De enige google-hit is onderstaande vraag met antwoord van Johan.

Dat antwoord van Johan in https://forum.mendix.com/questions/655/Debug-Java-actions-in-Eclipse-no-files-found op dezelfde vraag een tijdje geleden is overigens niet helemaal juist. In de WEB-INF/model staat alleen de .mdp en een hele serie .sql's. Geen class-files. Die staan in de javasource, netjes in dezelfde map als de .java source files.

Blijft de vraag waarom de applicatie vanuit Eclipse niet wil draaien met deze merkwaardige foutmelding. Wat zoekt-ie in WEB-INF/model en waarom staat het er niet? Het lijkt me toch echt dat dit aan de Mendix-applicatie ligt.

answered
3

You might be using the wrong build path: Project > rechtermuisknop > Build Path > Source Tab > Default output folder: should be: WEB-INF/model.

Further your javasource directory must be listed under 'source folders under build path'

answered
0

Sorry, verkeerde link hierboven. De 284 gaat over de vraag welk main-programma te kiezen. De vraag over WEB-INF/model is https://forum.mendix.com/questions/655/Debug-Java-actions-in-Eclipse-no-files-found.

answered