Cuba project not running as port 8080 is already occupied

Cuba project not running from IntelliJ as port 8080 is already occupied by EDB Postgres

image

Starting the server…
Server started at http://localhost:8080/app
Server terminated

catalina log

Using CATALINA_BASE: “C:\Users\u1129107\IdeaProjects\Insight\deploy\tomcat”
Using CATALINA_HOME: “C:\Users\u1129107\IdeaProjects\Insight\deploy\tomcat”
Using CATALINA_TMPDIR: “C:\Users\u1129107\IdeaProjects\Insight\deploy\tomcat\temp”
Using JRE_HOME: “C:\Users\u1129107\scoop\apps\corretto11-jdk\current”
Using CLASSPATH: “C:\Users\u1129107\IdeaProjects\Insight\deploy\tomcat\bin\bootstrap.jar;C:\Users\u1129107\IdeaProjects\Insight\deploy\tomcat\bin\tomcat-juli.jar”
Listening for transport dt_socket at address: 8787
Usage: java [options] [args…]
(to execute a class)
or java [options] -jar [args…]
(to execute a jar file)
or java [options] -m [/] [args…]
java [options] --module [/] [args…]
(to execute the main class in a module)
or java [options] [args]
(to execute a single source-file program)

Arguments following the main class, source file, -jar ,
-m or --module / are passed as the arguments to
main class.

where options include:

-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
--class-path <class search path of directories and zip/jar files>
              A ; separated list of directories, JAR archives,
              and ZIP archives to search for class files.
-p <module path>
--module-path <module path>...
              A ; separated list of directories, each directory
              is a directory of modules.
--upgrade-module-path <module path>...
              A ; separated list of directories, each directory
              is a directory of modules that replace upgradeable
              modules in the runtime image
--add-modules <module name>[,<module name>...]
              root modules to resolve in addition to the initial module.
              <module name> can also be ALL-DEFAULT, ALL-SYSTEM,
              ALL-MODULE-PATH.
--list-modules
              list observable modules and exit
-d <module name>
--describe-module <module name>
              describe a module and exit
--dry-run     create VM and load main class but do not execute main method.
              The --dry-run option may be useful for validating the
              command-line options such as the module system configuration.
--validate-modules
              validate all modules and exit
              The --validate-modules option may be useful for finding
              conflicts and other errors with modules on the module path.
-D<name>=<value>
              set a system property
-verbose:[class|module|gc|jni]
              enable verbose output
-version      print product version to the error stream and exit
--version     print product version to the output stream and exit
-showversion  print product version to the error stream and continue
--show-version
              print product version to the output stream and continue
--show-module-resolution
              show module resolution output during startup
-? -h -help
              print this help message to the error stream
--help        print this help message to the output stream
-X            print help on extra options to the error stream
--help-extra  print help on extra options to the output stream
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
              enable assertions with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
              disable assertions with specified granularity
-esa | -enablesystemassertions
              enable system assertions
-dsa | -disablesystemassertions
              disable system assertions
-agentlib:<libname>[=<options>]
              load native agent library <libname>, e.g. -agentlib:jdwp
              see also -agentlib:jdwp=help
-agentpath:<pathname>[=<options>]
              load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
              load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
              show splash screen with specified image
              HiDPI scaled images are automatically supported and used
              if available. The unscaled image filename, e.g. image.ext,
              should always be passed as the argument to the -splash option.
              The most appropriate scaled image provided will be picked up
              automatically.
              See the SplashScreen API documentation for more information
@argument files
              one or more argument files containing options
-disable-@files
              prevent further argument file expansion
--enable-preview
              allow classes to depend on preview features of this release

To specify an argument for a long option, you can use –= or
– .

Hello,

this is working as intended, indeed 2 applications can not use a single port simultaneously.

Also, this is the Jmix forum, you are more likely to get answers about CUBA here https://forum.cuba-platform.com/

Kind regards,
Mladen

Any idea where to change the cuba framework port ?

Hi,

first, make your tomcat work on another port, then restart everything, then check if its working by going to tomcat management application.

Then, go to your application.properties and change

 cuba.webAppUrl
cuba.restApiUrl

check if its working, if not should also change buildWar task in build.graddle

    appProperties = [
...
        'cuba.webPort': <port>,
        'cuba.connectionUrlList': 'http://localhost:<port>/app-core'
...
    ]

Kind regards,
Mladen

1 Like

thanks - somehow now I am able to run server on 8090 port but currently I am getting this exception error.
Is this some default table not able to create , I am using Postgres on triton instance to connect

