cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with Alfresco Web Services

fbertos
Champ in-the-making
Champ in-the-making
Hi,

I'm using Alfresco 1.3 community, Tomcat 1.5 and JDK 1.5, and I have a problem with Alfresco Web Services. I'm trying to create many folders from another web application, using alfreso web services, but after the 20th folder aprox. my system crashes and alfresco too. It's necessary reboot tomcat after that.

I'm getting the following error:

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.Object.getHibernateLazyInitializer()Lorg/hibernate/proxy/LazyInitializer;</ns1:message>
{http://xml.apache.org/axis/}exceptionNameSmiley Surprisedrg.alfresco.repo.webservice.repository.RepositoryFault
   {http://xml.apache.org/axis/}stackTrace:
   at org.alfresco.repo.webservice.repository.RepositoryWebService.update(RepositoryWebService.java:518)
   at sun.reflect.GeneratedMethodAccessor252.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
   at ….

The source code is:

         AuthenticationUtils.startSession("theuser", "thepassword");
         String path = "/app:company_home/cm:TEST";
         RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();

         for (int i=0; i<500; i++)
         {
            String name = "TEST_" + i;
             Store store = new Store(StoreEnum.workspace, "SpacesStore");
              Reference reference = new Reference(store, null, path);
            
              ParentReference parentReference = new ParentReference(
                      store,
                      reference.getUuid(),
                      reference.getPath(),
                      Constants.ASSOC_CONTAINS,
                      Constants.createQNameString(Constants.NAMESPACE_CONTENT_MODEL, name));              
              NamedValue[] properties = new NamedValue[]{new NamedValue(Constants.PROP_NAME, name)};
              CMLCreate create = new CMLCreate(name, parentReference, Constants.TYPE_FOLDER, properties);
              CML cml = new CML();
              cml.setCreate(new CMLCreate[]{create});
              repositoryService.update(cml);
         }
         
           AuthenticationUtils.endSession();

Can anybody help me, please?

Thanks.

fbertos.
2 REPLIES 2

rwetherall
Confirmed Champ
Confirmed Champ
Hi,

I have run the code you have posted as a unit test against 1.3 and was not able to reproduce the issue.

Are you able to run the unit tests and sample provided successfully?

Did the code fail at some point during execution or did it never even create the first folder?

Also, have you considered executing more than one CMLCreate statement at a time.  Batching them together means that they will all be created in a single transaction and you will only need to make one trip to the server, both saving you time.

Cheers,
Roy

fbertos
Champ in-the-making
Champ in-the-making
Thanks!!,

I've been able to solve the problem with the jvm option (-server) in Tomcat.

Thanks.

fbertos.