Troubles when deploying on tomcat without maven

Topics related to running, modifying, or working with the Broadleaf Commerce Demo application

Moderator: jocanas

zenbeni
Newbie
Newbie
Posts: 1
Joined: Thu Jun 30, 2016 2:51 am

Troubles when deploying on tomcat without maven

Postby zenbeni » Thu Jun 30, 2016 3:30 am

Can we find a guide on how to deploy the demo on a vanilla tomcat server without relying on maven plugin?

I tried to deploy manually the wars on a tomcat 7.0.70 server, java 8 runtime, I get warnings on launch (I have followed the instructions to use PostgreSQL as a datasource from your documentation)

[ WARN] 19:08:38 RuntimeEnvironmentPropertiesConfigurer - Unable to determine runtime environment, using default environment 'development'
[ WARN] 19:08:40 MergePersistenceUnitManager - A BroadleafClassTransformer is configured for this persistence unit, but Spring reported a problem (likely that a LoadTimeWeaver is not registered). As a result, the Broadleaf Commerce ClassTransformer (org.broadleafcommerce.common.extensibility.jpa.copy.DirectCopyClassTransformer) is not being registered with the persistence unit.
[ WARN] 19:08:40 MergePersistenceUnitManager - A BroadleafClassTransformer is configured for this persistence unit, but Spring reported a problem (likely that a LoadTimeWeaver is not registered). As a result, the Broadleaf Commerce ClassTransformer (org.broadleafcommerce.common.extensibility.jpa.convert.EntityMarkerClassTransformer) is not being registered with the persistence unit.
[ WARN] 19:08:40 MergePersistenceUnitManager - A BroadleafClassTransformer is configured for this persistence unit, but Spring reported a problem (likely that a LoadTimeWeaver is not registered). As a result, the Broadleaf Commerce ClassTransformer (org.broadleafcommerce.common.extensibility.jpa.copy.ConditionalFieldAnnotationsClassTransformer) is not being registered with the persistence unit.
[ WARN] 19:08:40 MergePersistenceUnitManager - A BroadleafClassTransformer is configured for this persistence unit, but Spring reported a problem (likely that a LoadTimeWeaver is not registered). As a result, the Broadleaf Commerce ClassTransformer (org.broadleafcommerce.common.extensibility.jpa.copy.DirectCopyClassTransformer) is not being registered with the persistence unit.
[ WARN] 19:08:43 AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [blSandBoxElements]; using defaults.

I also get SQL errors as hbm2ddl does not seem to work (I have modified the properties to "create" mode but that does not seem to work, as the error seems to show that the schema was not imported):

[ERROR] 19:08:48 SchemaExport - HHH000231: Schema export unsuccessful
org.hibernate.tool.hbm2ddl.ImportScriptException: Error during statement execution (file: '/config/bc/sql/load_admin_roles.sql'): INSERT INTO BLC_ADMIN_ROLE (ADMIN_ROLE_ID, DESCRIPTION, NAME, DATE_UPDATED) VALUES (-1,E'Admin Master Access',E'ROLE_ADMIN', CURRENT_TIMESTAMP)
at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:451)
at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:378)
at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:304)
at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:293)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:498)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1742)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:94)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890)
at org.springframework.orm.jpa.vendor.SpringHibernateEjbPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateEjbPersistenceProvider.java:51)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:343)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1631)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1568)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:963)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:752)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:434)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.broadleafcommerce.common.web.extensibility.MergeContextLoader.contextInitialized(MergeContextLoader.java:146)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5099)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5615)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1092)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1984)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.postgresql.util.PSQLException: ERROR: column "date_updated" of relation "blc_admin_role" does not exist
Position: 63
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2284)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2003)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:200)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:424)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:321)
at org.postgresql.jdbc.PgStatement.executeUpdate(PgStatement.java:297)
at org.hibernate.tool.hbm2ddl.DatabaseExporter.export(DatabaseExporter.java:64)
at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:446)
... 39 more

I have modified the context.xml of the tomcat to add ResourceLink:

<ResourceLink name="jdbc/storage"
global="jdbc/storage"
type="javax.sql.DataSource"/>

And modified web.xml to enable these resources in the webapps:

<resource-ref>
<description>broadleaf event data</description>
<res-ref-name>jdbc/event</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

I don't know what I'm missing so far, so maybe you can give me some hints to debug the launch? Thanks.

SantoDE
Newbie
Newbie
Posts: 11
Joined: Wed Jul 13, 2016 3:04 pm

Re: Troubles when deploying on tomcat without maven

Postby SantoDE » Thu Jul 14, 2016 12:15 pm

You still need help or did you solve it?

GobiRan
Newbie
Newbie
Posts: 2
Joined: Tue Aug 09, 2016 12:19 pm

Re: Troubles when deploying on tomcat without maven

Postby GobiRan » Wed Aug 10, 2016 8:18 am

I have the same problem. The column "DATE_UPDATED" is not created, so I get the following error:

Code: Select all

[ERROR] 15:16:36 SchemaExport - HHH000231: Schema export unsuccessful
org.hibernate.tool.hbm2ddl.ImportScriptException: Error during statement execution (file: '/config/bc/sql/load_admin_roles.sql'): INSERT INTO BLC_ADMIN_ROLE (ADMIN_ROLE_ID, DESCRIPTION, NAME, DATE_UPDATED) VALUES (-1,'Admin Master Access','ROLE_ADMIN', CURRENT_TIMESTAMP)
   at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:451)
   at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:378)
   at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:304)
   at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:293)
   at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:498)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1742)
   at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:94)
   at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905)
   at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890)
   at org.springframework.orm.jpa.vendor.SpringHibernateEjbPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateEjbPersistenceProvider.java:51)
   at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:343)
   at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1631)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1568)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
   at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:963)
   at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:752)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
   at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:434)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
   at org.broadleafcommerce.common.web.extensibility.MergeContextLoader.contextInitialized(MergeContextLoader.java:146)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4992)
   at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5490)
   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
   at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
   at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
   at java.lang.Thread.run(Thread.java:745)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'DATE_UPDATED' in 'field list'
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
   at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
   at com.mysql.jdbc.Util.getInstance(Util.java:387)
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:942)
   at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3966)
   at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3902)
   at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2526)
   at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2673)
   at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
   at com.mysql.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1540)
   at com.mysql.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2595)
   at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1468)
   at org.hibernate.tool.hbm2ddl.DatabaseExporter.export(DatabaseExporter.java:64)
   at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:446)
   ... 35 more

rcole
Newbie
Newbie
Posts: 1
Joined: Wed Aug 10, 2016 4:06 pm

Re: Troubles when deploying on tomcat without maven

Postby rcole » Wed Aug 10, 2016 4:25 pm

Looks like you are missing the following VM args

Code: Select all

-javaagent:/path/to/spring-instrument-4.1.6.RELEASE.jar


Return to “Broadleaf Commerce Demo”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest