Heroku deployment with github push

Hi there,

I am new to the cuba platform and I want evaluate if I could use this platform on my upcoming projects.

I want to deploy my newly created App (cuba version 7.2) to the heroku cloud. Therefore I followed the tutorial for deploying with github push to heroku cloud without making any further changed to the code. (Deployment from GitHub to Heroku - CUBA Platform. Developer’s Manual)

Everything is working fine except the build in heroku. So my App did not start at all. I guess its because no javacode ist compiled.

Buildlog:

-----> Gradle app detected
-----> Installing JDK 1.8.0_121… done
-----> Building Gradle app…
-----> executing ./gradlew stage
> Task :setupTomcat
> Task :app-core:assembleDbScripts
> Task :app-core:dbScriptsArchive
> Task :app-core:beansXml
> Task :app-global:compileJava NO-SOURCE
> Task :app-core:compileJava NO-SOURCE
> Task :app-core:processResources
> Task :app-core:classes
> Task :app-core:jar
> Task :app-core:sourceJar
> Task :app-core:assemble
> Task :app-core:cleanConf UP-TO-DATE
> Task :app-core:deploy
> Task :app-web:beansXml
> Task :app-web:compileJava NO-SOURCE
> Task :app-web:processResources
> Task :app-web:classes
> Task :app-web:jar
> Task :app-web:sourceJar
> Task :app-web:webArchive
> Task :app-web:assemble
> Task :app-web:cleanConf UP-TO-DATE
> Task :app-web:deploy
> Task :stage

   Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
   Use '--warning-mode all' to show the individual deprecation warnings.
   See https://docs.gradle.org/6.1.1/userguide/command_line_interface.html#sec:command_line_warnings
   
   BUILD SUCCESSFUL in 13s
   17 actionable tasks: 15 executed, 2 up-to-date

-----> Discovering process types
Procfile declares types → web
-----> Compressing…
Done: 123.3M
-----> Launching…
Released v7
https://kfz-werkstatt.herokuapp.com/ deployed to Heroku

The following line in the tutorial might be the location of my porblems because i did not find the Create or update Gradle wrapper Button.

“Your project requires Gradle wrapper. You can use CUBA Studio to add it: see the Build > Create or update Gradle wrapper main menu command.”

Could anybody guess whats the problem here?
Thanks for your advice.

Cheers

Hi @nico.kowalczyk,

first of all welcome to the lovely world of CUBA platform :smiley: I hope you will have a great time.

In order to help you, it would be good if you could share a little more details on the problem.

When deploying you have the possibility to gett some logs from the deployment via

heroku logs --tail --app space-sheep-02453

where space-sheep-02453 is the name of your app.

It would also help if you share the example project including the procfile, so that we can help you with a little more details.

Have you alternatively tried to deploy to heroku using a docker container (see: Container Deployment to Heroku - CUBA Platform. Developer’s Manual)?

Cheers
Mario

Hi Mario,
thanks for your reply.
Here you find the log from heroku:

