AnsweredAssumed Answered

CIFs Error Alfresco SDK

Question asked by alex888 on Nov 8, 2008
Hi all,

I'm trying to run in Java the examples included in SDK, to do that, I follow this wiki article to configure my Eclipse:

http://wiki.alfresco.com/wiki/Alfresco_SDK

at the beginning all was going fine, as I didn't have any compilation or dependency errors, but at the time of running the FirstFoundationClient example, I got this exception:

19:51:39,500 INFO [config.xml.XMLConfigService$PropertyConfigurer] Loading properties file from class path resource [alfresco/file-servers.properties]
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cifsServer' defined in class path resource [alfresco/bootstrap-context.xml]: Cannot resolve reference to bean 'fileServerConfiguration' while setting constructor argument; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.alfresco.filesys.ServerConfigurationBean] for bean with name 'fileServerConfiguration' defined in class path resource [alfresco/bootstrap-context.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/alfresco/jlan/server/config/ServerConfiguration
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.alfresco.filesys.ServerConfigurationBean] for bean with name 'fileServerConfiguration' defined in class path resource [alfresco/bootstrap-context.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/alfresco/jlan/server/config/ServerConfiguration
Caused by: java.lang.NoClassDefFoundError: org/alfresco/jlan/server/config/ServerConfiguration
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
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:201)
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:327)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1075)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:346)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:261)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:109)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:389)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:120)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:799)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:717)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:384)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:247)
at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:796)
at org.springframework.context.support.AbstractApplicationContext.registerListeners(AbstractApplicationContext.java:592)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:349)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:91)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:75)
at org.alfresco.util.ApplicationContextHelper.getApplicationContext(ApplicationContextHelper.java:55)
at org.alfresco.sample.FirstFoundationClient.main(FirstFoundationClient.java:69)

it's obvious that Eclipse can't find the org.alfresco.filesys.ServerConfigurationBean class, which is included insde the repository-src.zip file (you have to include a reference to it in the SdK AlfrescoEmbedded project. I suppose that it's a classpath question but I'm not able to find a solution.

¿Does anyone know what could be happening?

Regards and thanks in advance.
Alex.

Outcomes