It seems that most of the problems I’ve encountered with ReportServer revolve around issues with the H2 database rsdemodb.
I recently wanted to upgrade my Java Runtime Environment (JRE). When the old version was removed, the Windows Service would no longer start. I then pieced together the service is created not through the standard service.bat that’s included with Tomcat7 but through a command line.
The following is the command required to re-register the windows service with different JVM options:
C:\Program Files\reportserver\tomcat\bin>tomcat7.exe //IS//Tomcat7 --DisplayName="reportserver-tomcat" --Install="C:\Program Files\reportserver\tomcat\bin\tomcat7.exe" --Jvm="C:\Program Files\Java\jre7\bin\server\jvm.dll" --Classpath="C:\Program Files\reportserver\tomcat\bin\bootstrap.jar;C:\Program Files\reportserver\tomcat\bin\tomcat-juli.jar" --JvmMs=256 --JvmMx=1536 --JvmSs=1024 ++JvmOptions="-Dcatalina.home=C:\Program Files\reportserver\tomcat" ++JvmOptions="-Dcatalina.base=C:\Program Files\reportserver\tomcat" ++JvmOptions="-Djava.endorsed.dirs=C:\Program Files\reportserver\tomcat\endorsed" ++JvmOptions="-Djava.io.tmpdir=C:\Program Files\reportserver\tomcat\temp" ++JvmOptions="-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager" ++JvmOptions="-Djava.util.logging.config.file=C:\Program Files\reportserver\tomcat\conf\logging.properties" ++JvmOptions="-XX:MaxPermSize=256m" ++JvmOptions="-Dfile.encoding=UTF-8" --StartMode=jvm --StopMode=jvm --StartClass=org.apache.catalina.startup.Bootstrap --StartParams=start --StopClass=org.apache.catalina.startup.Bootstrap --StopParams=stop --Startup auto
Keep in mind this string will vary depending on the version of the JRE you’re using: C:\Program Files\Java\jre7\bin\server\jvm.dll
If you need to make adjustments to the settings governing your installation, you’ll need to either update or delete the service BEFOREHAND :
C:\Program Files\reportserver\tomcat\bin>tomcat7.exe //DS//Tomcat7
I completely removed the service and installed it again. I haven’t attempted an update.
This is a useful reference: http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html
Why am I posting this you say? Well, I’m curious why this demo can’t be apart of the Postgres database? I have been trying to figure out how I can connect to this H2 database but to-date I have not had any success in doing so.
I was able to execute this command successfully to get a dump of all the data contained in this database.
C:\Program Files\reportserver\tomcat\webapps\reportserver\WEB-INF\lib>java -cp h2-1.4.180.jar org.h2.tools.Recover -dir "C:\Program%20Files\reportserver\tomcat\temp\rsidb"
There doesn’t appear to be anything of importance in this database. I consider this to be a serious stability issue. Releases to the Java Runtime are fairly frequent, so I can see Systems Administrators grappling with this problem from time-to-time.
After re-installing the Windows Service, I found it necessary to purge (delete) the rsdemodb directory (C:\Program%20Files\reportserver\tomcat\temp\rsidb) entirely. Otherwise, I receive the following types of error messages and the login page in Report Server will not load:
WARNING: could not init demodata
org.h2.jdbc.JdbcSQLException: General error: “java.lang.IllegalStateException: Unsynchronized metadata read [1.4.180/3]”; SQL statement:
DROP ALL OBJECTS [50000-180]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.message.DbException.convert(DbException.java:295)
at org.h2.command.Command.executeUpdate(Command.java:262)
at org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:198)
at net.datenwerke.rs.core.service.internaldb.InternalDbServiceImpl.initDemoDatabase(InternalDbServiceImpl.java:169)
at net.datenwerke.rs.core.service.internaldb.InternalDbStartup$1.initialize(InternalDbStartup.java:35)
at net.datenwerke.gf.service.lateinit.LateInitStartup$1.run(LateInitStartup.java:42)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Unsynchronized metadata read [1.4.180/3]
at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:756)
at org.h2.mvstore.MVStore.getChunkIfFound(MVStore.java:829)
at org.h2.mvstore.MVStore.getChunk(MVStore.java:814)
at org.h2.mvstore.MVStore.readPage(MVStore.java:1860)
at org.h2.mvstore.MVMap.readPage(MVMap.java:767)
at org.h2.mvstore.Page.getChildPage(Page.java:252)
at org.h2.mvstore.MVMap.getMinMax(MVMap.java:431)
at org.h2.mvstore.MVMap.getMinMax(MVMap.java:431)
at org.h2.mvstore.MVMap.getMinMax(MVMap.java:404)
at org.h2.mvstore.MVMap.ceilingKey(MVMap.java:371)
at org.h2.store.LobStorageMap.removeLob(LobStorageMap.java:295)
at org.h2.store.LobStorageMap.removeAllForTable(LobStorageMap.java:269)
at org.h2.mvstore.db.MVPrimaryIndex.truncate(MVPrimaryIndex.java:246)
at org.h2.mvstore.db.MVTable.truncate(MVTable.java:607)
at org.h2.mvstore.db.MVTable.removeChildrenAndResources(MVTable.java:710)
at org.h2.engine.Database.removeSchemaObject(Database.java:1784)
at org.h2.command.ddl.DropDatabase.dropAllObjects(DropDatabase.java:87)
at org.h2.command.ddl.DropDatabase.update(DropDatabase.java:36)
at org.h2.command.CommandContainer.update(CommandContainer.java:78)
at org.h2.command.Command.executeUpdate(Command.java:254)
… 5 more
Feb 20, 2015 11:29:20 AM net.datenwerke.gf.service.lateinit.LateInitStartup$1 run
SEVERE: Error in LateInitHook
java.lang.IllegalStateException: org.h2.jdbc.JdbcSQLException: General error: “java.lang.IllegalStateException: Unsynchronized metadata read [1.4.180/3]”; SQL statement:
DROP ALL OBJECTS [50000-180]
at net.datenwerke.rs.core.service.internaldb.InternalDbServiceImpl.initDemoDatabase(InternalDbServiceImpl.java:189)
at net.datenwerke.rs.core.service.internaldb.InternalDbStartup$1.initialize(InternalDbStartup.java:35)
at net.datenwerke.gf.service.lateinit.LateInitStartup$1.run(LateInitStartup.java:42)
at java.lang.Thread.run(Unknown Source)
Caused by: org.h2.jdbc.JdbcSQLException: General error: “java.lang.IllegalStateException: Unsynchronized metadata read [1.4.180/3]”; SQL statement:
DROP ALL OBJECTS [50000-180]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.message.DbException.convert(DbException.java:295)
at org.h2.command.Command.executeUpdate(Command.java:262)
at org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:198)
at net.datenwerke.rs.core.service.internaldb.InternalDbServiceImpl.initDemoDatabase(InternalDbServiceImpl.java:169)
… 3 more
Caused by: java.lang.IllegalStateException: Unsynchronized metadata read [1.4.180/3]
at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:756)
at org.h2.mvstore.MVStore.getChunkIfFound(MVStore.java:829)
at org.h2.mvstore.MVStore.getChunk(MVStore.java:814)
at org.h2.mvstore.MVStore.readPage(MVStore.java:1860)
at org.h2.mvstore.MVMap.readPage(MVMap.java:767)
at org.h2.mvstore.Page.getChildPage(Page.java:252)
at org.h2.mvstore.MVMap.getMinMax(MVMap.java:431)
at org.h2.mvstore.MVMap.getMinMax(MVMap.java:431)
at org.h2.mvstore.MVMap.getMinMax(MVMap.java:404)
at org.h2.mvstore.MVMap.ceilingKey(MVMap.java:371)
at org.h2.store.LobStorageMap.removeLob(LobStorageMap.java:295)
at org.h2.store.LobStorageMap.removeAllForTable(LobStorageMap.java:269)
at org.h2.mvstore.db.MVPrimaryIndex.truncate(MVPrimaryIndex.java:246)
at org.h2.mvstore.db.MVTable.truncate(MVTable.java:607)
at org.h2.mvstore.db.MVTable.removeChildrenAndResources(MVTable.java:710)
at org.h2.engine.Database.removeSchemaObject(Database.java:1784)
at org.h2.command.ddl.DropDatabase.dropAllObjects(DropDatabase.java:87)
at org.h2.command.ddl.DropDatabase.update(DropDatabase.java:36)
at org.h2.command.CommandContainer.update(CommandContainer.java:78)
at org.h2.command.Command.executeUpdate(Command.java:254)
… 5 more
UPDATE:
Also, I thought I’d mention that attempting to register the Tomcat7 service using the service.bat file causes all sorts of complications. So unless you are a seasoned Tomcat veteran, I don’t recommend going this route. I’m still recovering from my battle wounds, although my familiarity with Tomcat has improved.