2020-03-22T16:35:29.681575+00:00 app[web.1]: at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930) [catalina.jar:9.0.27]
2020-03-22T16:35:29.681576+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [catalina.jar:9.0.27]
2020-03-22T16:35:29.681576+00:00 app[web.1]: at org.apache.catalina.startup.Catalina.start(Catalina.java:633) [catalina.jar:9.0.27]
2020-03-22T16:35:29.681576+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121-heroku]
2020-03-22T16:35:29.681576+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121-heroku]
2020-03-22T16:35:29.681577+00:00 app[web.1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121-heroku]
2020-03-22T16:35:29.681577+00:00 app[web.1]: at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121-heroku]
2020-03-22T16:35:29.681577+00:00 app[web.1]: at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:344) [bootstrap.jar:9.0.27]
2020-03-22T16:35:29.681578+00:00 app[web.1]: at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:475) [bootstrap.jar:9.0.27]
2020-03-22T16:35:29.691635+00:00 app[web.1]: Mar 22, 2020 4:35:29 PM org.apache.catalina.startup.HostConfig deployDirectory
2020-03-22T16:35:29.691636+00:00 app[web.1]: INFO: Deployment of web application directory [/app/deploy/tomcat/webapps/app-core] has finished in [1,535] ms
2020-03-22T16:35:29.692257+00:00 app[web.1]: Mar 22, 2020 4:35:29 PM org.apache.catalina.startup.HostConfig deployDirectory
2020-03-22T16:35:29.692257+00:00 app[web.1]: INFO: Deploying web application directory [/app/deploy/tomcat/webapps/ROOT]
2020-03-22T16:35:29.859218+00:00 app[web.1]: 16:35:29.859 INFO  c.h.cuba.core.sys.AppComponents         - Using app components: [com.haulmont.cuba]
2020-03-22T16:35:29.864873+00:00 app[web.1]: 16:35:29.864 INFO  c.h.c.c.s.AbstractWebAppContextLoader   - Loading app properties from classpath:digital/wandelbar/kfzwerkstatt/web-app.properties
2020-03-22T16:35:29.865523+00:00 app[web.1]: 16:35:29.865 INFO  c.h.c.c.s.AbstractWebAppContextLoader   - Loading app properties from file:/app/deploy/tomcat/../app_home/local.app.properties
2020-03-22T16:35:29.871129+00:00 app[web.1]: 16:35:29.870 INFO  c.h.c.c.s.e.EnvironmentChecksRunner     - Environment checks on web module completed successfully
2020-03-22T16:35:31.250816+00:00 app[web.1]: 16:35:31.250 INFO  c.h.c.c.s.r.d.StaticServerSelector      - Server URLs: [http://localhost:8080/app-core/remoting]
2020-03-22T16:35:31.265776+00:00 app[web.1]: 16:35:31.265 INFO  c.h.c.w.s.r.WebRemoteProxyBeanCreator   - Configuring proxy beans for local service invocations: [cuba_AuthenticationService, cuba_TrustedClientService, cuba_ServerInfoService, cuba_UserSettingService,
 cuba_UserManagementService, cuba_DataService, cuba_ConfigStorageService, cuba_PersistenceManagerService, cuba_LockService, cuba_UserSessionService, cuba_FoldersService, cuba_EmailService, cuba_FileStorageService, cuba_EntitySnapshotService, cuba_UniqueNumbersServi
ce, cuba_LocalizedMessageService, cuba_ResourceService, cuba_ScheduledTasksService, cuba_EntityLogService, cuba_TestingService, cuba_DomainDescriptionService, cuba_RelatedEntitiesService, cuba_EntitySqlGenerationService, cuba_NumberIdService, cuba_QueryResultsServi
ce, cuba_DynamicAttributesCacheService, cuba_EntityRestoreService, cuba_LocalFileExchangeService, cuba_EntityImportExportService, cuba_ConstraintLocalizationService, cuba_AttributeAccessService, cuba_ExceptionReportService, cuba_BulkEditorDataService, cuba_Persiste
nceSecurityService, cuba_AccessGroupsService, cuba_AttributeOptionsLoaderService, cuba_RolesService, cuba_SecurityScopesService]
2020-03-22T16:35:32.626957+00:00 app[web.1]: 16:35:32.626 INFO  c.h.c.c.s.CubaThreadPoolTaskScheduler   - Initializing ExecutorService 'scheduler'
2020-03-22T16:35:32.885400+00:00 app[web.1]: 16:35:32.885 INFO  c.h.cuba.core.sys.jmx.MBeanExporter     - Registering beans for JMX exposure: [app.cuba:type=ConfigStorage, app.cuba:type=CachingFacade, app.cuba:type=FileUploading, app.cuba:type=JmxNodeIdentifier, ap
p.cuba:type=JmxLogControl, app.cuba:type=ClassLoaderManager, app.cuba:type=StatisticsCounter]
2020-03-22T16:35:33.022269+00:00 app[web.1]: 16:35:33.022 INFO  c.h.cuba.core.sys.MetadataImpl          - Initializing metadata
2020-03-22T16:35:33.042775+00:00 app[web.1]: 16:35:33.042 ERROR c.h.c.c.s.AbstractWebAppContextLoader   - Error initializing application
2020-03-22T16:35:33.042776+00:00 app[web.1]: java.lang.IllegalStateException: Resource not found: digital/wandelbar/kfzwerkstatt/metadata.xml
2020-03-22T16:35:33.042776+00:00 app[web.1]: at com.haulmont.cuba.core.sys.MetadataBuildSupport.readXml(MetadataBuildSupport.java:207) ~[cuba-global-7.2.1.jar:7.2.1]
2020-03-22T16:35:33.042777+00:00 app[web.1]: at com.haulmont.cuba.core.sys.MetadataBuildSupport.init(MetadataBuildSupport.java:94) ~[cuba-global-7.2.1.jar:7.2.1]
2020-03-22T16:35:33.042777+00:00 app[web.1]: at com.haulmont.cuba.core.sys.MetadataLoader.loadMetadata(MetadataLoader.java:104) ~[cuba-global-7.2.1.jar:7.2.1]
2020-03-22T16:35:33.042777+00:00 app[web.1]: at com.haulmont.cuba.core.sys.MetadataImpl.initMetadata(MetadataImpl.java:111) ~[cuba-global-7.2.1.jar:7.2.1]
2020-03-22T16:35:33.042778+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121-heroku]
2020-03-22T16:35:33.042778+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121-heroku]
2020-03-22T16:35:33.042778+00:00 app[web.1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121-heroku]
2020-03-22T16:35:33.042779+00:00 app[web.1]: at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121-heroku]
2020-03-22T16:35:33.042779+00:00 app[web.1]: at org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:305) ~[spring-context-5.2.3.RELEASE.jar:5.2.3.RELEASE]
2020-03-22T16:35:33.042780+00:00 app[web.1]: at org.springframework.context.event.ApplicationListenerMethodAdapter.processEvent(ApplicationListenerMethodAdapter.java:190) ~[spring-context-5.2.3.RELEASE.jar:5.2.3.RELEASE]
2020-03-22T16:35:33.042783+00:00 app[web.1]: at org.springframework.context.event.ApplicationListenerMethodAdapter.onApplicationEvent(ApplicationListenerMethodAdapter.java:153) ~[spring-context-5.2.3.RELEASE.jar:5.2.3.RELEASE]
2020-03-22T16:35:33.042783+00:00 app[web.1]: at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.2.3.RELEASE.jar:5.2.3.RELEASE]
2020-03-22T16:35:33.042783+00:00 app[web.1]: at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.2.3.RELEASE.jar:5.2.3.RELEASE]
2020-03-22T16:35:33.042784+00:00 app[web.1]: at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.2.3.RELEASE.jar:5.2.3.RELEASE]
2020-03-22T16:35:33.042789+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:403) ~[spring-context-5.2.3.RELEASE.jar:5.2.3.RELEASE]
2020-03-22T16:35:33.042789+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:360) ~[spring-context-5.2.3.RELEASE.jar:5.2.3.RELEASE]
2020-03-22T16:35:33.042790+00:00 app[web.1]: at com.haulmont.cuba.core.sys.EventsImpl.publish(EventsImpl.java:33) ~[cuba-global-7.2.1.jar:7.2.1]
2020-03-22T16:35:33.042790+00:00 app[web.1]: at com.haulmont.cuba.web.sys.WebEvents.publish(WebEvents.java:36) ~[cuba-web-7.2.1.jar:7.2.1]
2020-03-22T16:35:33.042791+00:00 app[web.1]: at com.haulmont.cuba.core.sys.AbstractAppContextLoader.initAppContext(AbstractAppContextLoader.java:69) ~[cuba-global-7.2.1.jar:7.2.1]
2020-03-22T16:35:33.042791+00:00 app[web.1]: at com.haulmont.cuba.core.sys.AbstractWebAppContextLoader.contextInitialized(AbstractWebAppContextLoader.java:83) ~[cuba-global-7.2.1.jar:7.2.1]
2020-03-22T16:35:33.042792+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4685) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042792+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5146) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042793+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042793+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042794+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042794+00:00 app[web.1]: at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042794+00:00 app[web.1]: at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1133) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042795+00:00 app[web.1]: at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1867) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042795+00:00 app[web.1]: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_121-heroku]
2020-03-22T16:35:33.042795+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_121-heroku]
2020-03-22T16:35:33.042796+00:00 app[web.1]: at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) [tomcat-util.jar:9.0.27]
2020-03-22T16:35:33.042802+00:00 app[web.1]: at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112) [na:1.8.0_121-heroku]
2020-03-22T16:35:33.042803+00:00 app[web.1]: at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1045) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042803+00:00 app[web.1]: at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:429) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042804+00:00 app[web.1]: at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1576) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042804+00:00 app[web.1]: at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:309) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042804+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042805+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042805+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042806+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:936) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042806+00:00 app[web.1]: at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042806+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042807+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042807+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042808+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_121-heroku]
2020-03-22T16:35:33.042808+00:00 app[web.1]: at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) [tomcat-util.jar:9.0.27]
2020-03-22T16:35:33.042809+00:00 app[web.1]: at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) [na:1.8.0_121-heroku]
2020-03-22T16:35:33.042809+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042809+00:00 app[web.1]: at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042810+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042810+00:00 app[web.1]: at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042826+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042827+00:00 app[web.1]: at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042827+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042827+00:00 app[web.1]: at org.apache.catalina.startup.Catalina.start(Catalina.java:633) [catalina.jar:9.0.27]
2020-03-22T16:35:33.042827+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121-heroku]
2020-03-22T16:35:33.042828+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121-heroku]
2020-03-22T16:35:33.042828+00:00 app[web.1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121-heroku]
2020-03-22T16:35:33.042828+00:00 app[web.1]: at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121-heroku]
2020-03-22T16:35:33.042829+00:00 app[web.1]: at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:344) [bootstrap.jar:9.0.27]
2020-03-22T16:35:33.042829+00:00 app[web.1]: at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:475) [bootstrap.jar:9.0.27]
2020-03-22T16:35:33.046902+00:00 app[web.1]: 16:35:33.046 INFO  c.h.c.c.s.CubaThreadPoolTaskScheduler   - Shutting down ExecutorService 'scheduler'
2020-03-22T16:35:33.066640+00:00 app[web.1]: Mar 22, 2020 4:35:33 PM org.apache.catalina.core.StandardContext startInternal
2020-03-22T16:35:33.066642+00:00 app[web.1]: SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container log file
2020-03-22T16:35:33.067517+00:00 app[web.1]: Mar 22, 2020 4:35:33 PM org.apache.catalina.core.StandardContext startInternal
2020-03-22T16:35:33.067519+00:00 app[web.1]: SEVERE: Context [] startup failed due to previous errors
2020-03-22T16:35:33.081020+00:00 app[web.1]: Mar 22, 2020 4:35:33 PM org.apache.catalina.startup.HostConfig deployDirectory
2020-03-22T16:35:33.081022+00:00 app[web.1]: INFO: Deployment of web application directory [/app/deploy/tomcat/webapps/ROOT] has finished in [3,389] ms
2020-03-22T16:35:33.084313+00:00 app[web.1]: Mar 22, 2020 4:35:33 PM org.apache.coyote.AbstractProtocol start
2020-03-22T16:35:33.084314+00:00 app[web.1]: INFO: Starting ProtocolHandler ["http-nio-52250"]
2020-03-22T16:35:33.093596+00:00 app[web.1]: Mar 22, 2020 4:35:33 PM org.apache.coyote.AbstractProtocol start
2020-03-22T16:35:33.093597+00:00 app[web.1]: INFO: Starting ProtocolHandler ["ajp-nio-8009"]
2020-03-22T16:35:33.103289+00:00 app[web.1]: Mar 22, 2020 4:35:33 PM org.apache.catalina.startup.Catalina start
2020-03-22T16:35:33.103291+00:00 app[web.1]: INFO: Server startup in [5,002] milliseconds
2020-03-22T16:35:33.200112+00:00 heroku[router]: at=info method=GET path="/" host=kfz-werkstatt.herokuapp.com request_id=62f37935-01b6-4323-abd4-213d9f0005bd fwd="91.106.186.172" dyno=web.1 connect=0ms service=3259ms status=404 bytes=1245 protocol=https
2020-03-22T16:35:34.686808+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=kfz-werkstatt.herokuapp.com request_id=c6029d32-0caf-4f28-ba2c-16e6ec605bd6 fwd="91.106.186.172" dyno=web.1 connect=0ms service=3ms status=404 bytes=1245 protocol=https

