Page 1 of 2

demo site tomcat persitent unit error

Posted: Sun Mar 30, 2014 6:22 pm
by prabhat.kataria
Hi,

I am trying to get my hands dirty on broadleaf, was trying to run broadleaf demosite on tomcat. For this purpose i addes db related props in catalina.properties, but i am facing below errors.

Code: Select all

[ WARN] 03:30:43 RuntimeEnvironmentPropertiesConfigurer - Unable to determine runtime environment, using default environment 'development'
[ WARN] 03:30:47 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] 03:30:50 AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [org.hibernate.cache.spi.UpdateTimestampsCache]; using defaults.
[ WARN] 03:30:51 AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [blSandBoxElements]; using defaults.
[ERROR] 03:30:52 ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in resource loaded from byte array: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: blPU] Unable to build EntityManagerFactory
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1488)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
   at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1117)
   at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:922)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
   at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
   at org.broadleafcommerce.common.web.extensibility.MergeContextLoaderListener.contextInitialized(MergeContextLoaderListener.java:50)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
   at org.apache.catalina.core.StandardService.start(StandardService.java:525)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)


Don't know from where to start fixing this problem.

Re: demo site tomcat error

Posted: Mon Mar 31, 2014 11:22 am
by phillipuniverse
Were there any earlier errors from Tomcat attempting to create the JNDI resources?

Re: demo site tomcat error

Posted: Mon Mar 31, 2014 12:37 pm
by prabhat.kataria
yes there were error related to ${database.driver} not found... so i created database related properties in catalina.properties inside tomcat server location.

Re: demo site tomcat error

Posted: Thu Apr 03, 2014 2:47 pm
by prabhat.kataria
still came across no way to remove this issue......

Re: demo site tomcat error

Posted: Thu Apr 03, 2014 3:44 pm
by starlight95
You can add them as VM arguments.

-Ddatabase.driver="your.driver.com" -Ddatabase.url="jdbc:mysql://url" -Ddatabase.user="youruser" -Ddatabase.password="yourpwd"

Add them in your eclipse launcher (tomcat or maven)

Re: demo site tomcat persitent unit error

Posted: Thu Apr 03, 2014 11:39 pm
by prabhat.kataria
Hi starlight95, i have tried your suggestion also, but to my understanding its not a problem with database credentials as i am getting error for persistent unit(as visible in error log) and context initialization failure. Can you help with this?

Re: demo site tomcat persitent unit error

Posted: Tue Apr 08, 2014 10:24 am
by phillipuniverse
Was there anything else in the log? If you are using MySQL, it might be that you do not have the mysql jar in the Tomcat lib folder.

Re: demo site tomcat persitent unit error

Posted: Tue Apr 08, 2014 1:48 pm
by prabhat.kataria
hi phillipuniverse, the log i posted was all that i could see with default log level of demo site but on changing log level of org.broadleaf to info i could see that EhCache CacheManager shuts down immediately after ehcache configuration (named org.hibernate.cache.spi.UpdateTimestampsCache and blSandBoxElements) are not found.

Also, i have tried to run the site by keeping mysql.jar in tomcat/lib but it also did not work.

is this problem related to load time weaving?

Re: demo site tomcat persitent unit error

Posted: Wed Apr 09, 2014 11:52 am
by prabhat.kataria
complete log with debug option enabled can be seen at https://onedrive.live.com/redir?resid=E ... ile%2c.out

Re: demo site tomcat persitent unit error

Posted: Fri Apr 11, 2014 12:07 am
by prabhat.kataria
somehow tomcat problem is solved but i am getting another problem of " StaticAssetViewController - Unable to retrieve static asset" log can be seen at https://onedrive.live.com/redir?resid=E ... ile%2c.out

Also, is there any place where i can get documentation of blc thymeleaf tags like blc:bundle, blc:categories, etc ?