Installation Issue

Hello,
After I followed the instructions on how to install XWIKI, I have an issue to run it and to connect to Oracle data base that is on the separate server.
I have the following:
Apache tomcat 8.5.24 on Windows 2012 server
Wiki enterprise 8.4.4
oracle db version is 11.2.0.4 ( on separate Linux server)
ojdbc6.jar oracle driver for oracle db version is 11.2.0.4
I configured hibernate.cfg.xml to use the oracle db

When I try to run xwiki for the first time, I have the following errors:
In the browser:

HTTP Status 500 – Internal Server Error

Type Exception Report

Message org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with id [init.vm]

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

javax.servlet.ServletException: org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with id [init.vm]
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:520)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:427)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:112)
org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:127)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:136)

Root Cause

org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with id [init.vm]
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:227)
com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:361)
com.xpn.xwiki.internal.template.InternalTemplateManager.evaluateContent(InternalTemplateManager.java:790)
com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:667)
com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:645)
com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:623)
com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:107)
com.xpn.xwiki.web.XWikiAction.renderInit(XWikiAction.java:602)
com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:260)
com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:210)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:112)
org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:127)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:136)

Root Cause

org.apache.velocity.exception.MethodInvocationException: Invocation of method ‘getCurrentInitializerJobStatus’ in class com.xpn.xwiki.api.XWiki threw exception java.lang.NullPointerException at 32:init.vm[line 1, column 26]
org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:223)
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567)
org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71)
org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142)
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluateInternal(DefaultVelocityEngine.java:259)
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:222)
com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:361)
com.xpn.xwiki.internal.template.InternalTemplateManager.evaluateContent(InternalTemplateManager.java:790)
com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:667)
com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:645)
com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:623)
com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:107)
com.xpn.xwiki.web.XWikiAction.renderInit(XWikiAction.java:602)
com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:260)
com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:210)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:112)
org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:127)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:136)

Root Cause

java.lang.NullPointerException
com.xpn.xwiki.api.XWiki.getCurrentInitializerJobStatus(XWiki.java:194)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.apache.velocity.runtime.parser.node.PropertyExecutor.execute(PropertyExecutor.java:142)
org.apache.velocity.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:539)
org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:198)
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567)
org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71)
org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142)
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluateInternal(DefaultVelocityEngine.java:259)
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:222)
com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:361)
com.xpn.xwiki.internal.template.InternalTemplateManager.evaluateContent(InternalTemplateManager.java:790)
com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:667)
com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:645)
com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:623)
com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:107)
com.xpn.xwiki.web.XWikiAction.renderInit(XWikiAction.java:602)
com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:260)
com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:210)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:112)
org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:127)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:136)

Note The full stack trace of the root cause is available in the server logs.

For tomcat running window:
2018-02-22 09:23:02,142 [XWiki initialization] ERROR c.x.x.i.XWikiInitializerJob - Exception thrown during job execution
java.lang.AbstractMethodError: null
at org.apache.commons.dbcp2.DelegatingConnection.isValid(DelegatingConnection.java:918)
at org.apache.commons.dbcp2.DelegatingConnection.isValid(DelegatingConnection.java:918)
at org.apache.commons.dbcp2.PoolableConnection.validate(PoolableConnection.java:283)
at org.apache.commons.dbcp2.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:357)
at org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2307)
at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2290)
at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2039)
at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533)
at com.xpn.xwiki.store.DBCPConnectionProvider.configure(DBCPConnectionProvider.java:215)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:90)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2863)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2859)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1870)
at com.xpn.xwiki.store.XWikiHibernateBaseStore.initHibernate(XWikiHibernateBaseStore.java:259)
at com.xpn.xwiki.store.XWikiHibernateBaseStore.checkHibernate(XWikiHibernateBaseStore.java:703)
at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:861)
at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:280)
at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1811)
at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1864)
at com.xpn.xwiki.XWiki.initializeMandatoryDocument(XWiki.java:1269)
at com.xpn.xwiki.XWiki.initializeMandatoryDocuments(XWiki.java:1243)
at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1186)
at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1103)
at com.xpn.xwiki.XWiki.(XWiki.java:1076)
at com.xpn.xwiki.internal.XWikiInitializerJob.runInternal(XWikiInitializerJob.java:117)
at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:206)
at org.xwiki.job.AbstractJob.run(AbstractJob.java:189)
at java.lang.Thread.run(Unknown Source)

Localhost.log file:
22-Feb-2018 09:23:04.220 SEVERE [http-nio-80-exec-4] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [action] in context with path [/xwiki] threw exception [org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with id [init.vm]] with root cause
java.lang.NullPointerException
at com.xpn.xwiki.api.XWiki.getCurrentInitializerJobStatus(XWiki.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.velocity.runtime.parser.node.PropertyExecutor.execute(PropertyExecutor.java:142)
at org.apache.velocity.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:539)
at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:198)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567)
at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71)
at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluateInternal(DefaultVelocityEngine.java:259)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:222)
at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:361)
at com.xpn.xwiki.internal.template.InternalTemplateManager.evaluateContent(InternalTemplateManager.java:790)
at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:667)
at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:645)
at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:623)
at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:107)
at com.xpn.xwiki.web.XWikiAction.renderInit(XWikiAction.java:602)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:260)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:210)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:112)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:127)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:136)
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:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

Our Network group has checked that the application server even did not attempt to connect to db. It tells that something is wrong with installation/configuration but I can not figure out what is missed or set up incorrectly.

If you experienced the same issue or have thoughts on how to resolve it, please help.

Thank you,
Galina

This log looks more like a consequence than a cause. You should take a look at the very first error you have in the log when starting your application server.

I have seen this exact error before, with drivers that don’t seem to implement the “isValid” method. You can fix this by specifying a validationQuery property.
I don’t know the exact syntax, because my xwiki does not run with Oracle and the other software I had to configure this used Tomcat’s context.xml for it’s datasources. There I had to add validationQuery=“select 1 from dual” in the Resource definition node.

Hope that helps.

Hello,
Thank you very much for your reply. I think you are right and I nave some issues with the driver. I googled my issue and found that some person had the exact same errors and he switched to another driver. I use the recommended driver for my Oracle db version. Still can not figure out how to adjusts validationQuery property for my case. Should I create an additional connection recourse in context.xml file or in server.xml file and what to put there?

According to these FAQs jdbc6.jar should support jdbc specification v4 which defines the “isValid” function. Maybe you need to upgrade your jdbc6.jar?
Also make sure that there is only one jdbcX.jar in the lib folders.

If this does not help, maybe:
Try to add the following definition to the DB configuration in hibernate.cfg.

<property name="hibernate.dbcp.validationQuery">select 1 from dual</property>

Don’t add anything to context.xml, else you would need to “convince” hibernate to pick up this config. Which is a complete different issue. Let’s focus on the current one.

Hope that helps.

Hello rbr,
Thank you very much for your help ! My xwiki is initialized now ! The issue was that I had an extra ojdbc driver in the lib folder in addition to ojdbc6.jar. I removed the extra driver and XWIKI runs now.
Thank you again!

Hi @Galina,

that’s good news. Could you please mark this thread as solved?

Best,

rbr

Could you please advise me how to mark my topic as solved?

Thanks,

You find the reply that gives the answer, you click “…” and then click the icon representing a tick in a checkbox.

Seems someone did it already.