cancel
Showing results for 
Search instead for 
Did you mean: 

Problem running alfresco FirstFoundationClient.java

alestudent
Champ in-the-making
Champ in-the-making
Hi,
i'm a new alfresco user.
When i tried to run SDK FirstFoundationClient project i found this error:

Exception in thread "main" org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.alfresco.module.blogIntegration.BlogIntegrationServiceImpl] for bean with name 'blogIntegrationService' defined in class path resource [alfresco/blog-context.xml]; nested exception is java.lang.ClassNotFoundException: org.alfresco.module.blogIntegration.BlogIntegrationServiceImpl
Caused by: java.lang.ClassNotFoundException: org.alfresco.module.blogIntegration.BlogIntegrationServiceImpl
   at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
   at org.springframework.util.ClassUtils.forName(ClassUtils.java:183)
   at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:317)
   at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1044)
   at org.springframework.beans.factory.support.AbstractBeanFactory.isBeanClassMatch(AbstractBeanFactory.java:1072)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:165)
   at org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:691)
   at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:395)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:328)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
   at org.alfresco.util.ApplicationContextHelper.getApplicationContext(ApplicationContextHelper.java:55)
   at org.alfresco.sample.FirstFoundationClient.main(FirstFoundationClient.java:69)

CAN SOMEONE HELP ME PLEASE?
7 REPLIES 7

davidc
Star Contributor
Star Contributor
This is a transient issue on the 2.9 branch.

To workaround, remove the "blog-context.xml" include from application-context.xml.

alestudent
Champ in-the-making
Champ in-the-making
Thanks for your answer.

I have another question: the file application-context.xml is that in C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco (I have located alfresco root in C:\)?

The file appears in this way:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<!– references to XML configurations –>
<beans >

    <import resource="classpath:alfresco/cache-context.xml" />
    <import resource="classpath:alfresco/core-services-context.xml" />
    <import resource="classpath:alfresco/public-services-context.xml" />
    <import resource="classpath:alfresco/model-specific-services-context.xml" />
    <import resource="classpath:alfresco/action-services-context.xml" />
    <import resource="classpath:alfresco/rule-services-context.xml" />
    <import resource="classpath:alfresco/node-services-context.xml" />
    <import resource="classpath:alfresco/scheduled-jobs-context.xml" />
    <import resource="classpath:alfresco/network-protocol-context.xml" />
    <import resource="classpath:alfresco/content-services-context.xml" />
    <import resource="classpath:alfresco/hibernate-context.xml" />
    <import resource="classpath:alfresco/ownable-services-context.xml" />
    <import resource="classpath:alfresco/template-services-context.xml" />
    <import resource="classpath:alfresco/script-services-context.xml" />
    <import resource="classpath:alfresco/index-recovery-context.xml" />
    <import resource="classpath:alfresco/authority-services-context.xml" />
    <import resource="classpath:alfresco/authentication-services-context.xml" />
    <import resource="classpath:alfresco/policy-context.xml" />
    <import resource="classpath:alfresco/import-export-context.xml" />
    <import resource="classpath:alfresco/bootstrap-context.xml" />
    <import resource="classpath:alfresco/workflow-context.xml" />
    <import resource="classpath:alfresco/jcr-api-context.xml" />
    <import resource="classpath:alfresco/avm-services-context.xml" />
    <import resource="classpath:alfresco/audit-services-context.xml" />
    <import resource="classpath:alfresco/attributes-service-context.xml"/>
    <import resource="classpath:alfresco/linkvalidation-service-context.xml"/>
    <import resource="classpath:alfresco/remote-services-context.xml"/>
    <import resource="classpath*:alfresco/patch/*-context.xml" />
    <import resource="classpath*:alfresco/domain/*-context.xml" />

    <!–
         Import all modules and related components.
         Extensions are explicitly imported after this so that the default
         mechanism can still be used to override module-specific beans.
    –>
    <import resource="classpath*:alfresco/module-context.xml" />

    <!–
         Import of general extensions and bean overrides.

         To give developers final control over the tuning
         of their own local build, the dev-context.xml file
         is processed last  (note: dev-context.xml isn't
         part of the source tree itself). 
        
         For details, see:
         http://wiki.alfresco.com/wiki/Developer_Runtime_Configuration
    –>
    <import resource="classpath*:alfresco/extension/*-context.xml"/>
    <import resource="classpath*:alfresco/extension/dev-context.xml" />
   
</beans>
————————————————————————————-
If yes which line i have to delete?
THANK YOU IN ADVANCE

