Question

I've been assigned the task of tracking down why a webpage is breaking under dotCMS. The page shows an error stack trace with a description that suggests it relates to SQL. I got access to the remote file system and was able to pull up the java file. The sql it is generating is failing when passed to a getResults method. I was wanting to see the value of that string of sql.

Maybe I could create a text file with that value through java. The previous programmer (that left the business) told me that I would need to shut down the server, clean plugins, deploy plugins and re-start the server so the source could be recompiled into jar files. I don't know how to do any of that at this point...and I wonder if those measures should only be taken when I'm deploying the fix.

I know Eclipse has logging abilities because I've dabbled with Android. I didn't know if there is a way that I could somehow remotely connect to the file. I found a tutorial for setting up eclipse with dotcms. It however wants me to check out the official dotcms source to my machine. I guess I don't understand how remote connections work with eclipse and if eclipse could even help with this issue. Noob question for sure!

Was it helpful?

Solution

When you want to run dotCMS from within eclipse it is not that hard. Remember that dotCMS is just tomcat with a default host deployed in it (the dotCMS application). You can download the dotCMS source here: http://dotcms.com/downloads/index.dot. Startup eclipse and add a tomcat server ( It is tomcat 6.0.26 at this moment), pointing the tomcat folder to the tomcat directory in the dotCMS install folder. You can start tomcat from eclipse this way.

You will have to deploy the plugins if you need to debug those. Below I describe it in detail, but dotCMS has a page on this on their official site as well: http://dotcms.com/plugins/plugin-faq.dot#HowInstall

  • Make sure you have access to the server that dotCMS is deployed on. On windows that would mean a remote desktop, and on linux you'll need ssh. If you have it running in eclipse on your local system then of course you're set already.
  • After logging in on the server make sure you have apache ant installed on your system. You can check if you have it by typing "ant -version" on the command line (in a dos box on windows). If you have it installed you'll see something like this:

Apache Ant version 1.8.0 compiled on March 11 2010

  • if you don't have it installed you can download it here: http://ant.apache.org/bindownload.cgi
  • install ant and make sure you put the /bin folder on the PATH, so you will be able to call ant from all directories
  • Now check if you have a JAVA jdk installed. You will need a jdk and not only a jre, because building the plugins includes compiling java files into classes. You can check if you have the jdk installed by typing "javac" on the command line. If you don't have it, install the latest java jdk from here : http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u3-download-1501626.html
  • install the jdk and make sure the /bin folder os on the PATH
  • Now stop dotCMS
  • Go to the root of the dotCMS folder and undeploy the plugins using this command:

ant undeploy-plugins

  • Now build the plugins

ant build-plugins.

  • And finally deploy them

ant deploy-plugins

Your plugins are redeployed now. You can restart dotCMS.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top