FreeMarker template error (DEBUG mode; use RETHROW in production!): Java method "at.weberhofer.eusoda.shared.usage.Usage.writeUsage(int, int, String, int, String, int, int)" threw an exception when invoked on at.weberhofer.eusoda.shared.usage.Usage object "at.weberhofer.eusoda.shared.usage.Usage@55c03e4"; see cause exception in the Java stack trace. ---- FTL stack trace ("~" means nesting-related): - Failed at: ${usage.writeUsage(usage.getContentTy... [in template "eusodaweb/InstitutionDetail.ftl" at line 32, column 9] ~ Reached through: #nested [in template "eusodaweb/layout/Default.ftl" in macro "defaultLayout" at line 44, column 25] ~ Reached through: @layout.defaultLayout [in template "eusodaweb/InstitutionDetail.ftl" at line 2, column 1] ---- Java stack trace (for programmers): ---- freemarker.core._TemplateModelException: [... Exception message was already printed; see it above ...] at freemarker.ext.beans._MethodUtil.newInvocationTemplateModelException(_MethodUtil.java:289) at freemarker.ext.beans._MethodUtil.newInvocationTemplateModelException(_MethodUtil.java:261) at freemarker.ext.beans.OverloadedMethodsModel.exec(OverloadedMethodsModel.java:65) at freemarker.core.MethodCall._eval(MethodCall.java:65) at freemarker.core.Expression.eval(Expression.java:83) at freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup(DollarVariable.java:100) at freemarker.core.DollarVariable.accept(DollarVariable.java:63) at freemarker.core.Environment.visit(Environment.java:366) at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:317) at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271) at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:242) at freemarker.core.Environment.visitIteratorBlock(Environment.java:642) at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:107) at freemarker.core.IteratorBlock.accept(IteratorBlock.java:93) at freemarker.core.Environment.visit(Environment.java:366) at freemarker.core.Environment.invokeNestedContent(Environment.java:618) at freemarker.core.BodyInstruction.accept(BodyInstruction.java:60) at freemarker.core.Environment.visit(Environment.java:366) at freemarker.core.Environment.invoke(Environment.java:775) at freemarker.core.UnifiedCall.accept(UnifiedCall.java:83) at freemarker.core.Environment.visit(Environment.java:330) at freemarker.core.Environment.visit(Environment.java:336) at freemarker.core.Environment.process(Environment.java:309) at freemarker.template.Template.process(Template.java:384) at org.springframework.web.servlet.view.freemarker.FreeMarkerView.processTemplate(FreeMarkerView.java:368) at org.springframework.web.servlet.view.freemarker.FreeMarkerView.doRender(FreeMarkerView.java:285) at org.springframework.web.servlet.view.freemarker.FreeMarkerView.renderMergedTemplateModel(FreeMarkerView.java:235) at org.springframework.web.servlet.view.AbstractTemplateView.renderMergedOutputModel(AbstractTemplateView.java:167) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:304) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1286) at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1041) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:984) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:853) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) Caused by: at.weberhofer.eusoda.shared.EusodaSharedRuntimeExc: at.weberhofer.transaction.TransactionLayerExc: org.apache.ojb.broker.KeyConstraintViolatedException: * SQLException during execution of sql-statement: * sql statement was 'INSERT INTO contentstat (contentStat_id,accessHour,contentType_id,contentKey,typeUserAgent_id,lang_iso,site_id,usr_id,counter) VALUES (?,?,?,?,?,?,?,?,?) ' * Exception message is [Duplicate entry '154074254' for key 'PRIMARY'] * Vendor error code [1062] * SQL state code [23000=INTEGRITY CONSTRAINT VIOLATION] * Target class is 'at.weberhofer.eusoda.shared.orm.ContentStat' * PK of the target object is [contentStatId=154074254] * Source object: class at.weberhofer.eusoda.shared.orm.ContentStat [contentStatId] 154074254 at at.weberhofer.eusoda.shared.usage.Usage.writeUsageToDb(Usage.java:88) at at.weberhofer.eusoda.shared.usage.Usage.writeUsage(Usage.java:153) at sun.reflect.GeneratedMethodAccessor136.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:1505) at freemarker.ext.beans.ReflectionCallableMemberDescriptor.invokeMethod(ReflectionCallableMemberDescriptor.java:56) at freemarker.ext.beans.MemberAndArguments.invokeMethod(MemberAndArguments.java:51) at freemarker.ext.beans.OverloadedMethodsModel.exec(OverloadedMethodsModel.java:61) ... 60 more Caused by: at.weberhofer.transaction.TransactionLayerExc: org.apache.ojb.broker.KeyConstraintViolatedException: * SQLException during execution of sql-statement: * sql statement was 'INSERT INTO contentstat (contentStat_id,accessHour,contentType_id,contentKey,typeUserAgent_id,lang_iso,site_id,usr_id,counter) VALUES (?,?,?,?,?,?,?,?,?) ' * Exception message is [Duplicate entry '154074254' for key 'PRIMARY'] * Vendor error code [1062] * SQL state code [23000=INTEGRITY CONSTRAINT VIOLATION] * Target class is 'at.weberhofer.eusoda.shared.orm.ContentStat' * PK of the target object is [contentStatId=154074254] * Source object: class at.weberhofer.eusoda.shared.orm.ContentStat [contentStatId] 154074254 at at.weberhofer.transaction.TransactionLayer.store(TransactionLayer.java:199) at at.weberhofer.transaction.TransactionLayer.store(TransactionLayer.java:225) at at.weberhofer.server.transaction.TransactionLayerBean.store(TransactionLayerBean.java:77) at at.weberhofer.eusoda.shared.usage.Usage.writeUsageToDb(Usage.java:86) ... 68 more Caused by: org.apache.ojb.broker.KeyConstraintViolatedException: * SQLException during execution of sql-statement: * sql statement was 'INSERT INTO contentstat (contentStat_id,accessHour,contentType_id,contentKey,typeUserAgent_id,lang_iso,site_id,usr_id,counter) VALUES (?,?,?,?,?,?,?,?,?) ' * Exception message is [Duplicate entry '154074254' for key 'PRIMARY'] * Vendor error code [1062] * SQL state code [23000=INTEGRITY CONSTRAINT VIOLATION] * Target class is 'at.weberhofer.eusoda.shared.orm.ContentStat' * PK of the target object is [contentStatId=154074254] * Source object: class at.weberhofer.eusoda.shared.orm.ContentStat [contentStatId] 154074254 at org.apache.ojb.broker.util.ExceptionHelper.generateException(Unknown Source) at org.apache.ojb.broker.util.ExceptionHelper.generateException(Unknown Source) at org.apache.ojb.broker.util.ExceptionHelper.generateException(Unknown Source) at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source) at at.weberhofer.transaction.TransactionLayer.store(TransactionLayer.java:193) ... 71 more Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '154074254' for key 'PRIMARY' at sun.reflect.GeneratedConstructorAccessor354.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) at com.mysql.jdbc.Util.getInstance(Util.java:408) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861) at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2073) at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2009) at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5098) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1994) at sun.reflect.GeneratedMethodAccessor139.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:114) at com.sun.proxy.$Proxy47.executeUpdate(Unknown Source) ... 79 more