cancel
Showing results for 
Search instead for 
Did you mean: 

Path service not working

vladislavlysov
Champ in-the-making
Champ in-the-making
Hello!!!
   I have a problem with Alfresco.
    1)   I have 3 classes whose extends from AbstractPatch.
    2) This classes is declared in spring context(i'm use Community edition!!!):

    <bean id="patch.testClassPath" class="com.agilent.openlab.eln.TestPatchClass"
          parent="basePatch">
        <property name="id" value="patch.testClassPath0"/>
        <property name="description" value="Test string"/>
        <property name="fixesFromSchema" value="0"/>
        <property name="fixesToSchema" value="5020" />
        <property name="targetSchema" value="5020"/>
    </bean>

    <!– Test beans for Alfresco patch service –>
    <bean id="patch.testPath1" class="com.agilent.openlab.eln.TestPatch1"
          parent="basePatch">
        <property name="id" value="patch.testClassPath1"/>
        <property name="description" value="Test string"/>
        <property name="fixesFromSchema" value="5020"/>
        <property name="fixesToSchema" value="5021" />
        <property name="targetSchema" value="5022"/>
    </bean>
    <bean id="patch.testPath2" class="com.agilent.openlab.eln.TestPatch2"
          parent="basePatch">
        <property name="id" value="patch.testClassPath2"/>
        <property name="description" value="Test string"/>
        <property name="fixesFromSchema" value="5020"/>
        <property name="fixesToSchema" value="5021" />
        <property name="targetSchema" value="5022"/>
    </bean>
    <bean id="patch.testPath3" class="com.agilent.openlab.eln.TestPatch3"
          parent="basePatch">
        <property name="id" value="patch.testClassPath3"/>
        <property name="description" value="Test string"/>
        <property name="fixesFromSchema" value="5022"/>
        <property name="fixesToSchema" value="5023" />
        <property name="targetSchema" value="5024"/>
    </bean>
My schema version is 5019. But i have exception -
Access Denied. But if I'm set <fixesToSchema> to ${version.schema} all is ok! But if i set to number - it's fail!!! The system is currently in read-only mode
. But if i remove this declared from context - all is ok! Also, if i install new Alfresco, then declare ONE(!!!) bean(patch.testClassPath for example) - all is ok only first time. But when i'm restart Alfresco - i got the same exception!!! I'm really don't now why it's happen… Please, answer, how to eliminate of the exceptions?
Thank you.
5 REPLIES 5

mrogers
Star Contributor
Star Contributor
You need to be clearer about which questions you are asking.

It looks like there is an error in your patch classes but without better details of what version you are going from and what version you are going to and what the errors are when you update its not possible to answer you.

vladislavlysov
Champ in-the-making
Champ in-the-making
Ok. My patch classes is simple. For example -

public class TestPatchClass extends AbstractPatch {

    @Override
    protected String applyInternal() throws Exception {
        return "Test string";
    }

}
Trouble in next - when i'm set <fixesToSchema> to ${version.schema} - all is ok(my version.schema = 5019), but when i'm set <fixesToSchema> to 5019(or another number that more than my version.schema) - i got the exception. But when i'm set <fixesToSchema> from 0 to 5018 - all is ok.

vladislavlysov
Champ in-the-making
Champ in-the-making
Hello. I'm find where is proble in Alfresco code. In class PatchServiceImpl in method validatePatches:

for (Patch patch : patches)
        {
            if (patch.getFixesToSchema() > serverSchemaVersion)
            {
                logger.error(I18NUtil.getMessage(MSG_VALIDATION_FAILED, patch.getId(), serverSchemaVersion, patch
                        .getFixesToSchema(), patch.getTargetSchema()));
                success = false;
            }

        }
So, when I set fixesToSchema to 5020(when version.schema is 5019) - i got this exeption.

mrogers
Star Contributor
Star Contributor
So you are attempting to run a  patch for a version greater than the server's version.

i.e. you have configured a patch for a version in advance of where you are at the moment.

vladislavlysov
Champ in-the-making
Champ in-the-making
Yes. But now ,y problem is solved, иut I wonder - what has been added to this test and how the schema version changed(It is necessary to prescribe in its own in alfresco/version.properties)? And yet, as I understand it, if I set targetVersion greater than the current version does not change(for example - current version 5019, targetVersion 5020)?