CMDBuild Forum

Alfresco Attachment Upload not working properly

Hello,

I hope someone can help me in getting the Alfresco Attachment upload to work. Here is what I did so far:

- Installed Alfresco on the same machine with different ports as a standalone installation (not integrated into the tomcat and postresql database that CMDBuild uses)

- Created a space in Alfresco for CMDBuild with the name cmdbuild

- Created the category AlfrescoCategory for CMDBuild in Alfresco

- Configured CMDBuild for access to Alfresco with the webservice URL, file server path, web service path and so on

- Tested FTP access to Alfresco from the local machine, working properly, I can upload files.

Now here is what happens when I try to upload an attachment via the CMDBuild webinterface: the path in Alfresco gets created properly, it is visible in the Alfresco webinterface. There is no file however and CMDBuild shows an Upload error.

I increased the log level for the dms component in the log4j.properties file and here is the error I get:

INFO  2014-10-07 16:13:06 [jsonrpc ] Calling url /attachments/uploadattachment
INFO  2014-10-07 16:13:06 [dms     ] storing document
INFO  2014-10-07 16:13:06 [dms     ] creating ftp client
INFO  2014-10-07 16:13:06 [dms     ] connecting to 'localhost:21'
INFO  2014-10-07 16:13:06 [dms     ] logging in with username 'admin'
DEBUG 2014-10-07 16:13:06 [dms     ] ... and password 'XXXXXX'
INFO  2014-10-07 16:13:06 [dms     ] changing directory to '/Alfresco/User Homes/cmdbuild'
INFO  2014-10-07 16:13:06 [dms     ] changing directory to '[Asset, Frame, Id1377]'
INFO  2014-10-07 16:13:06 [dms     ] changing directory to 'Asset'
INFO  2014-10-07 16:13:06 [dms     ] changing directory to 'Frame'
INFO  2014-10-07 16:13:06 [dms     ] changing directory to 'Id1377'
INFO  2014-10-07 16:13:06 [dms     ] logging out
INFO  2014-10-07 16:13:06 [dms     ] disconnecting
INFO  2014-10-07 16:13:07 [dms     ] creating ws client
INFO  2014-10-07 16:13:07 [dms     ] starting ws session
DEBUG 2014-10-07 16:13:07 [dms     ] session successfully started
DEBUG 2014-10-07 16:13:07 [dms     ] executing command 'class org.cmdbuild.dms.alfresco.webservice.GetCategoryCommand'
INFO  2014-10-07 16:13:07 [dms     ] ending ws session
INFO  2014-10-07 16:13:07 [dms     ] creating ws client
INFO  2014-10-07 16:13:07 [dms     ] starting ws session
DEBUG 2014-10-07 16:13:07 [dms     ] session successfully started
DEBUG 2014-10-07 16:13:07 [dms     ] executing command 'class org.cmdbuild.dms.alfresco.webservice.SingleSearchCommand'
ERROR 2014-10-07 16:13:07 [dms     ] error while search for file
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
 faultSubcode:
 faultString:
 faultActor:
 faultNode:
 faultDetail:
    {http://www.alfresco.org/ws/service/repository/1.0}RepositoryFault:<ns1:errorCode>0</ns1:errorCode><ns1:message>java.lang.IllegalStateException: Failed to resolve to a single NodeRef with parameters (store=workspace:SpacesStore uuid=null path=/app:company_homes/app:user_homes/cm:cmdbuild/cm:Asset/cm:Frame/cm:Id1377), found 0 nodes.</ns1:message>
    {http://xml.apache.org/axis/}exceptionName:org.alfresco.repo.webservice.repository.RepositoryFault
    {http://xml.apache.org/axis/}stackTrace:
    at org.alfresco.repo.webservice.repository.RepositoryWebService.get(RepositoryWebService.java:476)
    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.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
[.......]

INFO  2014-10-07 16:13:07 [dms     ] ending ws session
ERROR 2014-10-07 16:13:07 [dms     ] error updating metadata for file 'PIC.jpg' at path '[Asset, Frame, Id1377]'
java.util.IllegalFormatConversionException: d != java.lang.String
    at java.util.Formatter$FormatSpecifier.failConversion(Formatter.java:4045)
    at java.util.Formatter$FormatSpecifier.printInteger(Formatter.java:2748)
    at java.util.Formatter$FormatSpecifier.print(Formatter.java:2702)
    at java.util.Formatter.format(Formatter.java:2488)
    at java.util.Formatter.format(Formatter.java:2423)
    at java.lang.String.format(String.java:2797)
    at org.cmdbuild.dms.exception.DmsError.fileNotFound(DmsError.java:18)
    at org.cmdbuild.dms.alfresco.webservice.AlfrescoWebserviceClient.search(AlfrescoWebserviceClient.java:85)
    at org.cmdbuild.dms.alfresco.webservice.AlfrescoWsService.getUuid(AlfrescoWsService.java:386)
    at org.cmdbuild.dms.alfresco.webservice.AlfrescoWsService.updateCategory(AlfrescoWsService.java:380)
    at org.cmdbuild.dms.alfresco.AlfrescoDmsService.upload(AlfrescoDmsService.java:92)
    at org.cmdbuild.dms.ForwardingDmsService.upload(ForwardingDmsService.java:40)
[.......]

INFO  2014-10-07 16:13:07 [dms     ] creating ftp client
INFO  2014-10-07 16:13:07 [dms     ] connecting to 'localhost:21'
INFO  2014-10-07 16:13:07 [dms     ] logging in with username 'admin'
DEBUG 2014-10-07 16:13:07 [dms     ] ... and password 'XXXXXX'
INFO  2014-10-07 16:13:07 [dms     ] changing directory to '/Alfresco/User Homes/cmdbuild'
INFO  2014-10-07 16:13:07 [dms     ] changing directory to '[Asset, Frame, Id1377]'
INFO  2014-10-07 16:13:07 [dms     ] changing directory to 'Asset'
INFO  2014-10-07 16:13:07 [dms     ] changing directory to 'Frame'
INFO  2014-10-07 16:13:07 [dms     ] changing directory to 'Id1377'
INFO  2014-10-07 16:13:07 [dms     ] deleting file 'PIC.jpg'
INFO  2014-10-07 16:13:07 [dms     ] logging out
INFO  2014-10-07 16:13:07 [dms     ] disconnecting
ERROR 2014-10-07 16:13:07 [cmdbuild] error uploading file 'PIC.jpg' to card 'Frame' with id '1377'
org.cmdbuild.dms.exception.DmsError: java.util.IllegalFormatConversionException: d != java.lang.String
    at org.cmdbuild.dms.exception.DmsError.forward(DmsError.java:51)
    at org.cmdbuild.dms.alfresco.AlfrescoDmsService.upload(AlfrescoDmsService.java:99)
    at org.cmdbuild.dms.ForwardingDmsService.upload(ForwardingDmsService.java:40)
    at org.cmdbuild.dms.LoggedDmsService.upload(LoggedDmsService.java:44)
    at org.cmdbuild.dms.ForwardingDmsService.upload(ForwardingDmsService.java:40)
    at org.cmdbuild.logic.dms.DefaultDmsLogic.upload(DefaultDmsLogic.java:164)
    at org.cmdbuild.logic.dms.ForwardingDmsLogic.upload(ForwardingDmsLogic.java:54)
[.......]

ERROR 2014-10-07 16:13:07 [jsonrpc ] A org.cmdbuild.exception.DmsException occurred calling method class org.cmdbuild.servlets.json.Attachments.uploadAttachment: DMS_ATTACHMENT_UPLOAD_ERROR

 

I'm honestly at a loss what could be wrong. The configuration itself seems to be ok since CMDBuild can access Alfresco and create the path in the space. But as soon as the file gets involved it breaks up like described. Does anyone have a hint or idea what might be the problem here?

Many thanks in advance,

Andreas

You did not write which version of CMDBuild, and especially which version of Alfresco (is the one specified in our documentation?) you are using

.

CMDBuild Team

Yes, sorry..

My CMDBuild version is 2.2.1 and the Alfresco version is 3.4.e. I tried at first with a 5.0 version of Alfresco but then downgraded to 3.4.

 

I hope that helps, let me know if there are more information needed.

 

Best regards Andreas

 

Previously Tecnoteca wrote:
You did not write which version of CMDBuild, and especially which version of Alfresco (is the one specified in our documentation?) you are using

.

CMDBuild Team

 

Hi,
 
in CMDBuild configuration, from Admin Panel, in Alfresco section: check carefully your path for files in file server (1st text box, on 3rd frame in ALFRESCO CONFIGURATION)
 
I've been 2 days trying to fix that in my installation, and it was an incorrect path.
 
Access to FTP with a FTP client and check the correct path to the home personal user.
 
In my case it was:
 
/Alfresco/Espacios personales de usuario/cmdbuild   (spanish installation)
 
 
Check too, the CMDBUILD CATEGORY (usually AlfrescoCategory) and create the same CATEGORIES in ALFRESCO 'AlfrescoCategory' CATEGORY
 
in CMDBuild i have 'DOCUMENT' and 'IMAGE' categories.
in Alfresco, AlfrescoCategoryes I have it too.
 
 
 
 
 
Previously Andreas wrote:

Yes, sorry..

My CMDBuild version is 2.2.1 and the Alfresco version is 3.4.e. I tried at first with a 5.0 version of Alfresco but then downgraded to 3.4.

 

I hope that helps, let me know if there are more information needed.

 

Best regards Andreas

 

Previously Tecnoteca wrote:
You did not write which version of CMDBuild, and especially which version of Alfresco (is the one specified in our documentation?) you are using

.

CMDBuild Team