Eclipse tips
Esta página aún no está disponible en tu idioma.
Debug tomcat
Section titled “Debug tomcat”You can debug your OpenKM installation using the Tomcat logging facility. This is an useful thing when you have problems with your configuration. Default OpenKM installation tries to log important events like errors and warnings. Is possible to change this configuration editing the file $TOMCAT_HOME/conf/logging.properties.
Default Tomcat log configuration can generate a lot of messages. These files are stored at $TOMCAT_HOME/logs.
Debug remote tomcat server
Section titled “Debug remote tomcat server”Add the following options when the JVM is started:
-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=nOr if you are using shell scripts to start Tomcat, start it with the following command (recommended):
$ $TOMCAT_HOME/bin/catalina.sh jpda startIt will start Tomcat so that a remote debugger can be connected to port 8000.
Eclipse configuration
Section titled “Eclipse configuration”Open eclipse “Debug configurations”, then choose “Remote Java Application”, right click on mouse and choose “new”.
Set the “host” and “port” of the remote server:

Include in source tab your OpenKM java project:

You can debug normally, setting breakpoints, etc.
Debug GWT frontend user interface with GWT Super Dev Mode
Section titled “Debug GWT frontend user interface with GWT Super Dev Mode”Enable source for debugging
Section titled “Enable source for debugging”Edit pom.xml file and uncomment this section:
<!-- Only for development --><dependency> <groupId>com.google.gwt</groupId> <artifactId>gwt-dev</artifactId> <version>${gwt.version}</version> <scope>provided</scope></dependency>Uncomment the xsiframe section into the Main.gwt.xml file:
<!-- Use GWT 2.7.0 to debug in Firefox --> <add-linker name="xsiframe"/> <set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/> <set-configuration-property name="devModeUrlWhitelistRegexp" value="http://(localhost|127\.0\.0\.1|192\.168\.1\.34)(:\d+)?/.*" />Eclipse configuration
Section titled “Eclipse configuration”Open eclipse “Debug configurations”, then choose “Java Application”, right click on mouse and choose “new”.
Set the Main class field value:
com.google.gwt.dev.DevMode
Select “Arguments” tab and set the “program arguments” field value:
-bindAddress 0.0.0.0 -src src/ com.openkm.frontend.MainAnd the “VM arguments” field value:
-Xms2048m
Select “JRE” tab and set the “OpenJDK version”:

Select the “Classpath” tab and add folder /openkm/src/main ( use “Advanced” button and “add folder” option for it ) :

Add GWT jar dependencies with Add External JARs button:
- gwt-user-2.8.2.jar
- gwt-dev-2.8.2.jar
- gwt-user-2.8.2.jar
- javax.servlet-api-3.1.0

No you can run the Super Dev Mode at the end of the log is shown the url where the service is binding:

Open the code server url in your chrome browser browser and drag the bookmarklets in your bookmark bar:

Open your OpenKM frontend url in Chorme browser and then click in your bookmark bar the option “Dev Mode On” you have dragged in previous step. It will be shown a popup option with Compile button. Click in “Compile” button.

Finally open the Chrome developer tools and from the sources tab you have OpenKM java code available, where to set breakpoints, watch variables, etc:

Debug GWT frontend user interface with GWT Shell
Section titled “Debug GWT frontend user interface with GWT Shell”Enable source for debugging
Section titled “Enable source for debugging”Edit pom.xml file and uncomment this section:
<!-- Only for development --><dependency> <groupId>com.google.gwt</groupId> <artifactId>gwt-dev</artifactId> <version>${gwt.version}</version> <scope>provided</scope></dependency>Eclipse configuration
Section titled “Eclipse configuration”Open eclipse “Debug configurations”, then choose “Java Application”, right click on mouse and choose “new”.
Set the Main class field value:
com.google.gwt.dev.DevMode
Select “Arguments” tab and set the “program arguments” field value:
-port 8080 -noserver -startupUrl /OpenKM/frontend/index.jsp com.openkm.frontend.MainAnd the “VM arguments” field value:
-Xms1024m -Xmx2048M -XX:PermSize=64m -XX:MaxPermSize=1024m
Select “JRE” tab and set the “OpenJDK version”:
Select the “Classpath” tab and add folder /openkm/src/main ( use “Advanced” button and “add folder” option for it ) :

Now you can run the GWT Shell.
To debug login put in your browse:
http://localhost:8080/OpenKM/frontend/index?gwt.codesvr=127.0.1.1:9997![]() |
![]() |
You debug into eclipse, see variables values, etc.


