No main manifest for Uber JAR

In following the directions in the Cuba manual for running an Uber JAR deployment, I get the following message…

no main manifest attribute, in C:\Users\esamsta1\Desktop\Clinic 2.0 Dev\deploy\tomcat\webapps\app-core\WEB-INF\lib\app-core-0.1-SNAPSHOT.jar

This was in response to running…

java -jar "C:\Users\esamsta1\Desktop\Clinic 2.0 Dev\deploy\tomcat\webapps\app-core\WEB-INF\lib\app-core-0.1-SNAPSHOT.jar"

Where am I going wrong?

Thanks
Eric

Hi,
UberJar is generated by the buildUberJar task. Launch it.
image

The generated uberJar is put to {project_root}/build/distributions/uberJar folder. CD there and launch java -jar app-core.jar app.jar

Thanks for the reply. I was able to access the buildUberJar task and to build app.jar. However, the app-core.jar file is missing. How do I build this? Is it a different gradle task?

Thanks
Eric

BuildUberJar could be launched with the singleJar = true option. Single Jar (app.jar) file is generated in this case. It contains both: client and middleware.
The option is enabled by default.

image

Yes, thanks for the idea. I did do as you said. I’m able to access the app in my browser, but it gives “Unexpected error” rather than the login screen. Here are the log file entries:

2018-05-17 07:17:11.591 DEBUG [qtp1531448569-12] com.haulmont.cuba.web.App - Initializing application
2018-05-17 07:17:11.595 ERROR [qtp1531448569-12] com.haulmont.cuba.web.AppUI - Unable to init ui
java.lang.IllegalArgumentException: Service app-core/cuba_LoginService is not registered in LocalServiceDirectory
at com.haulmont.cuba.web.sys.remoting.LocalServiceProxy$LocalServiceInvocationHandler.invoke(LocalServiceProxy.java:99)
at com.sun.proxy.$Proxy38.getSession(Unknown Source)
at com.haulmont.cuba.web.DefaultConnection.doLoginAnonymous(DefaultConnection.java:98)
at com.haulmont.cuba.web.DefaultConnection.loginAnonymous(DefaultConnection.java:64)
at com.haulmont.cuba.web.AppUI.setupUI(AppUI.java:258)
at com.haulmont.cuba.web.AppUI.init(AppUI.java:198)
at com.vaadin.ui.UI.doInit(UI.java:693)
at com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:216)
at com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:74)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1436)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:385)
at com.haulmont.cuba.web.sys.CubaApplicationServlet.serviceAppRequest(CubaApplicationServlet.java:301)
at com.haulmont.cuba.web.sys.CubaApplicationServlet.service(CubaApplicationServlet.java:192)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
at com.haulmont.cuba.web.sys.CubaHttpFilter.handleNotFiltered(CubaHttpFilter.java:108)
at com.haulmont.cuba.web.sys.CubaHttpFilter.doFilter(CubaHttpFilter.java:95)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:499)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:258)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:745)

Hi,
I wanted to say that only app.jar is generated when singleJar = true and probably that is why you see that app-core.jar is missed.

Regarding the exception. Try to re-generate the jetty-env.xml config. Ensure it has correct connection params. Also ensure that the database is running. Then rebuild the UberJar.

Which DBMS do you use? If HSQLDB - the project should be opened in Studio, or launch the startDb Gradle-task.