I will try to repeat the tutorial for a cuba project based on version 7.1.

Cheers

If you need a sample application, you can use the CUBA petclinic application, which you can download from here: GitHub - cuba-platform/cuba-petclinic: CUBA Petclinic is a CUBA platform example application dealing with the domain of a pet clinic

The exception that causes the app not to start is this one:

java.lang.IllegalStateException: Resource not found: digital/wandelbar/kfzwerkstatt/metadata.xml

It seems the container is not able to retrieve some of the XML definitions that are part of your application. Can you double check that the metadata.xml file is available in this directory in the global module $PROJECT_ROOT/modules/src/digital/wandelbar/kfzwerkstatt/metadata.xml?

Can you also share your build.gradle file along with the procfile?

Thanks!

There is no metadata.xml but I dont have all of the directories either. in the “modules” directory are following directories: core, global, web

build.gradle:


buildscript {
    ext.cubaVersion = '7.2.1'
    repositories {
        maven {
            url 'https://dl.bintray.com/cuba-platform/main'
            
        }
        jcenter()

        
    }
    dependencies {
        classpath "com.haulmont.gradle:cuba-plugin:$cubaVersion"
    }
}

def modulePrefix = 'app'

def globalModule = project(":${modulePrefix}-global")
def coreModule = project(":${modulePrefix}-core")
def webModule = project(":${modulePrefix}-web")

def servletApi = 'javax.servlet:javax.servlet-api:3.1.0'

apply(plugin: 'cuba')

cuba {
    artifact {
        group = 'digital.wandelbar.kfzwerkstatt'
        version = '0.1'
        isSnapshot = true
    }
}

dependencies {
    appComponent("com.haulmont.cuba:cuba-global:$cubaVersion")
}

def postgres = 'org.postgresql:postgresql:42.2.9'

configure([globalModule, coreModule, webModule]) {
    apply(plugin: 'java-library')
    apply(plugin: 'maven')
    apply(plugin: 'cuba')

    dependencies {
            testCompile('org.junit.jupiter:junit-jupiter-api:5.5.2')
            testCompile('org.junit.jupiter:junit-jupiter-engine:5.5.2')
            testCompile('org.junit.vintage:junit-vintage-engine:5.5.2')  
        }

    task sourceJar(type: Jar) {
        from file('src')
        classifier = 'sources'
    }

    artifacts {
        archives sourceJar
    } 
    test {
        useJUnitPlatform()
    }
}


configure(globalModule) {
    dependencies {
        if (!JavaVersion.current().isJava8()) {
            runtime('javax.xml.bind:jaxb-api:2.3.1')
            runtime('org.glassfish.jaxb:jaxb-runtime:2.3.1')
        }
    }

    entitiesEnhancing {
        main {
            enabled = true
        }
    }
}

configure(coreModule) {

    configurations {
        jdbc
        dbscripts
    }

    dependencies {
        compile(globalModule)
        compileOnly(servletApi)
        jdbc(postgres)
        testRuntime(postgres)
    }

    task cleanConf(description: 'Cleans up conf directory', type: Delete) {
        delete "$cuba.appHome/${modulePrefix}-core/conf"
    }

    task deploy(dependsOn: [assemble, cleanConf], type: CubaDeployment) {
        appName = "${modulePrefix}-core"
        appJars(modulePrefix + '-global', modulePrefix + '-core')
    }

    task createDb(dependsOn: assembleDbScripts, description: 'Creates local database', type: CubaDbCreation) {
    }

    task updateDb(dependsOn: assembleDbScripts, description: 'Updates local database', type: CubaDbUpdate) {
    }
}

configure(webModule) {
    configurations {
        webcontent
    }

    dependencies {
        compileOnly(servletApi)
        compile(globalModule)
    }

    task webArchive(type: Zip) {
        from file("$buildDir/web")
        from file('web')
        classifier = 'web'
    }

    artifacts {
        archives webArchive
    }

    task deployConf(type: Copy) {
        from file('src')
        include "digital/wandelbar/kfzwerkstatt/**"
        into "$cuba.appHome/${modulePrefix}/conf"
    }

    task clearMessagesCache(type: CubaClearMessagesCache) {
        appName = "${modulePrefix}"
    }
    deployConf.dependsOn clearMessagesCache

    task cleanConf(description: 'Cleans up conf directory', type: Delete) {
        delete "$cuba.appHome/${modulePrefix}/conf"
    }

    task deploy(dependsOn: [assemble, cleanConf], type: CubaDeployment) {
        appName = "${modulePrefix}"
        appJars(modulePrefix + '-global', modulePrefix + '-web')
    }
}

task undeploy(type: Delete, dependsOn: ":${modulePrefix}-web:cleanConf") {
    delete("$cuba.tomcat.dir/shared")
    delete("$cuba.tomcat.dir/webapps/${modulePrefix}-core")
    delete("$cuba.tomcat.dir/webapps/${modulePrefix}")
}

