sm-shop-2.0.3 org.springframework.beans.factory.CannotLoadBeanClassException issue

413 views
Skip to first unread message

yjz...@gmail.com

unread,
Feb 15, 2016, 1:58:44 AM2/15/16
to Shopizer
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
apache-tomcat-8.0.26 & apache-tomcat-7.0.64
apache-maven-3.2.5
1.sm-shop-2.0.3 has been successfully compiled in maven.

[INFO] shopizer .......................................... SUCCESS [ 0.333 s]
[INFO] sm-core-model ..................................... SUCCESS [ 7.769 s]
[INFO] sm-core-modules ................................... SUCCESS [ 0.203 s]
[INFO] sm-core ........................................... SUCCESS [ 4.562 s]
[INFO] sm-shop ........................................... SUCCESS [ 19.413 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
2. When I started tomcat server, I got these error message:

15-Feb-2016 14:21:34.026 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'categoryDao': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.shopizer.modules.shipping.distance.ShippingDistancePreProcessorImpl] for bean with name 'shippingDistancePreProcessor' defined in class path resource [spring/processors/shopizer-core-shipping-processors.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: com/salesmanager/core/modules/integration/shipping/model/ShippingQuotePrePostProcessModule
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.shopizer.modules.shipping.distance.ShippingDistancePreProcessorImpl] for bean with name 'shippingDistancePreProcessor' defined in class path resource [spring/processors/shopizer-core-shipping-processors.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: com/salesmanager/core/modules/integration/shipping/model/ShippingQuotePrePostProcessModule
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:345)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1148)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:636)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:938)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4729)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:945)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1768)
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.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.shopizer.modules.shipping.distance.ShippingDistancePreProcessorImpl] for bean with name 'shippingDistancePreProcessor' defined in class path resource [spring/processors/shopizer-core-shipping-processors.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: com/salesmanager/core/modules/integration/shipping/model/ShippingQuotePrePostProcessModule
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1281)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:575)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1347)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:358)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:322)
at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:143)
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findDefaultEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:534)
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:504)
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.resolveEntityManager(PersistenceAnnotationBeanPostProcessor.java:667)
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.getResourceToInject(PersistenceAnnotationBeanPostProcessor.java:638)
at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:169)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:342)
... 26 more
Caused by: java.lang.NoClassDefFoundError: com/salesmanager/core/modules/integration/shipping/model/ShippingQuotePrePostProcessModule
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2495)
at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:859)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1301)
at
========================================================================

3、I reviewed these class files in WEB-INF/lib/sm-core-modules-2.0.3-SNAPSHOT.jar, they are there.

Please help!


umesha...@gmail.com

unread,
Feb 15, 2016, 4:25:22 PM2/15/16
to shop...@googlegroups.com
I am looking in to this. It came due to unresolved depedency.

Sent from my iPhone
> --
> You received this message because you are subscribed to the Google Groups "Shopizer" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to shopizer+u...@googlegroups.com.
> To post to this group, send email to shop...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/shopizer/b41c4a60-c2fc-41dd-81f7-c4a0eb8815d5%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

yjz...@gmail.com

unread,
Feb 16, 2016, 4:51:25 AM2/16/16
to Shopizer
hello,
I think the problem is in ‘com.shopizer.modules.shipping.distance.ShippingDistancePreProcessorImpl’,which is in shopizer-shipping-distance-processor-2.0.3.jar. In the class file,"com/salesmanager/core/modules/integration/shipping/model/ShippingQuotePrePostProcessModule '
'is referenced. But I just found ShippingQuotePreProcessModule.java file in sm-core-modules.

Thanks

David

unread,
Feb 16, 2016, 6:08:03 AM2/16/16
to Shopizer, yjz...@gmail.com
Hi,

yes, it's a bit confusing... ShippingQuotePreProcessModule.java is definitively new in 2.0.3

Also the naming:
com.salesmanager.core.modules.integration.shipping.model.ShippingQuotePreProcessModule
vs.
com.salesmanager.core.modules.integration.shipping.model.ShippingQuotePrePostProcessModule
could be a bit confusing :-)

it is not an dependency issue.

anyway, there is the following interface missing:

add this in sm-core-modules and the ex will disapear.

i think somebody missed a checkin?


Kind regards
davey

umesha...@gmail.com

unread,
Feb 16, 2016, 9:24:39 AM2/16/16
to shop...@googlegroups.com
That is correct, I will be checkin updated files by today 😀

Sent from my iPhone

balaji...@gmail.com

unread,
Apr 12, 2016, 12:43:34 PM4/12/16
to Shopizer
Same error i am getting now can you please tell me how to resolve this

carlo

unread,
Apr 12, 2016, 3:52:52 PM4/12/16
to Shopizer, balaji...@gmail.com

aske...@gmail.com

unread,
Nov 15, 2016, 1:57:54 PM11/15/16
to Shopizer, yjz...@gmail.com
The issue still persist,
The buid runs fine, but on deployment it is throwing the error.

Please help.

kara...@gmail.com

unread,
Dec 1, 2016, 2:32:05 PM12/1/16
to Shopizer, yjz...@gmail.com, aske...@gmail.com
Hi,

David reply solved this issue.

Try adding interface ShippingQuotePrePostProcessModule.java in here sm-core-modules\src\main\java\com\salesmanager\core\modules\integration\shipping\model , from http://www.atetric.com/atetric/javadoc/com.shopizer/sm-core-modules/2.0.3/src-html/com/salesmanager/core/modules/integration/shipping/model/ShippingQuotePrePostProcessModule.html#line.22, already mentioned by David above. this solved the same problem for me.

kara...@gmail.com

unread,
Dec 1, 2016, 2:33:03 PM12/1/16
to Shopizer, yjz...@gmail.com
Thanks it solved.

Carl Samson

unread,
Dec 1, 2016, 3:19:30 PM12/1/16
to shop...@googlegroups.com
I recommend that you use version 2.0.4


--
You received this message because you are subscribed to the Google Groups "Shopizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shopizer+unsubscribe@googlegroups.com.

To post to this group, send email to shop...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages