1

I have a webapp that is failing to start in Tomcat on a Linux install. The app works on a different Tomcat installs on different machines and on the same machine when using a standalone Tomcat.

The problem seems to be due to the way in which Tomcat is starting.

  • Usining service tomcat8 start fails when Tomcat is installed through the package manager;
  • Using /etc/init.d/tomcat8 start fails when Tomcat is installed through the package manager;
  • Using a standalone tomcat and starting with service tomcat8 start (having modified /etc/init.d/tomcat8) fails;
  • Using a standalone tomcat and starting using ./startup.sh works.

I am using Debian 8, Tomcat 8.0.11 (but have tried 8.0.9 and 8.0.11) and various versions of Java. The app is failing due to a java transaction manager called Atomikos. The error is:

SEVERE: Exception sending context initialized event to listener instance of class uk.co.prodia.talkingcouch.ApplicationContextListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [config/applicationContext-db-sessionfactory.xml]: Cannot resolve reference to bean 'atomikosTransactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'atomikosTransactionManager' defined in class path resource [config/applicationContext-db-sessionfactory.xml]: Invocation of init method failed; nested exception is javax.transaction.SystemException: Transaction service not running at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1481)

Does anyone have any suggestions?

2 Answers 2

0

Usually management script are reading additional properties from the script itself, from files in /etc/tomcat8 and even from /etc/default/tomcat(8)

Ensure that the command with arguments issued from the startup.sh and from the management scripts result in the same call.

You can try to get the parameters ps -fp cat /proc//cmdline

0

TheCodeKiller got me to thinking along the right way. It was ultimately a permission issue and my own instance was only working at it was running as root. This was obvious by comparing the ps output of each running process.

Atomikos was writing its log file out to $CATALINA_BASE which was at /var/lib/tomcat8 which is only root writable.

It turns out that Atomikos had changed the way in handles logging and so that I had to:

  • Deleted the property com.atomikos.icatch.output_dir;
  • Deleted the property com.atomikos.icatch.log_base_dir.

and then add the following to log4j.xml:

<appender name="tc-core-atomikos" class="org.apache.log4j.RollingFileAppender">
    <param name="File" value="/stroage/www/tc/data/atomikos/tmout"/>
    <param name="MaxFileSize" value="1MB"/>
    <param name="MaxBackupIndex" value="5"/>
    <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" value="tc-core-atomikos => [log level: %-5p] [thread: %t] [%d{dd MMM yyyy HH:mm:ss}]%n    %c %M%n        %m%n%n"/>
    </layout>
</appender>

<logger name="com.atomikos">
    <level value="ERROR"/>
    <appender-ref ref="tc-core-atomikos"/>
</logger>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .