New Install Fails with "Caused by: java.lang.IllegalStateException: Why am I in a transaction?"

Installation Forum (Inactive)
New Install Fails with "Caused by: java.lang.IllegalStateException: Why am I in a transaction?" mrg  2015-04-24 09:16
Status: Closed
 
I'm trying to stand up Labkey Server 15.1 on Ubuntu Trusty LTS (14.04.02) using the manual process. I'm using the system packages for Tomcat (tomcat7) and postgres (postgresql-9.3, version 9.3.6) and the PPA installer for Oracle Java 8.

Tomcat seems happy- install of Labkey server took a bit of modification to accommodate the layout of tomcat components in the system package. The contents of "tomcat-lib" I've put in /usr/share/tomcat7/lib, the rest of the webapp components into the appropriate locations in /opt/labkey, and labkey.xml in /etc/tomcat7/Catalina/localhost

There were some permissions issues initially, but I've rectified those. Once past those I was able to start the app, but it now complains:

     Cannot connect to DataSource "labkeyDataSource" defined in labkey.xml. Server cannot start.

Further down the stack trace it suggests that this is:

     Caused by: java.lang.IllegalStateException: Why am I in a transaction?

My JDBC configuration in labkey.xml /appears/ correct. I'm able to connect to the database using the credentials and hostname in labkey.xml with the psql client:

     psql -h localhost -d labkey -U labkey

I'll attach the full trace, labkey.xml, and relevant logs. Tomcat has this listed:

Tomcat Version: Apache Tomcat/7.0.52 (Ubuntu)    
   JVM Version: 1.8.0_45-b14    
    JVM Vendor: Oracle Corporation    
       OS Name: Linux    
    OS Version: 3.13.0-32-generic

and tomcat is running with these options:

tomcat7 27796 1 92 09:03 ? 00:00:33 /usr/lib/jvm/java-8-oracle/bin/java
   -Djava.util.logging.config.file=/var/lib/tomcat7/conf/logging.properties
   -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
   -Djava.awt.headless=true
   -Xms128m -Xmx2048m
   -XX:+UseConcMarkSweepGC
   -XX:-HeapDumpOnOutOfMemoryError
   -Djava.endorsed.dirs=/usr/share/tomcat7/endorsed
   -classpath /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar
   -Dcatalina.base=/var/lib/tomcat7
   -Dcatalina.home=/usr/share/tomcat7
   -Djava.io.tmpdir=/tmp/tomcat7-tomcat7-tmp
   org.apache.catalina.startup.Bootstrap start

Any advice appreciated- seems like an obvious error, but I can't suss it out.

Thanks

Michael
 
 
Brian Connolly responded:  2015-04-24 10:50
Michael,

The configuration looks correct and from your testing it seems like everything should be working. I have a few questions.

From your testing it looks like the database named labkey has been created. Did you create the database manually prior to starting the LabKey Server for the first time? If not, was it created during one of your previous attempts to start the LabKey Server, where you had the permissions problem?


Brian
 
mrg responded:  2015-04-24 11:01
Ah- I created the database outside the installation (via puppet postgresql module). I did veryify that using the credentials from labkey.xml that I was able to create tables in the database- thought that'd be sufficient. That said- I'm not liking the permissions on the database... sounds like a worthy avenue to explore.

Thanks

M
 
felix rauscher responded:  2015-07-15 03:53
Dear Michael,

how did you solve this issue. I have the same issue myself.

regards

Felix
 
mrg responded:  2015-08-03 09:45

Regrettably, I don't have a root cause outside of using Puppet for configuring the database. When I installed manually (according to the documentation) it worked properly. I never did figure out why I couldn't get Puppet to do it correctly or what was wrong with the database.

M