Skip to main content

Re: Modifying Profile Attributes

17 replies [Last post]
ivelin
Offline
Joined: 2003-07-13
Points: 0

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
deruelle_jean
Offline
Joined: 2003-06-24
Points: 0

Alexandre,

What is the difference between the solution I gave

<%objectNameString=objectNameString.replaceAll("\"",""");
//objectNameString=URLEncoder.encode(objectNameString);%>

and yours ? is it that you have this line only at line 145 and 335 instead of after line 141 ?

Best regards,
Jean Deruelle

alexandrem
Offline
Joined: 2005-10-19
Points: 0

Hello Jean,

The practical diffence between the two solutions is that in your solution, you modify the objectNameString value. When it is passed to Java (e.g. line 162) it is passed with that modification, and Java won't recognize the object (because of the &[b][/b]quot;'s) and throws the exception:

[i][b]javax.management.InstanceNotFoundException: slee: profileTableName="User",type=profile,profile="User1"is not registered.[/b][/i]

In my solution I only do it where it is necessary (lines 145 and 335) and the value of objectNameString isn't modified.

Hope it helps :)

Best regards,
Alexandre Mendonça

deruelle_jean
Offline
Joined: 2003-06-24
Points: 0

I see, great,

Actually the really good thing to do would be to encode the URL with URLEncoder.encode(objectNameString); but the HtmlAdaptorServlet from Jboss cannot handle it correctly
because it doesn't do a URLDecoder.decode of the
objectNameString stored in the request parameter called "name".
The thing is our fix only works in our special case but if other apps put special characters in the objectNameString the problem can be potentially the same...

Thanks for the fix and the explanation
Jean.

luis_teixeira
Offline
Joined: 2005-04-04
Points: 0

Hi,

Are there additional progresses regarding the JMX console problem? Using a more recent version of JBoss might be the solution for this issue, but there is impact regarding other aspects of Mobicents, right? Are there any positive results relative to experimenting Mobicents with other versions, say 4.x.x?

Thanks.

Greetings,

Luis Teixeira

mranga
Offline
Joined: 2003-06-06
Points: 0

Would you like to attempt a "port" to 4.0? Should be straightforward ( lets wait for Ivelin to respond to this before rushing in ).

Ranga

alexandrem
Offline
Joined: 2005-10-19
Points: 0

Hi.

This problem has been fixed by replacing the occurrences of <%= objectNameString %> (in lines 145 and 335 _ONLY_) by this:

<%= objectNameString.replaceAll("\"",""") %>

This works better than Jean's fix because his fix then caused a exception, when the objectNameString was passed to Java. By replacing these lines, only the HTML code is affected and everything works fine.

Best Regards,
Alexandre Mendonça

ivelin
Offline
Joined: 2003-07-13
Points: 0

Alexandre, please submit your patch to the JBoss AS JIRA, if you haven't done it already.

A port to JBoss 4.0.3 would be a good thing and should be relatively painless. There are some classloader changes in the 4.0 platforma, which might cause minor refactoring, but I don't expect that to be significant.

Ivelin

luis_teixeira
Offline
Joined: 2005-04-04
Points: 0

Hi Jean,

Could you provide us with the patched jsp from the JBoss JMX console? I patched the inspectMBean.jsp file according to the indication that you have written (http://jira.jboss.com/jira/browse/JBAS-2037), but I still find issues, such as having one exception printed in each field of the attributes in the web page:

javax.management.InstanceNotFoundException: slee:profileTableName="TestProfile",type=profile,profile="Luis" is not registered.

Invoking operations like closeProfile, editProfile and restoreProfile returns a success response.

Possibly I might have missed something..

Luis

luis_teixeira
Offline
Joined: 2005-04-04
Points: 0

Hi,

In spite of my attempts at using profiles in the service I've created, I still haven't been able to successfully use them. Apart from the solution for the JMX console bug solving one side of the problem, I still cannot do one thing that I consider important: retrieving the concrete profiles and their respective values once they have been created. The problem lies in invoking the getProfileByIndexedAttribute, in which the attribute value used as a key to find the matching profile (last argument) is always considered not to be of the right type (throwing a type mismatch exception), even if in fact it is. Could someone provide for a code snippet of a service where these profiles actually work?

Thanks,

Luis

ivelin
Offline
Joined: 2003-07-13
Points: 0

Maybe the TCK tests can help you understand the issue by illustrating use of getProfileByIndexedAttribute. See Test4459Sbb and ProfileFacilityTestSbb.

Ivelin

ivelin
Offline
Joined: 2003-07-13
Points: 0

Thanks, Jean. I will watch it. If there is no response from anyone else at JBoss, I will apply the patch. Please remind me if you can.

Ivelin

deruelle_jean
Offline
Joined: 2003-06-24
Points: 0

it is now fixed in the upcoming version of jboss AS : JBossAS-4.0.4 Final... but I guess we still have the problem with our jboss 3.6 version

ivelin
Offline
Joined: 2003-07-13
Points: 0

Jean,

glad to see you on the forums again.

What are you saying is fixed in JB AS 4.0.4? The currenty version due for release is 4.0.3.

Ivelin

deruelle_jean
Offline
Joined: 2003-06-24
Points: 0

Thx Ivelin :-). I was on vacation and the baby is taking all the free time :-) This kid is nothing less than happiness...but I digress

I was mentionning the bug on the Jboss JMX console :

Here is the mail I received in response to the bug reported on the Jboss JIRA :

[ http://jira.jboss.com/jira/browse/JBAS-2037?page=all ]

Adrian Brock updated JBAS-2037:
-------------------------------

Fix Version: JBossAS-4.0.4 Final

Looks like it is not planned to be fixed in the current due version.

ivelin
Offline
Joined: 2003-07-13
Points: 0

You get what you wish for :)

Since the bug will not be fixed in 3.2.x, can you add the file to our repository and have the build system override the JBoss jar?

Ivelin

deruelle_jean
Offline
Joined: 2003-06-24
Points: 0

I'll try to do it over the week end. Actually, I'll not change the jboss jar just overwrite the jsp causing the problem with the quick fix, it should be enough.
Jean

ivelin
Offline
Joined: 2003-07-13
Points: 0

Neat!