deployment error "Error creating bean with name 'cuba_ServerTokenStore'"

Hi all,

I have a deployment problem that I can’t solve alone.

In studio I checked everything from “Build War” to "Single War … "

Then I launched from the app dir the command “./gradlew buildwar” using a terminal

Then I deployed the generated .war in another machine with tomcat7 installed,

When I try to start the app in tomcat I get the error


"SEVERE: Exception sending context initialized event to listener instance of class 
com.haulmont.cuba.core.sys.singleapp.SingleAppCoreServletListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 
'cuba_ServerTokenStore': Invocation of init method failed; nested exception is java.lang.NullPointerException"

I attached the full log file.

Any help is really appreciated because I’m stuck here and I can’t continue the work.

I’m using:
Ubuntu 16.04
Tomcat 7
java version “1.8.0_144”
cuba platform-6.6.4
cuba studio 6.6.2 (licensed)

Thank you
Riccardo

tomcat.log (18.7K)

I forgot to mention that after checking all options in “Build War” i’ve also generated all the scripts, clicking on the “Generate” button

IMPORTANT UPDATE:
updated to TOMCAT 8.
The application now is working…
I paste here the entire procedure to setup the environment so maybe it is useful for others.

SETUP FOR UBUNTU 16.04

JAVA:

 

INSTALLATION VIA PPA 

sudo add-apt-repository ppa:webupd8team/java 
sudo apt-get update 
sudo apt-get install oracle-java8-installer  

TOMCAT:



INSTALLATION 

sudo apt install tomcat8 tomcat8-admin  
check localhost:8080 in the browser. You should see the tomcat start page. 

ENABLE TOMCAT MANAGER - localhost:8080/manager 

sudo vim /etc/tomcat8/tomcat-users.xml 
<!-- user manager can access only manager section --> 
<role rolename="manager-gui" /> 
<user username="user" password="xxxxxxxxx" roles="manager-gui" /> 
<!-- user admin can access manager and admin section both --> 
<role rolename="admin-gui" /> 
<user username="admin" password="xxxxxxxxx" roles="manager-gui,admin-gui" /> 

ENABLE DEPLOYMENT WAR > 50MB 

sudo vim /usr/share/tomcat8-admin/manager/WEB-INF/web.xml 
<multipart-config> 
  <!-- 150MB max --> 
  <max-file-size>152428800</max-file-size> 
  <max-request-size>152428800</max-request-size> 
  <file-size-threshold>0</file-size-threshold> 
</multipart-config> 

CUBA APPLICATION



BUILD WAR - FROM THE IDE 

Project Properties - EDIT 
"Deployment settings" (blue text bottom left) 
ALL options cheched 
Application home dir - /var/lib/tomcat7/webapps/ 
Generate Custom context.xml 
Generate Custom web.xml 
App.properties 
&#91;'cuba.automaticDatabaseUpdate' : true&#93; 

BUILD WAR - FROM THE TERMINAL 

cd ~/studio-project/app 
./gradlew buildwar

Copy the war into the production machine.
From localhost:8080/manager
from section “WAR file to deploy” - browse the war file - deploy.

1 Like

errata: Application home dir - /var/lib/tomcat8/webapps/

sorry, bad copy/paste

Thank you for posting the solution!