Cloud: Database table is not created on deployment

I have deployed my first cloud app to Jelastic cloud platform. the application runs but database table is not created.

I am using the same database name and type i.e. Postgres
I have kept the default database update option in deployment setting as follows


['cuba.automaticDatabaseUpdate' : true]

also checked to include JDBC driver, context.xml etc

Exception message


com.haulmont.cuba.core.global.RemoteException:
---
javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.2.cuba15): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: ERROR: relation "sample_foo" does not exist
  Position: 84
Error Code: 0
Call: SELECT ID AS a1, DELETE_TS AS a2, DELETED_BY AS a3, NAME AS a4, VERSION AS a5 FROM SAMPLE_FOO WHERE (DELETE_TS IS NULL) LIMIT ? OFFSET ?
	bind => [50, 0]
Query: ReadAllQuery(referenceClass=Foo sql="SELECT ID AS a1, DELETE_TS AS a2, DELETED_BY AS a3, NAME AS a4, VERSION AS a5 FROM SAMPLE_FOO WHERE (DELETE_TS IS NULL) LIMIT ? OFFSET ?")
FetchGroup(){deleteTs, name, id, version, deletedBy}
---
org.eclipse.persistence.exceptions.DatabaseException: 
Internal Exception: org.postgresql.util.PSQLException: ERROR: relation "sample_foo" does not exist
  Position: 84
Error Code: 0
Call: SELECT ID AS a1, DELETE_TS AS a2, DELETED_BY AS a3, NAME AS a4, VERSION AS a5 FROM SAMPLE_FOO WHERE (DELETE_TS IS NULL) LIMIT ? OFFSET ?
	bind => [50, 0]
Query: ReadAllQuery(referenceClass=Foo sql="SELECT ID AS a1, DELETE_TS AS a2, DELETED_BY AS a3, NAME AS a4, VERSION AS a5 FROM SAMPLE_FOO WHERE (DELETE_TS IS NULL) LIMIT ? OFFSET ?")
FetchGroup(){deleteTs, name, id, version, deletedBy}
---
org.postgresql.util.PSQLException: ERROR: relation "sample_foo" does not exist
  Position: 84
	at com.haulmont.cuba.core.sys.ServiceInterceptor.aroundInvoke(ServiceInterceptor.java:127)
	at sun.reflect.GeneratedMethodAccessor117.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629)
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618)
	at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168)
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
	at com.sun.proxy.$Proxy95.loadList(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.haulmont.cuba.core.sys.remoting.LocalServiceInvokerImpl.invoke(LocalServiceInvokerImpl.java:94)
	at com.haulmont.cuba.web.sys.remoting.LocalServiceProxy$LocalServiceInvocationHandler.invoke(LocalServiceProxy.java:148)
	at com.sun.proxy.$Proxy186.loadList(Unknown Source)
	at com.haulmont.cuba.client.sys.DataManagerClientImpl.loadList(DataManagerClientImpl.java:53)
	at com.haulmont.cuba.gui.data.impl.GenericDataSupplier.loadList(GenericDataSupplier.java:102)
	at com.haulmont.cuba.gui.data.impl.CollectionDatasourceImpl.loadData(CollectionDatasourceImpl.java:587)
	at com.haulmont.cuba.gui.data.impl.CollectionDatasourceImpl.refresh(CollectionDatasourceImpl.java:146)
	at com.haulmont.cuba.gui.data.impl.CollectionDatasourceImpl.refresh(CollectionDatasourceImpl.java:104)
	at com.haulmont.cuba.gui.data.impl.GroupDatasourceImpl.setSuspended(GroupDatasourceImpl.java:191)
	at com.haulmont.cuba.gui.data.impl.DsContextImpl.resumeSuspended(DsContextImpl.java:85)
	at com.haulmont.cuba.gui.WindowManager.afterShowWindow(WindowManager.java:968)
	at com.haulmont.cuba.web.WebWindowManager.showWindow(WebWindowManager.java:402)
	at com.haulmont.cuba.gui.WindowManager.openWindow(WindowManager.java:597)
	at com.haulmont.cuba.web.WebWindowManager.openWindow(WebWindowManager.java:139)
	at com.haulmont.cuba.gui.config.MenuCommand$ScreenCommand.run(MenuCommand.java:181)
	at com.haulmont.cuba.gui.config.MenuCommand.execute(MenuCommand.java:76)
	at com.haulmont.cuba.web.sys.MenuBuilder.lambda$createMenuBarCommand$0(MenuBuilder.java:184)
	at com.haulmont.cuba.web.gui.components.mainwindow.WebAppMenu$MenuItemImpl.lambda$setCommand$2434f46b$1(WebAppMenu.java:338)
	at com.vaadin.ui.MenuBar.changeVariables(MenuBar.java:212)

Any clue what could be the reason?

Hi,

Please check if you create empty database manually as it is described here: Deployment to Jelastic Cloud - CUBA Platform. Developer’s Manual :

If your project uses PostgreSQL, go to the database administration web interface by the link in the email recieved after creation of the environment and create a database.

Also, ensure if you generated update scripts for your project, may be you added entities in Studio and didn’t generate SQL for them.

It worked, thank you.