cancel
Showing results for 
Search instead for 
Did you mean: 

Error when configuring h2 as a standalone server

swsw1
Champ in-the-making
Champ in-the-making
I tried to get started with the bpmn-tutorial in chatpter 7 of the activity-manual after successfully installing and deploying the activity-jars and creating a processInstance, which I ran on Tomcat. I likewise installed an h2 database aided by the windows installer - I started the h2 database-server with the *.bat, with the goal in mind to carry out the first step of the bpmn-tutorial which reads as follows:

This tutorial assumes that you have the Activiti demo setup running, and that you are using a standalone H2 server. Edit db.properties and set the jdbc.url=jdbc:h2:tcp://localhost/activiti, and then run the standalone server according to H2's documentation.
 

So I navigated to the dp.properties-file in my war file (C:\foo\bar\ServerFolder\webapps\activiti-explorer.war\WEB-INF\classes\) and altered the string that I beheld therein (db=h2jdbc.driver=org.h2.Driverjdbc.url=jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000jdbc.username=sajdbc.password=) to this: jdbc.url=jdbc:h2:tcp://localhost/activiti

As a result of this, the Tomcat server, which had started up repeatedly, would no longer start up, the error message - betraying that my programme runs as a Vaadin application named Vaadin - reads as follows:

Servlet.service() for servlet [Vaadin Application] in context with path [/Vaadin] threw exception [java.lang.NullPointerException] with root cause
java.lang.NullPointerException
   at com.example.vaadin.VaadinApplication.init(VaadinApplication.java:35)
   at com.vaadin.Application.start(Application.java:551)
   at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.startApplication(AbstractApplicationServlet.java:1219)
   at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:484)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
   at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
   at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
   at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)




 
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
Which H2 version are you using?

H2 recently changed their default urls, see https://github.com/Activiti/Activiti/commit/5f6cee1b55ac6e8a0ce16b7698e9bc19297a73cc

swsw1
Champ in-the-making
Champ in-the-making
Thank You! I learnt that the latest h2-version requires a swung dash like this ….localhost/~/activiti

jbarrez
Star Contributor
Star Contributor
Indeed - many people have been hit by it the last couple of days. We've updated the Activiti master code … but we will need a new release to roll it out.