Error when hot deploy after modifying FreeMarker template from Eclipse to Tomcat

174 views
Skip to first unread message

Motokazi

unread,
Jul 28, 2015, 5:48:24 PM7/28/15
to Hippo Community
I have the sample hippo project working in Eclipse 'Mars' and hot deploy to Tomcat 8 from Eclipse. All Web apps are working fine (/cms, /site, /essential).
My problem is that every time I do change to Freemarker template ("flt" files) and save my changes, then Tomcat will detect the changes I have made and start to redeploy all the applications (/essential, /cms, /site) which is prefect but then it throws the following error:

SEVERE: Servlet [Repository] in web application [/cms] threw load() exception
javax
.servlet.ServletException: RepositoryException: Workspace directory already exists: default
    at org
.hippoecm.repository.RepositoryServlet.init(RepositoryServlet.java:230)
    at org
.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1231)
    at org
.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144)
    at org
.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1031)
    at org
.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4914)
    at org
.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5201)
    at org
.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org
.apache.catalina.core.StandardContext.reload(StandardContext.java:3746)
    at org
.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:292)
    at org
.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:5528)
    at org
.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1377)
    at org
.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1381)
    at org
.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1381)
    at org
.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1349)
    at java
.lang.Thread.run(Thread.java:745)


If i stop Tomcat server from Eclipse and then Start it again, the error goes away. However, this is annoying as I have to stop/start the server every time I do a change to a Freemarker template which is not productive at all and I would like tomcat to continue hot deploy when it detects changes but the error above keeps happening which then force me to stop/start the server to get rid of it :-(

Anyone faced this error before?

Niels van Kampenhout

unread,
Jul 28, 2015, 6:34:59 PM7/28/15
to hippo-c...@googlegroups.com
I did not encounter this issue when I tested this Eclipse/Tomcat setup
and rewrote the "Develop with Eclipse" page [1] recently.
Most developers at Hippo use IntelliJ however, so the setup is not widely used.
I'll take some time tomorrow to try to reproduce this.
Are your Freemarker files stored as repository web files
('bootstrap/webfiles') or in your web app ('site')?
It could be that there is some kind of conflict between the automatic
synchronization of web files and the automatic redeployment by
Eclipse.

Thanks for reporting this,
Niels

[1] http://www.onehippo.org/library/development/import-a-project-into-eclipse.html

Motokazi

unread,
Jul 28, 2015, 6:49:59 PM7/28/15
to Hippo Community, n.vanka...@onehippo.com
Hi Niels,
Yes all my Freemarker files are stored in bootstrap/webfiles.
I have not changed any of the original setup and I followed the tutorials step by step. Everything works perfectly but when I change any FTL files from Eclipse, Tomcat start to hot deploy and I end up with the above error.
I am also using MySQL as the repository and it works fine.

Thanks

Motokazi

unread,
Jul 28, 2015, 10:13:26 PM7/28/15
to Hippo Community, n.vanka...@onehippo.com, war...@gmail.com
Temporary Workaround:
Instead of editing the Freemarker files using Eclipse, I use external editor. This approach works perfectly fine. I can do all my changes using the external text editor to any Freemarker file under the bootstrap/webfiles, save my changes, reload my browser and the changes are there. Tomcat does not pick up these changes because they were done outside of Eclipse so it does not try to redeploy and therefore the error does not happen.

Niels van Kampenhout

unread,
Jul 29, 2015, 10:47:29 AM7/29/15
to Hippo Community
I was able to reproduce the issue and find a good workaround/fix
(configuring the bootstrap-webfiles module not to be auto-redeployed
by Eclipse). It looks like this fixed Motokazi's problem.

The 'Develop with Eclipse' page has been updated to include this
additional configuration step (section 'Run or Debug a Hippo Project
on a Tomcat Server within Eclipse'):

http://www.onehippo.org/library/development/import-a-project-into-eclipse.html

Thanks Motokazi for reporting this issue and verifying the fix!

Regards,
Niels
--
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 745 Atlantic Ave, 8th Floor, MA 02111

US +1 877 414 4776
Europe +31(0)20 522 4466
www.onehippo.com
Reply all
Reply to author
Forward
0 new messages