alestudent
Champ in-the-making
Champ in-the-making
Maybe i resolved the problem extracting config.jar from sdkalfrescoEmbedded project and deleting the "import blog-context .xml" line.
But i found another error, so i created a new topic about email server error running SDKFirstFoundationClient project.
If someone can help me, i thank you in advance.

vibhutewary
Champ in-the-making
Champ in-the-making
Hi, I'm getting this error on running FirstFoundationClient.java from eclipse:


Exception in thread "main" org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.alfres
co.module.blogIntegration.BlogIntegrationServiceImpl] for bean with name 'blogIntegrationService' defined in class path
resource [alfresco/blog-context.xml]; nested exception is java.lang.ClassNotFoundException: org.alfresco.module.blogInte
gration.BlogIntegrationServiceImpl
Caused by: java.lang.ClassNotFoundException: org.alfresco.module.blogIntegration.BlogIntegrationServiceImpl
   at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
   at org.springframework.util.ClassUtils.forName(ClassUtils.java:183)
   at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:317)
   at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1044)
   at org.springframework.beans.factory.support.AbstractBeanFactory.isBeanClassMatch(AbstractBeanFactory.java:1072)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.
java:165)
   at org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:6
91)
   at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationCo
ntext.java:395)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:328)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
   at org.alfresco.util.ApplicationContextHelper.getApplicationContext(ApplicationContextHelper.java:55)
   at org.alfresco.sample.FirstFoundationClient.main(FirstFoundationClient.java:69)


what could the cause be?
Thanks for the help.
Vibhu.

dinger
Champ in-the-making
Champ in-the-making
Did you do what was suggested above?

Rob

vibhutewary
Champ in-the-making
Champ in-the-making
Removing the "blog-context.xml" include from application-context.xml did'nt work for me; upon deleting it gave be a /alfersco server not found page in tomcat.

I resolved the error by extracting the contents of : /opt/sdk_alfresco/lib/server/dependencies/alfresco-blog-integration.jar
files'  /org/alfresco/module folder contents to: /opt/sdk_alfresco/samples/FirstFoundationClient/build/org/alfresco/module

This has solved the orignal issue; However, i'm getting a new issue now:

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'email
Server' defined in class path resource [alfresco/bootstrap-context.xml]: Instantiation of bean failed; nested exception
is java.lang.NoClassDefFoundError: org/subethamail/smtp/MessageHandlerFactory
Caused by: java.lang.NoClassDefFoundError: org/subethamail/smtp/MessageHandlerFactory
   at java.lang.Class.getDeclaredConstructors0(Native Method)
   at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
   at java.lang.Class.getConstructor0(Class.java:2699)
   at java.lang.Class.getDeclaredConstructor(Class.java:1985)
   at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:60)
   at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:4
5)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapable
BeanFactory.java:701)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapa
bleBeanFactory.java:687)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanF
actory.java:388)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.jav
a:141)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:
236)
   at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:701)
   at org.springframework.context.support.AbstractApplicationContext.registerListeners(AbstractApplicationContext.java:519
)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:343)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
   at org.alfresco.util.ApplicationContextHelper.getApplicationContext(ApplicationContextHelper.java:55)
   at org.alfresco.sample.FirstFoundationClient.main(FirstFoundationClient.java:69)
Caused by: java.lang.ClassNotFoundException: org.subethamail.smtp.MessageHandlerFactory
   at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
   … 21 more

Regards,
Vibhu.

vibhutewary
Champ in-the-making
Champ in-the-making
Fixed the above error by copying /opt/sdk/lib/server/dependencies/ subetha-smtp.jar file's contents as : /opt/sdk/samples/FirstFoundationClient/build/org/subethamail

Getting this error now :

12:34:09,436 User:System WARN  [remoting.rmi.RmiRegistryFactoryBean] Could not detect RMI registry - creating new one
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'wordPressBlogIntegration' defined in class path resource [alfresco/blog-context.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: marquee/xmlrpc/XmlRpcException
Caused by: java.lang.NoClassDefFoundError: marquee/xmlrpc/XmlRpcException
   at java.lang.Class.getDeclaredConstructors0(Native Method)
   at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
   at java.lang.Class.getConstructor0(Class.java:2699)
   at java.lang.Class.getDeclaredConstructor(Class.java:1985)
   at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:60)
   at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:45)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:701)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:687)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:388)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:273)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
   at org.alfresco.util.ApplicationContextHelper.getApplicationContext(ApplicationContextHelper.java:55)
   at org.alfresco.sample.FirstFoundationClient.main(FirstFoundationClient.java:69)
Caused by: java.lang.ClassNotFoundException: marquee.xmlrpc.XmlRpcException
   at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
   … 19 more

Any solutions?
Regards,
Vibhu.