task restart(dependsOn: ['stop', ":${modulePrefix}-core:deploy", ":${modulePrefix}-web:deploy"], description: 'Redeploys applications and restarts local Tomcat') {
    doLast {
        ant.waitfor(maxwait: 6, maxwaitunit: 'second', checkevery: 2, checkeveryunit: 'second') {
            not {
                socket(server: 'localhost', port: '8787')
            }
        }
    }
}

task stage(dependsOn: ['setupTomcat', ':app-core:deploy', ':app-web:deploy']) {
    doLast {
        // replace context.xml with heroku-context.xml
        def src = new File('modules/core/web/META-INF/heroku-context.xml')
        def dst = new File('deploy/tomcat/webapps/app-core/META-INF/context.xml')
        dst.delete()
        dst << src.text

        // change port from 8080 to heroku $PORT
        def file = new File('deploy/tomcat/conf/server.xml')
        file.text = file.text.replace('8080', '${port.http}')

        // add local.app.properties for core application
        def coreConfDir = new File('deploy/tomcat/conf/app-core/')
        coreConfDir.mkdirs()
        def coreProperties = new File(coreConfDir, 'local.app.properties')
        coreProperties.text = ''' cuba.automaticDatabaseUpdate = true '''

        // rename deploy/tomcat/webapps/app to deploy/tomcat/webapps/ROOT
        def rootFolder = new File('deploy/tomcat/webapps/ROOT')
        if (rootFolder.exists()) {
            rootFolder.deleteDir()
        }

        def webAppDir = new File('deploy/tomcat/webapps/app')
        webAppDir.renameTo( new File(rootFolder.path) )

        // add local.app.properties for web application
        def webConfDir = new File('deploy/tomcat/conf/ROOT/')
        webConfDir.mkdirs()
        def webProperties = new File(webConfDir, 'local.app.properties')
        webProperties.text = ''' cuba.webContextName = / '''
    }
}

restart.finalizedBy start

Procfile

web: cd ./deploy/tomcat/bin && export 'JAVA_OPTS=-Dport.http=$PORT' && ./catalina.sh run

ah, sorry - i mistyped. It has to be in the global module like this:


$PROJECT_ROOT/modules/global/src/digital/wandelbar/kfzwerkstatt/metadata.xml

Perhaps it is easiest if you do the following:

  1. try the tutorial with the petclinic project and see if it works on heroku
  2. share your project / create a dedicated example project which contains the problem

With either of those we should be able to help you…

I assume you are using PostgreSQL on Heroku. As the petclinic project currently does not support PostgreSQL I generated the scripts for you. Attached you will find the complete petclinic project with 7.2.1 and Postgres support. See here: cuba-petclinic.zip (5.0 MB)

Cheers
Mario

Hi,

here you find my project: https://github.com/nicokowalczyk/kfz-werstatt

The pet-clinic example did not work as well.

Got some error while heroku deployment:

-----> Gradle app detected
-----> Installing JDK 1.8.0_121... done
-----> Building Gradle app...
-----> executing ./gradlew stage
       Downloading https://services.gradle.org/distributions/gradle-5.6.4-bin.zip
       .........................................................................................
       Unzipping /app/tmp/cache/.gradle/wrapper/dists/gradle-5.6.4-bin/bxirm19lnfz6nurbatndyydux/gradle-5.6.4-bin.zip to /app/tmp/cache/.gradle/wrapper/dists/gradle-5.6.4-bin/bxirm19lnfz6nurbatndyydux
       Set executable permissions for: /app/tmp/cache/.gradle/wrapper/dists/gradle-5.6.4-bin/bxirm19lnfz6nurbatndyydux/gradle-5.6.4/bin/gradle
       
       FAILURE: Build failed with an exception.
       
       * What went wrong:
       Could not determine the dependencies of task ':stage'.
       > Task with path ':app-core:deploy' not found in root project 'cuba-petclinic'.
       
       * Try:
       Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
       
       * Get more help at https://help.gradle.org
       
       Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
       Use '--warning-mode all' to show the individual deprecation warnings.
       See https://docs.gradle.org/5.6.4/userguide/command_line_interface.html#sec:command_line_warnings
       
       BUILD FAILED in 48s
 !     ERROR: Failed to run Gradle!
       We're sorry this build is failing. If you can't find the issue in application
       code, please submit a ticket so we can help: https://help.heroku.com
       You can also try reverting to the previous version of the buildpack by running:
       $ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-gradle#previous-version
       
       Thanks,
       Heroku
 !     Push rejected, failed to compile Gradle app.
 !     Push failed

None of the depending tasks is defined in the build.gradle file in the pet-clinic example.

I just tried to locally run your provided application and get the same error with the metadata.xml.

Did it work on your side to run it locally via CUBA studio?

I created a new project based on version 7.1.5

this worked a little bit. The scheme is created in postgres and the logs look nice.

