AnsweredAssumed Answered

doubt in creating custom aspect

Question asked by unknown-user on Jul 17, 2006
Hello there.

i have a problem. When i create a new aspect, all is ok, exactly as i have found in the documents. But there is a detail in the java file. I have the next code:
 public class StatefolderAspect implements NodeServicePolicies.OnAddAspectPolicy
{
    /** Aspect name */
    public static final QName ASPECT_STATEFOLDER = QName.createQName("extension.statefolder.statefolder", "statefolder");
   
    /** Property names */
   // public static final QName PROP_STATEFOLDER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "statefolder");
    public static final QName PROP_STATEFOLDER = QName.createQName("extension.statefolder.statefolder", "statefolder");
   
    /** The policy component */
    private PolicyComponent policyComponent;
   
    /** The node service */
    private NodeService nodeService;
   

The question is… you can notice that there is the part of QName.createQName… commented, because i get an error:

18:36:43,390 ERROR [repo.action.ActionServiceImpl] An error was encountered whil
st executing the action 'composite-action'.
org.alfresco.service.cmr.dictionary.InvalidAspectException: The aspect is invali
d: {http://www.alfresco.org/model/content/1.0}statefolder
        at org.alfresco.repo.node.db.DbNodeServiceImpl.addAspect(DbNodeServiceIm
pl.java:496)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflecti
on(AopUtils.java:335)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynami
cAopProxy.java:165)
        at $Proxy2.addAspect(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
etc
ecc..
I don't know how to resolve it. :(

The problem is that if i put



public static final QName PROP_STATEFOLDER = QName.createQName("extension.statefolder.statefolder", "statefolder");


instead of the comented line, it doesn't find anything, but if i put the commented, happens the same…

can anyone knows something about that error?

I need it urgently… please…
Thanks in advance
Bird

Outcomes