Not able to create leaf nodes under collection nodes

Submitted by Anonymous on Tue, 2009-06-30 12:33

Hi, I'm having an issue that whenever I attempt to create a new leaf node under a collection node that I have created, it will respond with success (and notify subscribers of the new node's association). However, the node is never actually created.

Any ideas? Have I found a bug?

The pubsub nodes would match

The pubsub nodes would match the ones I referenced in the pastebin from earlier in this thread.

It seems that the first child node created after restarting Tigase would cause the exception, but subsequent ones were created with no error.

dayu's picture

Nivek, I cannot reproduce

Nivek, I cannot reproduce the problem you mentioned. Do you have any special pubsub node configuration? Can you post the xml to reproduce the problem?

Sorry, on my last comment I

Sorry, on my last comment I meant I 'added' a new 'create' method along with the original one.

Nivek

I have been working with the

I have been working with the user "Anonymous" above on this issue. We have implemented the change from the current SVN and it indeed did work. But we ran into a new issue. When creating a new pubsub node, and always after the initial start up of 'tigase' we were getting:

java.lang.RuntimeException: INCORRECT

All other nodes created after that did not give us this error.

With a little investigation we see that this error was caused by the following code:

if (node.getNodeSubscriptions() != nodeSubscriptions) {
throw new RuntimeException("INCORRECT-SUBSCR");
}

in method 'update' in file '/tigase/trunk/src/main/java/tigase/pubsub/repository/cached/CachedPubSubRepository.java'. We added the -AFFIL and -SUBSCR to the 'update' methods to see which method was causing the "INCORRECT" error.

Further investigation show us code that creates the "Affiliations" and "Subscriptions", both called 'create' differed.

So we changed the 'create' method in '/tigase/trunk/src/main/java/tigase/pubsub/repository/NodeSubscriptions.java' from:

public static NodeSubscriptions create() {
NodeSubscriptions s = new NodeSubscriptions();
return s;
}

TO:

public static NodeSubscriptions create(String data) {
NodeSubscriptions s = new NodeSubscriptions();
try {
s.parse(data);
return s;
} catch (Exception e) {
return new NodeSubscriptions();
}
}

AND in method 'createNode' in file '/tigase/trunk/src/main/java/tigase/pubsub/repository/cached/CachedPubSubRepository.java' change the line:

NodeSubscriptions nodeSubscriptions = new NodeSubscriptions(NodeSubscriptions.create());

TO:

NodeSubscriptions nodeSubscriptions = new NodeSubscriptions(NodeSubscriptions.create(null));

Now we get pubsub nodes created and with no exceptions thrown on the initial startup of 'tigase' and can keep creating them without issues...so far!

Do you concur with this?
Was your intent to throw an exception in the first call to it?

Thank you for your help!!
Marquis and Nivek

dayu's picture

It is a typo. In

It is a typo.

In src/main/java/tigase/pubsub/repository/cached/Node.java, the following function needs to be changed.

Previous:

public void configCopyFrom(AbstractNodeConfig nodeConfig) {
synchronized (this) {
nodeConfig.copyFrom(nodeConfig);
conNeedsWriting = true;
}
}

new:

public void configCopyFrom(AbstractNodeConfig config) {
synchronized (this) {
nodeConfig.copyFrom(config);
conNeedsWriting = true;
}
}

dayu's picture

From what I discovered so

From what I discovered so far, it seems copyValuesFrom() in Form.java in tigase utils package does not work with "text-multi" field. The value set in pubsub#children is lost during copyValuesFrom() operation.

Yeah, after a bit more

Yeah, after a bit more digging this appears to be a more accurate description of the problem insofar as I can tell.

Stumbled across this problem

Stumbled across this problem myself yesterday. I think it's just the child node discovery that doesn't work. The node seems to actually be there and can be published to, and subscribed to. Will do more testing soon to confirm this.

I probably should note that

I probably should note that I am running 4.2.0-b1720, so any fixes that might have been put in since then I do not have.

OK, I was having severe

OK, I was having severe trouble getting the XML not to be interpreted here (I'm sure there's a way, but I couldn't get it).

Anyway, here's the post I *was* trying to put here with all the details:

http://pastebin.com/f111267

Artur Hefczyc's picture

Could you please provide us

Could you please provide us with more details, like step by step instructions what you send to the server, what you receive, what is the expected result and what you are receiving?
How do you know that the node is not actually created?
Such details would allow us easier diagnose the problem and create a fix.
Thank you.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

The content of this field is kept private and will not be shown publicly.