2020-03-22T17:30:28.480548+00:00 app[api]: Initial release by user nico.kowalczyk@googlemail.com
2020-03-22T17:30:28.480548+00:00 app[api]: Release v1 created by user nico.kowalczyk@googlemail.com
2020-03-22T17:30:28.617895+00:00 app[api]: Enable Logplex by user nico.kowalczyk@googlemail.com
2020-03-22T17:30:28.617895+00:00 app[api]: Release v2 created by user nico.kowalczyk@googlemail.com
2020-03-22T17:31:07.001069+00:00 app[api]: @ref:postgresql-rectangular-67592 completed provisioning, setting DATABASE_URL. by user nico.kowalczyk@googlemail.com
2020-03-22T17:31:07.001069+00:00 app[api]: Release v4 created by user nico.kowalczyk@googlemail.com
2020-03-22T17:31:06.986984+00:00 app[api]: Attach DATABASE (@ref:postgresql-rectangular-67592) by user nico.kowalczyk@googlemail.com
2020-03-22T17:31:06.986984+00:00 app[api]: Running release v3 commands by user nico.kowalczyk@googlemail.com
2020-03-22T17:37:36.000000+00:00 app[api]: Build started by user nico.kowalczyk@googlemail.com
2020-03-22T17:39:19.158130+00:00 app[api]: Scaled to web@1:Free by user nico.kowalczyk@googlemail.com
2020-03-22T17:39:19.143255+00:00 app[api]: Release v5 created by user nico.kowalczyk@googlemail.com
2020-03-22T17:39:19.143255+00:00 app[api]: Deploy 4eb0f73c by user nico.kowalczyk@googlemail.com
2020-03-22T17:39:24.564585+00:00 heroku[web.1]: Starting process with command `cd ./deploy/tomcat/bin && export 'JAVA_OPTS=-Dport.http=42640' && ./catalina.sh run`
2020-03-22T17:39:26.590663+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-03-22T17:39:26.600384+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2020-03-22T17:39:27.589318+00:00 app[web.1]: Mar 22, 2020 5:39:27 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
2020-03-22T17:39:27.589365+00:00 app[web.1]: INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/app/.jdk/jre/lib/amd64/server::/usr/java/packages/lib/amd64:/usr/lib6
4:/lib64:/lib:/usr/lib]
2020-03-22T17:39:27.794113+00:00 app[web.1]: Mar 22, 2020 5:39:27 PM org.apache.coyote.AbstractProtocol init
2020-03-22T17:39:27.794115+00:00 app[web.1]: INFO: Initializing ProtocolHandler ["http-nio-42640"]
2020-03-22T17:39:28.091607+00:00 heroku[web.1]: State changed from starting to up
2020-03-22T17:39:27.845873+00:00 app[web.1]: Mar 22, 2020 5:39:27 PM org.apache.coyote.AbstractProtocol init
2020-03-22T17:39:27.845888+00:00 app[web.1]: INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
2020-03-22T17:39:27.884576+00:00 app[web.1]: Mar 22, 2020 5:39:27 PM org.apache.catalina.startup.Catalina load
2020-03-22T17:39:27.884578+00:00 app[web.1]: INFO: Server initialization in [765] milliseconds
2020-03-22T17:39:27.923254+00:00 app[web.1]: Mar 22, 2020 5:39:27 PM org.apache.catalina.core.StandardService startInternal
2020-03-22T17:39:27.923257+00:00 app[web.1]: INFO: Starting service [Catalina]
2020-03-22T17:39:27.924446+00:00 app[web.1]: Mar 22, 2020 5:39:27 PM org.apache.catalina.core.StandardEngine startInternal
2020-03-22T17:39:27.924447+00:00 app[web.1]: INFO: Starting Servlet engine: [Apache Tomcat/9.0.19]
2020-03-22T17:39:27.937486+00:00 app[web.1]: Mar 22, 2020 5:39:27 PM org.apache.catalina.startup.HostConfig deployDirectory
2020-03-22T17:39:27.937488+00:00 app[web.1]: INFO: Deploying web application directory [/app/deploy/tomcat/webapps/ROOT]
2020-03-22T17:39:29.688608+00:00 app[web.1]: 17:39:29.684 INFO  c.h.cuba.core.sys.AppComponents         - Using app components: [com.haulmont.cuba]
2020-03-22T17:39:29.753234+00:00 app[web.1]: 17:39:29.752 INFO  c.h.c.c.s.AbstractWebAppContextLoader   - Loading app properties from classpath:com/company/test/web-app.properties
2020-03-22T17:39:30.059088+00:00 app[web.1]: 17:39:30.058 INFO  c.h.c.c.s.e.EnvironmentChecksRunner     - Environment checks on web module completed successfully
2020-03-22T17:39:32.000000+00:00 app[api]: Build succeeded
2020-03-22T17:39:32.977881+00:00 app[web.1]: 17:39:32.977 INFO  c.h.c.c.s.r.d.StaticServerSelector      - Server URLs: [http://localhost:8080/app-core/remoting]
2020-03-22T17:39:33.018739+00:00 app[web.1]: 17:39:33.018 INFO  c.h.c.w.s.r.WebRemoteProxyBeanCreator   - Configuring proxy beans for local service invocations: [cuba_ConstraintScriptValidationService, cuba_AuthenticationService, cuba_TrustedClientService, cuba_Ser
verInfoService, cuba_UserSettingService, cuba_UserManagementService, cuba_DataService, cuba_ConfigStorageService, cuba_PersistenceManagerService, cuba_LockService, cuba_UserSessionService, cuba_FoldersService, cuba_EmailService, cuba_FileStorageService, cuba_Entity
SnapshotService, cuba_UniqueNumbersService, cuba_LocalizedMessageService, cuba_ResourceService, cuba_ScheduledTasksService, cuba_EntityLogService, cuba_TestingService, cuba_DomainDescriptionService, cuba_RelatedEntitiesService, cuba_EntitySqlGenerationService, cuba
_NumberIdService, cuba_QueryResultsService, cuba_DynamicAttributesCacheService, cuba_EntityRestoreService, cuba_LocalFileExchangeService, cuba_EntityImportExportService, cuba_ConstraintLocalizationService, cuba_AttributeAccessService, cuba_ExceptionReportService, c
uba_BulkEditorDataService, cuba_AttributeOptionsLoaderService]
2020-03-22T17:39:35.504632+00:00 app[web.1]: 17:39:35.503 INFO  c.h.c.c.s.CubaThreadPoolTaskScheduler   - Initializing ExecutorService 'scheduler'
2020-03-22T17:39:35.904946+00:00 app[web.1]: 17:39:35.904 INFO  c.h.cuba.core.sys.jmx.MBeanExporter     - Registering beans for JMX exposure: [app.cuba:type=ConfigStorage, app.cuba:type=CachingFacade, app.cuba:type=FileUploading, app.cuba:type=JmxNodeIdentifier, ap
p.cuba:type=JmxLogControl, app.cuba:type=ClassLoaderManager, app.cuba:type=StatisticsCounter]
2020-03-22T17:39:36.079998+00:00 app[web.1]: 17:39:36.079 INFO  c.h.cuba.core.sys.MetadataImpl          - Initializing metadata
2020-03-22T17:39:36.506555+00:00 app[web.1]: 17:39:36.506 INFO  c.h.cuba.core.sys.MetadataImpl          - Metadata initialized in 426 ms
2020-03-22T17:39:36.552072+00:00 app[web.1]: 17:39:36.551 INFO  c.h.c.c.s.AbstractWebAppContextLoader   - AppContext started
2020-03-22T17:39:36.605691+00:00 app[web.1]: 17:39:36.605 INFO  c.h.c.web.sys.CubaDispatcherServlet     - Initializing Servlet 'dispatcher'
2020-03-22T17:39:38.002617+00:00 app[web.1]: 17:39:38.002 INFO  c.h.c.web.sys.CubaDispatcherServlet     - Completed initialization in 1397 ms
2020-03-22T17:39:38.015281+00:00 app[web.1]: Mar 22, 2020 5:39:38 PM org.apache.catalina.startup.HostConfig deployDirectory
2020-03-22T17:39:38.015283+00:00 app[web.1]: INFO: Deployment of web application directory [/app/deploy/tomcat/webapps/ROOT] has finished in [10,078] ms
2020-03-22T17:39:38.016164+00:00 app[web.1]: Mar 22, 2020 5:39:38 PM org.apache.catalina.startup.HostConfig deployDirectory
2020-03-22T17:39:38.016165+00:00 app[web.1]: INFO: Deploying web application directory [/app/deploy/tomcat/webapps/app-core]
2020-03-22T17:39:38.096603+00:00 app[web.1]: 17:39:38.096 INFO  c.h.cuba.core.sys.AppComponents         - Using app components: [com.haulmont.cuba]
2020-03-22T17:39:38.103449+00:00 app[web.1]: 17:39:38.103 INFO  c.h.c.c.s.AbstractWebAppContextLoader   - Loading app properties from classpath:com/company/test/app.properties
2020-03-22T17:39:38.104481+00:00 app[web.1]: 17:39:38.104 INFO  c.h.c.c.s.AbstractWebAppContextLoader   - Loading app properties from file:/app/deploy/tomcat/conf/app-core/local.app.properties
2020-03-22T17:39:38.110220+00:00 app[web.1]: 17:39:38.110 INFO  c.h.cuba.core.sys.AppContextLoader      - DbmsType of the main database is set to postgres
2020-03-22T17:39:38.119843+00:00 app[web.1]: 17:39:38.119 INFO  c.h.c.c.s.e.DataStoresCheck             - Checking connection to data store _MAIN_
2020-03-22T17:39:38.392817+00:00 app[web.1]: 17:39:38.392 INFO  c.h.c.c.s.e.EnvironmentChecksRunner     - Environment checks on core module completed successfully
2020-03-22T17:39:38.471550+00:00 app[web.1]: 17:39:38.471 INFO  c.h.c.c.s.p.PersistenceConfigProcessor  - Creating file /app/deploy/tomcat/work/app-core/persistence.xml
2020-03-22T17:39:44.026791+00:00 app[web.1]: 17:39:44.026 INFO  c.h.c.c.s.CubaThreadPoolTaskScheduler   - Initializing ExecutorService 'scheduler'
2020-03-22T17:39:44.219454+00:00 app[web.1]: 17:39:44.219 INFO  c.h.cuba.core.sys.jmx.MBeanExporter     - Registering beans for JMX exposure: [app-core.cuba:type=PersistenceManager, app-core.cuba:type=ConfigStorage, app-core.cuba:type=UserSessions, app-core.cuba:ty
pe=UniqueNumbers, app-core.cuba:type=Emailer, app-core.cuba:type=EntityLog, app-core.cuba:type=FileStorage, app-core.cuba:type=LockManager, app-core.cuba:type=CachingFacade, app-core.cuba:type=ClusterManager, app-core.cuba:type=ScriptingManager, app-core.cuba:type=
ServerInfo, app-core.cuba:type=Scheduling, app-core.cuba:type=PasswordEncryptionSupport, app-core.cuba:type=JmxNodeIdentifier, app-core.cuba:type=JmxLogControl, app-core.cuba:type=ClassLoaderManager, app-core.cuba:type=StatisticsCounter, app-core.cuba:type=BruteFor
ceProtection, app-core.cuba:type=QueryCacheSupport]
2020-03-22T17:39:44.432724+00:00 app[web.1]: 17:39:44.432 INFO  c.h.cuba.core.sys.MetadataImpl          - Initializing metadata
2020-03-22T17:39:44.660172+00:00 app[web.1]: 17:39:44.659 INFO  c.h.cuba.core.sys.MetadataImpl          - Metadata initialized in 227 ms
2020-03-22T17:39:44.704832+00:00 app[web.1]: 17:39:44.704 INFO  c.h.c.c.sys.dbupdate.DbUpdaterEngine    - Initializing database
2020-03-22T17:39:44.800330+00:00 app[web.1]: 17:39:44.800 INFO  c.h.c.c.sys.dbupdate.DbUpdaterEngine    - Executing script 10-cuba/init/postgres/create-db.sql
2020-03-22T17:39:45.630920+00:00 app[web.1]: 17:39:45.630 INFO  c.h.c.c.sys.dbupdate.DbUpdaterEngine    - Executing script 50-test/init/postgres/10.create-db.sql
2020-03-22T17:39:45.634610+00:00 app[web.1]: 17:39:45.634 INFO  c.h.c.c.sys.dbupdate.DbUpdaterEngine    - Executing script 50-test/init/postgres/20.create-db.sql
2020-03-22T17:39:45.640655+00:00 app[web.1]: 17:39:45.640 INFO  c.h.c.c.sys.dbupdate.DbUpdaterEngine    - Executing script 50-test/init/postgres/30.create-db.sql
2020-03-22T17:39:46.147404+00:00 app[web.1]: 17:39:46.147 INFO  c.h.c.c.sys.dbupdate.DbUpdaterEngine    - Database initialized
2020-03-22T17:39:46.761791+00:00 app[web.1]: 17:39:46.761 INFO  c.h.cuba.core.app.ConfigStorage         - Loading DB-stored app properties cache
2020-03-22T17:39:47.336663+00:00 app[web.1]: 17:39:47.336 INFO  c.h.c.c.s.DefaultPermissionValuesConfig - Initializing default permission values
2020-03-22T17:39:47.443502+00:00 app[web.1]: 17:39:47.443 INFO  c.h.c.s.a.AuthenticationManagerBean     - Logged in: c70dbcb5-7f16-d175-2fa9-29a6e805194e [anonymous]
2020-03-22T17:39:47.445431+00:00 app[web.1]: 17:39:47.445 INFO  c.h.c.c.s.AbstractWebAppContextLoader   - AppContext started
2020-03-22T17:39:47.448650+00:00 app[web.1]: 17:39:47.448 INFO  c.h.c.c.sys.remoting.RemotingServlet    - Initializing Servlet 'remoting'
2020-03-22T17:39:47.481531+00:00 app[web.1]: 17:39:47.480 INFO  c.h.c.c.s.r.RemoteServicesBeanCreator   - Configuring remote services
2020-03-22T17:39:47.738641+00:00 app[web.1]: 17:39:47.738 INFO  c.h.c.c.sys.remoting.RemotingServlet    - Completed initialization in 290 ms
2020-03-22T17:39:47.746370+00:00 app[web.1]: Mar 22, 2020 5:39:47 PM org.apache.catalina.startup.HostConfig deployDirectory
2020-03-22T17:39:47.746372+00:00 app[web.1]: INFO: Deployment of web application directory [/app/deploy/tomcat/webapps/app-core] has finished in [9,725] ms
2020-03-22T17:39:47.754575+00:00 app[web.1]: Mar 22, 2020 5:39:47 PM org.apache.coyote.AbstractProtocol start
2020-03-22T17:39:47.754577+00:00 app[web.1]: INFO: Starting ProtocolHandler ["http-nio-42640"]
2020-03-22T17:39:47.876813+00:00 app[web.1]: Mar 22, 2020 5:39:47 PM org.apache.coyote.AbstractProtocol start
2020-03-22T17:39:47.876816+00:00 app[web.1]: INFO: Starting ProtocolHandler ["ajp-nio-8009"]
2020-03-22T17:39:47.927644+00:00 app[web.1]: Mar 22, 2020 5:39:47 PM org.apache.catalina.startup.Catalina start
2020-03-22T17:39:47.927646+00:00 app[web.1]: INFO: Server startup in [20,042] milliseconds

but i cannot acces the app. :frowning:

https://test-cuba.herokuapp.com/

It didnt work…

But lets concentrate on this one: https://github.com/nicokowalczyk/test

Its based on 7.1.5 (I’m fine with this for starting a new project)

Locally this one starts perfectly. But I cannot acces this app within heroku.

hmm,
this is a little strange.

I did the very same thing and it worked. The sample app is just a 7.1.5 app: GitHub - mariodavid/cuba71sample

running app looks like this: https://kfz-werkstatt-test.herokuapp.com/#main

57

I just followed all steps from here: Deployment from GitHub to Heroku - CUBA Platform. Developer’s Manual

Corresponding build logs:

-----> Gradle app detected
-----> Installing JDK 1.8.0_121... done
-----> Building Gradle app...
-----> executing ./gradlew stage
       Downloading https://services.gradle.org/distributions/gradle-4.10.3-bin.zip
       ..........................................................................
       > Task :setupTomcat
       > Task :app-core:assembleDbScripts
       > Task :app-core:beansXml
       > Task :app-global:beansXml
       > Task :app-global:processResources
       > Task :app-global:buildInfo
       > Task :app-global:compileJava NO-SOURCE
       > Task :app-global:classes
       > Task :app-global:jar
       > Task :app-core:compileJava NO-SOURCE
       > Task :app-core:processResources
       > Task :app-core:classes
       > Task :app-core:jar
       > Task :app-core:sourceJar
       > Task :app-core:assemble
       > Task :app-core:cleanConf
       > Task :app-core:deploy
       > Task :app-web:beansXml
       > Task :app-web:compileJava NO-SOURCE
       > Task :app-web:processResources
       > Task :app-web:classes
       > Task :app-web:jar
       > Task :app-web:sourceJar
       > Task :app-web:webArchive
       > Task :app-web:assemble
       > Task :app-web:cleanConf
       > Task :app-web:deploy
       > Task :stage
       
       BUILD SUCCESSFUL in 1m 22s
       20 actionable tasks: 20 executed
-----> Discovering process types
       Procfile declares types -> web
-----> Compressing...
       Done: 119.5M
-----> Launching...
       Released v5
       https://kfz-werkstatt-test.herokuapp.com/ deployed to Heroku

heroku log cli gave me this one:

[cuba71sample] heroku logs --tail --app kfz-werkstatt-test                                                                                                                                                                                                       master 
 ›   Warning: heroku update available from 7.21.0 to 7.39.1
2020-03-22T17:50:20.155315+00:00 app[api]: Release v1 created by user heroku@die-davids.de
2020-03-22T17:50:20.584900+00:00 app[api]: Release v2 created by user heroku@die-davids.de
2020-03-22T17:50:20.584900+00:00 app[api]: Enable Logplex by user heroku@die-davids.de
2020-03-22T17:50:20.155315+00:00 app[api]: Initial release by user heroku@die-davids.de
2020-03-22T17:55:09.374934+00:00 app[api]: Running release v3 commands by user heroku@die-davids.de
2020-03-22T17:55:09.374934+00:00 app[api]: Attach DATABASE (@ref:postgresql-deep-05618) by user heroku@die-davids.de
2020-03-22T17:55:09.387756+00:00 app[api]: @ref:postgresql-deep-05618 completed provisioning, setting DATABASE_URL. by user heroku@die-davids.de
2020-03-22T17:55:09.387756+00:00 app[api]: Release v4 created by user heroku@die-davids.de
2020-03-22T18:17:04.000000+00:00 app[api]: Build started by user heroku@die-davids.de
2020-03-22T18:18:41.411162+00:00 app[api]: Release v5 created by user heroku@die-davids.de
2020-03-22T18:18:41.411162+00:00 app[api]: Deploy 40491a29 by user heroku@die-davids.de
2020-03-22T18:18:41.434190+00:00 app[api]: Scaled to web@1:Free by user heroku@die-davids.de
2020-03-22T18:18:47.787258+00:00 heroku[web.1]: Starting process with command `cd ./deploy/tomcat/bin && export 'JAVA_OPTS=-Dport.http=58228' && ./catalina.sh run`
2020-03-22T18:18:49.921538+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-03-22T18:18:49.931770+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2020-03-22T18:18:50.804163+00:00 app[web.1]: Mar 22, 2020 6:18:50 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
2020-03-22T18:18:50.804200+00:00 app[web.1]: INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/app/.jdk/jre/lib/amd64/server::/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
2020-03-22T18:18:50.967723+00:00 app[web.1]: Mar 22, 2020 6:18:50 PM org.apache.coyote.AbstractProtocol init
2020-03-22T18:18:50.967724+00:00 app[web.1]: INFO: Initializing ProtocolHandler ["http-nio-58228"]
2020-03-22T18:18:50.999182+00:00 app[web.1]: Mar 22, 2020 6:18:50 PM org.apache.coyote.AbstractProtocol init
2020-03-22T18:18:50.999183+00:00 app[web.1]: INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
2020-03-22T18:18:51.001780+00:00 app[web.1]: Mar 22, 2020 6:18:51 PM org.apache.catalina.startup.Catalina load
2020-03-22T18:18:51.001782+00:00 app[web.1]: INFO: Server initialization in [565] milliseconds
2020-03-22T18:18:51.455501+00:00 heroku[web.1]: State changed from starting to up
2020-03-22T18:18:51.056081+00:00 app[web.1]: Mar 22, 2020 6:18:51 PM org.apache.catalina.core.StandardService startInternal
2020-03-22T18:18:51.056098+00:00 app[web.1]: INFO: Starting service [Catalina]
2020-03-22T18:18:51.056891+00:00 app[web.1]: Mar 22, 2020 6:18:51 PM org.apache.catalina.core.StandardEngine startInternal
2020-03-22T18:18:51.056894+00:00 app[web.1]: INFO: Starting Servlet engine: [Apache Tomcat/9.0.19]
2020-03-22T18:18:51.065021+00:00 app[web.1]: Mar 22, 2020 6:18:51 PM org.apache.catalina.startup.HostConfig deployDirectory
2020-03-22T18:18:51.065022+00:00 app[web.1]: INFO: Deploying web application directory [/app/deploy/tomcat/webapps/ROOT]
2020-03-22T18:18:51.947516+00:00 app[web.1]: 18:18:51.943 INFO  c.h.cuba.core.sys.AppComponents         - Using app components: [com.haulmont.cuba]
2020-03-22T18:18:51.988975+00:00 app[web.1]: 18:18:51.988 INFO  c.h.c.c.s.AbstractWebAppContextLoader   - Loading app properties from classpath:com/company/cuba71sample/web-app.properties
2020-03-22T18:18:52.234424+00:00 app[web.1]: 18:18:52.234 INFO  c.h.c.c.s.e.EnvironmentChecksRunner     - Environment checks on web module completed successfully
2020-03-22T18:18:54.379207+00:00 app[web.1]: 18:18:54.379 INFO  c.h.c.c.s.r.d.StaticServerSelector      - Server URLs: [http://localhost:8080/app-core/remoting]
2020-03-22T18:18:54.394480+00:00 app[web.1]: 18:18:54.394 INFO  c.h.c.w.s.r.WebRemoteProxyBeanCreator   - Configuring proxy beans for local service invocations: [cuba_ConstraintScriptValidationService, cuba_AuthenticationService, cuba_TrustedClientService, cuba_ServerInfoService, cuba_UserSettingService, cuba_UserManagementService, cuba_DataService, cuba_ConfigStorageService, cuba_PersistenceManagerService, cuba_LockService, cuba_UserSessionService, cuba_FoldersService, cuba_EmailService, cuba_FileStorageService, cuba_EntitySnapshotService, cuba_UniqueNumbersService, cuba_LocalizedMessageService, cuba_ResourceService, cuba_ScheduledTasksService, cuba_EntityLogService, cuba_TestingService, cuba_DomainDescriptionService, cuba_RelatedEntitiesService, cuba_EntitySqlGenerationService, cuba_NumberIdService, cuba_QueryResultsService, cuba_DynamicAttributesCacheService, cuba_EntityRestoreService, cuba_LocalFileExchangeService, cuba_EntityImportExportService, cuba_ConstraintLocalizationService, cuba_AttributeAccessService, cuba_ExceptionReportService, cuba_BulkEditorDataService, cuba_AttributeOptionsLoaderService]
2020-03-22T18:18:54.000000+00:00 app[api]: Build succeeded
2020-03-22T18:18:55.826882+00:00 app[web.1]: 18:18:55.826 INFO  c.h.c.c.s.CubaThreadPoolTaskScheduler   - Initializing ExecutorService 'scheduler'
2020-03-22T18:18:56.093219+00:00 app[web.1]: 18:18:56.093 INFO  c.h.cuba.core.sys.jmx.MBeanExporter     - Registering beans for JMX exposure: [app.cuba:type=ConfigStorage, app.cuba:type=CachingFacade, app.cuba:type=FileUploading, app.cuba:type=JmxNodeIdentifier, app.cuba:type=JmxLogControl, app.cuba:type=ClassLoaderManager, app.cuba:type=StatisticsCounter]
2020-03-22T18:18:56.223640+00:00 app[web.1]: 18:18:56.223 INFO  c.h.cuba.core.sys.MetadataImpl          - Initializing metadata
2020-03-22T18:18:56.521959+00:00 app[web.1]: 18:18:56.521 INFO  c.h.cuba.core.sys.MetadataImpl          - Metadata initialized in 298 ms
2020-03-22T18:18:56.550387+00:00 app[web.1]: 18:18:56.550 INFO  c.h.c.c.s.AbstractWebAppContextLoader   - AppContext started
2020-03-22T18:18:56.574472+00:00 app[web.1]: 18:18:56.574 INFO  c.h.c.web.sys.CubaDispatcherServlet     - Initializing Servlet 'dispatcher'
2020-03-22T18:18:57.410837+00:00 app[web.1]: 18:18:57.410 INFO  c.h.c.web.sys.CubaDispatcherServlet     - Completed initialization in 836 ms
2020-03-22T18:18:57.420440+00:00 app[web.1]: Mar 22, 2020 6:18:57 PM org.apache.catalina.startup.HostConfig deployDirectory
2020-03-22T18:18:57.420441+00:00 app[web.1]: INFO: Deployment of web application directory [/app/deploy/tomcat/webapps/ROOT] has finished in [6,355] ms
2020-03-22T18:18:57.420992+00:00 app[web.1]: Mar 22, 2020 6:18:57 PM org.apache.catalina.startup.HostConfig deployDirectory
2020-03-22T18:18:57.420992+00:00 app[web.1]: INFO: Deploying web application directory [/app/deploy/tomcat/webapps/app-core]
2020-03-22T18:18:57.482880+00:00 app[web.1]: 18:18:57.482 INFO  c.h.cuba.core.sys.AppComponents         - Using app components: [com.haulmont.cuba]
2020-03-22T18:18:57.488898+00:00 app[web.1]: 18:18:57.488 INFO  c.h.c.c.s.AbstractWebAppContextLoader   - Loading app properties from classpath:com/company/cuba71sample/app.properties
2020-03-22T18:18:57.489683+00:00 app[web.1]: 18:18:57.489 INFO  c.h.c.c.s.AbstractWebAppContextLoader   - Loading app properties from file:/app/deploy/tomcat/conf/app-core/local.app.properties
2020-03-22T18:18:57.493873+00:00 app[web.1]: 18:18:57.493 INFO  c.h.cuba.core.sys.AppContextLoader      - DbmsType of the main database is set to postgres
2020-03-22T18:18:57.499788+00:00 app[web.1]: 18:18:57.499 INFO  c.h.c.c.s.e.DataStoresCheck             - Checking connection to data store _MAIN_
2020-03-22T18:18:57.827182+00:00 app[web.1]: 18:18:57.827 INFO  c.h.c.c.s.e.EnvironmentChecksRunner     - Environment checks on core module completed successfully
2020-03-22T18:18:57.892272+00:00 app[web.1]: 18:18:57.892 INFO  c.h.c.c.s.p.PersistenceConfigProcessor  - Creating file /app/deploy/tomcat/work/app-core/persistence.xml
2020-03-22T18:19:01.958554+00:00 app[web.1]: 18:19:01.958 INFO  c.h.c.c.s.CubaThreadPoolTaskScheduler   - Initializing ExecutorService 'scheduler'
2020-03-22T18:19:02.062120+00:00 app[web.1]: 18:19:02.061 INFO  c.h.cuba.core.sys.jmx.MBeanExporter     - Registering beans for JMX exposure: [app-core.cuba:type=PersistenceManager, app-core.cuba:type=ConfigStorage, app-core.cuba:type=UserSessions, app-core.cuba:type=UniqueNumbers, app-core.cuba:type=Emailer, app-core.cuba:type=EntityLog, app-core.cuba:type=FileStorage, app-core.cuba:type=LockManager, app-core.cuba:type=CachingFacade, app-core.cuba:type=ClusterManager, app-core.cuba:type=ScriptingManager, app-core.cuba:type=ServerInfo, app-core.cuba:type=Scheduling, app-core.cuba:type=PasswordEncryptionSupport, app-core.cuba:type=JmxNodeIdentifier, app-core.cuba:type=JmxLogControl, app-core.cuba:type=ClassLoaderManager, app-core.cuba:type=StatisticsCounter, app-core.cuba:type=BruteForceProtection, app-core.cuba:type=QueryCacheSupport]

What you can & should probably do is to compare the two projects and see where the delta is in the files.

Ok,

I just tried your URL and it also works for me:

53.

In the first load Heroku normally takes some time to instantiate the app. Perhaps this was the problem in your case?

In the hobby-dev free plan heroku spins up the dynos on the fly and also hibernates them if not used actively after 30 mins or so… (if I recall correctly).

1 Like

Wow, this is really strage. I cannot access the page within my local network. I navigated to the cuba-test app on my phone with wifi. It didn’t work. Afterwards i tried to access the page with mobile network and it worked.

Thanks for your help Mario!

I also double-checked CUBA 7.2.1 by updating the app via studio and do a git push.

It finally worked, but only after I added the following to lines in the app.properties:

43

cuba.dataSourceProvider = jndi
cuba.automaticDatabaseUpdate = true

(see force automatic DB update · mariodavid/cuba71sample@c080510 · GitHub)

Normally I would have expected that the gradlew stage task from the docs does this as it says:

        def coreConfDir = new File('deploy/tomcat/conf/app-core/')
        coreConfDir.mkdirs()
        def coreProperties = new File(coreConfDir, 'local.app.properties')
        coreProperties.text = ''' cuba.automaticDatabaseUpdate = true '''

Apparently it did not really help - meaning auto update was not setup. This caused the app to crash because of missing DB updates from CUBA 7.2.

But it was an easy workaround by doing it in the app.properties file. In fact I’m also not 100% sure about the cuba.dataSourceProvider = jndi - if it is really required, it is a new thing in 7.2.

Perhaps this is something for the docs to update? @subbotin @gorbunkov - not sure who made the initial heroku deployment scripts. Perhaps someone from you guys can help

Regarding your other problem with the metadata, I’m not really sure. Perhaps you once again check the difference in the projects. As I already said - for me it did not even work locally.

Cheers
Mario