com.haulmont.cuba.web.sys.remoting.LocalServiceAccessException: Unable to connect to middleware. Middleware block ‘app-core’ failed to start. See exception cause for details.
at com.haulmont.cuba.web.sys.remoting.LocalServiceProxy$LocalServiceInvocationHandler.createServiceAccessException(LocalServiceProxy.java:193)
at com.haulmont.cuba.web.sys.remoting.LocalServiceProxy$LocalServiceInvocationHandler.invoke(LocalServiceProxy.java:108)
at com.sun.proxy.$Proxy33.healthCheck(Unknown Source)
at com.haulmont.cuba.web.AppUI.init(AppUI.java:342)
at com.vaadin.ui.UI.doInit(UI.java:738)
at com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:209)
at com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:67)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1578)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:425)
at com.haulmont.cuba.web.sys.CubaApplicationServlet.serviceAppRequest(CubaApplicationServlet.java:329)
at com.haulmont.cuba.web.sys.CubaApplicationServlet.service(CubaApplicationServlet.java:215)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:108)
at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:74)
at com.haulmont.cuba.web.sys.CubaHttpFilter.doFilter(CubaHttpFilter.java:93)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.3.10-cuba): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: ERROR: relation “insight_exportable_table” does not exist
Position: 23
Error Code: 0
Call: SELECT COUNT(ID) FROM INSIGHT_EXPORTABLE_TABLE LIMIT ? OFFSET ?
bind => [1, 0]
Query: ReportQuery(referenceClass=ExportableTable sql=“SELECT COUNT(ID) FROM INSIGHT_EXPORTABLE_TABLE LIMIT ? OFFSET ?”)
at org.eclipse.persistence.internal.jpa.QueryImpl.getDetailedException(QueryImpl.java:391)
at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:264)
at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:482)
at com.haulmont.cuba.core.sys.QueryImpl.getResultFromCache(QueryImpl.java:768)
at com.haulmont.cuba.core.sys.QueryImpl.getFirstResult(QueryImpl.java:457)
at com.haulmont.cuba.core.TypedQuery$getFirstResult.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:119)
at com.rhinoj.insight.core.ExportableTableHelper.isExportableTablesEmpty(ExportableTableHelper.groovy:77)
at com.rhinoj.insight.core.ExportableTableHelper.primeExportableTables(ExportableTableHelper.groovy:41)
at com.rhinoj.insight.core.ExportableTableHelper$primeExportableTables.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:119)
at com.rhinoj.insight.core.AppLifecycle.applicationStarted(AppLifecycle.groovy:50)
at com.haulmont.cuba.core.sys.AppContext.startContext(AppContext.java:239)
at com.haulmont.cuba.core.sys.AppContext$Internals.startContext(AppContext.java:302)
at com.haulmont.cuba.core.sys.AbstractWebAppContextLoader.contextInitialized(AbstractWebAppContextLoader.java:94)
at com.haulmont.cuba.core.sys.AppContextLoader.contextInitialized(AppContextLoader.java:52)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4678)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5139)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:706)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1133)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1866)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1045)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:429)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1576)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:309)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:936)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.3.10-cuba): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: ERROR: relation “insight_exportable_table” does not exist
Position: 23
Error Code: 0
Call: SELECT COUNT(ID) FROM INSIGHT_EXPORTABLE_TABLE LIMIT ? OFFSET ?
bind => [1, 0]
Query: ReportQuery(referenceClass=ExportableTable sql=“SELECT COUNT(ID) FROM INSIGHT_EXPORTABLE_TABLE LIMIT ? OFFSET ?”)
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:342)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:722)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:564)
at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:2093)
at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:603)
at org.eclipse.persistence.sessions.server.ClientSession.executeCall(ClientSession.java:263)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:275)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.executeCall(ExpressionQueryMechanism.java:2940)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:261)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:332)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:728)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2828)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllReportQueryRows(ExpressionQueryMechanism.java:2765)
at org.eclipse.persistence.queries.ReportQuery.executeDatabaseQuery(ReportQuery.java:869)
at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:914)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1180)
at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:466)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1268)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:3020)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1892)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1874)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1839)
at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:262)
… 59 more
Caused by: org.postgresql.util.PSQLException: ERROR: relation “insight_exportable_table” does not exist
Position: 23
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2725)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2412)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:371)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:502)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:419)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:194)
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:137)
at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122)
at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122)
at com.haulmont.cuba.core.sys.jdbc.ProxyPreparedStatement.lambda$executeQuery$0(ProxyPreparedStatement.java:34)
at com.haulmont.cuba.core.sys.jdbc.ProxyStatement.executeSqlStatement(ProxyStatement.java:257)
at com.haulmont.cuba.core.sys.jdbc.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:34)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:1059)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:679)
… 80 more