AnsweredAssumed Answered

Uploading and Downloading file in Alfreso

Question asked by yuvaraj on Aug 27, 2009
Hi All,

    I am relatively new to this forum. I am trying to write a standalone client program to upload files in to Alfresco(v 3.2) for one of our application. I have tried out two different approaches:
  
    1. Using the Web Services API :
           A sample program that creates a simple document and uploads it in to the company_home space. The sample worked fine in this case. But now i have created a new site from the Alfresco Explorer Site(Which shows up under the company home space). Can somebody tell me how i can upload documents in the documents library space of my test site ?(more like the name spaces i have to use)

    2. Using the RAAr API : I was unable to execute the application as it throws the below exception :

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cmaMappingService' defined in URL [jar:file:/C:/sample/workspaces/sample/manager/RivetAPI/lib/cma-impl-1.11.0.jar!/core/cma-core-context.xml]: Invocation of init method failed; nested exception is com.rivetlogic.core.cma.exception.CmaRuntimeException: org.exolab.castor.mapping.MappingException: Nested error: org.xml.sax.SAXException: unable to find FieldDescriptor for 'class' in ClassDescriptor of bind-xml
Caused by: com.rivetlogic.core.cma.exception.CmaRuntimeException: org.exolab.castor.mapping.MappingException: Nested error: org.xml.sax.SAXException: unable to find FieldDescriptor for 'class' in ClassDescriptor of bind-xml
   at com.rivetlogic.core.cma.mapping.impl.CmaCastorUnmarshaller.unmarshal(CmaCastorUnmarshaller.java:57)
   at com.rivetlogic.core.cma.mapping.impl.CmaMappingServiceImpl.init(CmaMappingServiceImpl.java:113)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1160)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1122)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1085)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:429)
   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.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:68)
   at main.java.mainClass.main(mainClass.java:95)
Caused by: org.exolab.castor.mapping.MappingException: Nested error: org.xml.sax.SAXException: unable to find FieldDescriptor for 'class' in ClassDescriptor of bind-xml
   at org.exolab.castor.mapping.Mapping.loadMappingInternal(Mapping.java:497)
   at org.exolab.castor.mapping.Mapping.loadMapping(Mapping.java:402)
   at com.rivetlogic.core.cma.mapping.impl.CmaCastorUnmarshaller.unmarshal(CmaCastorUnmarshaller.java:53)
   … 19 more.

Do i have to install the AMP file in Alfresco to make this work?

Thanks in advance,

Yuvaraj.T

Outcomes