Author |
Message
|
dwilches |
Posted: Thu Jan 13, 2011 12:41 pm Post subject: Custom message catalog working from ESQL but not from Trace |
|
|
 Novice
Joined: 12 Jan 2011 Posts: 19
|
Hi,
I'm trying to create a message catalog as explained in:
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp?topic=/com.ibm.etools.mft.doc/as04521_.htm
The MC file I used as a template is:
http://msdn.microsoft.com/en-us/library/dd996907%28v=VS.85%29.aspx
But I have customized one of the messages so it looks like this:
Code: |
MessageId=3051
Severity=Informational
Facility=System
SymbolicName=MSG_INSERT_DISK
Language=English
Insert %%1000 in %%1001 and hit any key when ready...
.
|
The problem I'm facing is that from the Trace node when I specify the name of my catalog (it's called "mymesg") and the message number (3051) it produces the follosing error in the Windows event viewer:
Code: |
No se encuentra la descripción del id. de evento 3051 en el origen mymesg. El componente que provoca este evento no está instalado en el equipo local, o bien la instalación está dañada. Puede instalar o reparar el componente en el equipo local.
Si el evento se originó en otro equipo, la información que se va a mostrar tenÃa que haberse guardado con el evento.
Se incluyó la siguiente información con el evento:
MB7BROKER.default
'Hola
'
PublishSubscribeTest.Trace
El recurso de mensaje está presente, pero el mensaje no se encuentra en la tabla de contact admin o mensajes
|
(What it says, translated, is: "The description of the event id 3051 was not found ... The message resource was found, but the message was not found in the string or message table.")
I think that the MC was created correctly because from a Compute Node this works as expected (produces the text "Insert %%1000 in %%1001 and hit any key when ready... " in the Windows Event Log):
LOG EVENT SEVERITY 1 CATALOG 'mymesg' MESSAGE 3051 VALUES('Hola',2,3,4);
If I'm referencing the same message catalog and the same message number from both sources, why is the Trace node not finding my message description?
Thanks. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 13, 2011 12:57 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
This is presumably a continuation of this?
Though I unreservedly accept this is an entirely new slant on it & not a double post; I mention it to prove new readers some background. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
dwilches |
Posted: Thu Jan 13, 2011 1:01 pm Post subject: |
|
|
 Novice
Joined: 12 Jan 2011 Posts: 19
|
Thanks Vitor, you're right.
This problem arose when trying to solve that other topic. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 13, 2011 1:43 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
I'm just sorry I've nothing more constructive to offer. All these years of WMB, never needed to build a new message catalog, never tried it for a laugh...
Someone else will be along in a moment. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
smdavies99 |
Posted: Thu Jan 13, 2011 1:57 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Vitor wrote: |
I'm just sorry I've nothing more constructive to offer. All these years of WMB, never needed to build a new message catalog, never tried it for a laugh...
Someone else will be along in a moment. |
Back in the days of V2.1, there was an optional exercise in the training course that involved building your own message catalog.
I'm with Vitor here as I've never done this since.
THere really was never the need to do this since. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jan 13, 2011 6:55 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I'm willing to accept a large amount of responsibility for this...
Particularly if you were careful about how you worded and created a PMR..
But before we get to that point.
Did you carefully follwo Step 6 on the page you have linked to? Did you actually restart broker after that? And, potentially, the entire Windows box? (I mean, really, Windows?)
And for the record, I would like to provide some for the steps you have taken between the previous post and this topic.
Well Done. |
|
Back to top |
|
 |
dwilches |
Posted: Thu Jan 13, 2011 8:11 pm Post subject: |
|
|
 Novice
Joined: 12 Jan 2011 Posts: 19
|
mqjeff wrote: |
Did you carefully follwo Step 6 on the page you have linked to? Did you actually restart broker after that? And, potentially, the entire Windows box? (I mean, really, Windows?)
|
Actually in that step I had a confussion. It says:
Code: |
"You must give in regedit the new key the name that you specify for the messageSource on a utility function in your user-defined extension (for example, CciLog) or as the property of the built-in node that you have included in your message flow"
|
I'm not sure whether I got it right: I tried using "mymesg" as the key value in the regedit, and I used the same value for the catalog name property in the Trace node and in ESQL. I saw that it was working fine in ESQL so I let it that way.
Step 6 don't say anything about restarting the broker not wnidows, but I was so desperate (well, not true, I'm doing this for "fun") that I did both things, and it's not working yet.
All the other parts of the step 6 I followed it exactly. I created the required key and created the required content (copy&paste so I'm sure I did't make typos).
Also note that from ESQL it's working right. |
|
Back to top |
|
 |
dwilches |
Posted: Thu Jan 13, 2011 8:14 pm Post subject: |
|
|
 Novice
Joined: 12 Jan 2011 Posts: 19
|
Do you know if there is a reserved number interval in the message numbers that can be used by the custom catalog?
I saw that the default message catalog has an interval for using in the Trace nodes, but they don't say a thing about anything like that in custom catalogs. I've tried with message number 1, 101, 103 and 3051.
(I already searched for the answer in the docs but I couldn't find an answer). |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jan 14, 2011 2:52 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
So the name mentioned in step 6 is the "logical" name of the message catalog. If you look at other things in the same location in the registry you will see that, for example, there is one named "WebSphere Broker 6108".
Then when you look in Event Viewer, you will see messages emitted under the name "WebSphere Broker 6108".
What step 6 is telling you is that whatever you decide for this name - "My Catalog" or "My Broker Message" or "ApplciationXYZ" - is the name that you will put into the Trace node for the Message Catalog property - and be sure to make it exactly the same casewise and with spaces or etc.
There isn't a predefined range of message numbers that I'm aware of. The range in the sample file you have mentioned goes from 1 to 4. |
|
Back to top |
|
 |
dwilches |
Posted: Fri Jan 14, 2011 4:58 am Post subject: |
|
|
 Novice
Joined: 12 Jan 2011 Posts: 19
|
According to what you say, I followed step 6 correctly.
BTW: I modifified the sample adding the 3051. But I'll run again all the steps creating the mc in case I made a mistake ... I'll be posting it here in a moment. |
|
Back to top |
|
 |
dwilches |
Posted: Fri Jan 14, 2011 5:36 am Post subject: |
|
|
 Novice
Joined: 12 Jan 2011 Posts: 19
|
Hi again!
Well, so I did everything from the start and continue having the same problems. I used the MC that follows:
Code: |
; // ***** mymesg.mc *****
; // This is the header section.
MessageIdTypedef=DWORD
SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS
Informational=0x1:STATUS_SEVERITY_INFORMATIONAL
Warning=0x2:STATUS_SEVERITY_WARNING
Error=0x3:STATUS_SEVERITY_ERROR
)
FacilityNames=(System=0x0:FACILITY_SYSTEM
Runtime=0x2:FACILITY_RUNTIME
Stubs=0x3:FACILITY_STUBS
Io=0x4:FACILITY_IO_ERROR_CODE
)
LanguageNames=(English=0x409:MSG00409)
LanguageNames=(Japanese=0x411:MSG00411)
; // The following are message definitions.
MessageId=0x1
Severity=Error
Facility=Runtime
SymbolicName=MSG_BAD_COMMAND
Language=English
You have chosen an incorrect command.
.
Language=Japanese
<Japanese message string goes here>
.
MessageId=0x2
Severity=Warning
Facility=Io
SymbolicName=MSG_BAD_PARM1
Language=English
Cannot reconnect to the server.
.
Language=Japanese
<Japanese message string goes here>
.
MessageId=0x3
Severity=Success
Facility=System
SymbolicName=MSG_STRIKE_ANY_KEY
Language=English
Press any key to continue . . . %0
.
Language=Japanese
<Japanese message string goes here>
.
MessageId=0x4
Severity=Error
Facility=System
SymbolicName=MSG_CMD_DELETE
Language=English
File %1 contains %2 which is in error.
.
Language=Japanese
<Japanese message string goes here>
.
MessageId=0x5
Severity=Informational
Facility=System
SymbolicName=MSG_RETRYS
Language=English
There have been %1!d! attempts with %2!d!%% success%! Disconnect from
the server and try again later.
.
Language=Japanese
<Japanese message string goes here>
.
|
And the commands executed were:
Code: |
Setting environment for using Microsoft Visual Studio 2010 x86 tools.
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>cd C:\Program Files\IBM\MQSI\7.0\messages
C:\Program Files\IBM\MQSI\7.0\messages>mc -v -w -s -h . -r . mymesg.mc
MC: Compiling mymesg.mc
Writing .\MSG00411.bin
[00000003 .. 00000003] - 80 bytes
[40000005 .. 40000005] - 80 bytes
[80040002 .. 80040002] - 80 bytes
[c0000004 .. c0000004] - 80 bytes
[c0020001 .. c0020001] - 80 bytes
Total of 5 messages, 464 bytes
Writing .\MSG00409.bin
[00000003 .. 00000003] - 80 bytes
[40000005 .. 40000005] - 216 bytes
[80040002 .. 80040002] - 72 bytes
[c0000004 .. c0000004] - 88 bytes
[c0020001 .. c0020001] - 84 bytes
Total of 5 messages, 604 bytes
C:\Program Files\IBM\MQSI\7.0\messages>RC /v mymesg.rc
Microsoft (R) Windows (R) Resource Compiler Version 6.1.7600.16385
Copyright (C) Microsoft Corporation. All rights reserved.
Using codepage 1252 as default
Creating mymesg.res
mymesg.rc.
Writing MESSAGETABLE:1, lang:0x411, size 464.
Writing MESSAGETABLE:1, lang:0x409, size 604
C:\Program Files\IBM\MQSI\7.0\messages>LINK /DLL /NOENTRY mymesg.res
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
LINK : warning LNK4068: /MACHINE not specified; defaulting to X86
C:\Program Files\IBM\MQSI\7.0\messages>
|
Then I checked the configuration in the regedit, and used "mymesg" as the catalog name in the Trace node and ESQL ... and now it doesn't work in either one :S ... I'm using the message number 3.
I'm using an AMD64 machine so afer I saw:
Code: |
LINK : warning LNK4068: /MACHINE not specified; defaulting to X86
|
I compiled two more catalogs under the names mymesg2 and mymesg3 and tested them also. Those catalogs where created for archvitectures X64 and IA64 respectively, so now I know that neither of X86, X64 and IA64 are working for me ...
The reason cause I'm using message 3 and not the others is because when I started loking at the generated ".h" file I saw the following defines:
Code: |
#define MSG_BAD_COMMAND ((DWORD)0xC0020001L)
#define MSG_BAD_PARM1 ((DWORD)0x80040002L)
#define MSG_STRIKE_ANY_KEY ((DWORD)0x00000003L)
#define MSG_CMD_DELETE ((DWORD)0xC0000004L)
#define MSG_RETRYS ((DWORD)0x40000005L)
|
If you look carefully, the only message number that was not modified is the number 3. So I felt it was less error prone to use that.
The error remains the same, in the regedit I see that the catalog is being found, but the message number is not.
PD: If you're thinking it's the language, I've already tried changing the "Japanese" in that file for "Spanish" cause my Windows is the spanish version (and added "LanguageNames=(Spanish=0xC0A:MSG00C0A)" to the file). Same problem, nothing changes. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jan 14, 2011 6:12 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I'll see if I can play with it a bit later today.
Just to confirm, you have specified the value "3" as the Message Number on the Trace node? And not "0x3" for example? |
|
Back to top |
|
 |
dwilches |
Posted: Fri Jan 14, 2011 6:30 am Post subject: |
|
|
 Novice
Joined: 12 Jan 2011 Posts: 19
|
Hi!
Well, I've already found the cause to my problems
First, I started creating a MC file taking this template.
The full MC file is here:
Code: |
; /* --------------------------------------------------------
; HEADER SECTION
;*/
SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS
Informational=0x1:STATUS_SEVERITY_INFORMATIONAL
Warning=0x2:STATUS_SEVERITY_WARNING
Error=0x3:STATUS_SEVERITY_ERROR
)
;
;
FacilityNames=(System=0x0:FACILITY_SYSTEM
Runtime=0x2:FACILITY_RUNTIME
Stubs=0x3:FACILITY_STUBS
Io=0x4:FACILITY_IO_ERROR_CODE
)
LanguageNames=(English=0x409:MSG00409)
LanguageNames=(Spanish=0xC0A:MSG00C0A)
;
;/* ------------------------------------------------------------------
; MESSAGE DEFINITION SECTION
;*/
MessageIdTypedef=WORD
MessageId=0x1
SymbolicName=CAT_1
Language=English
Category 1
.
MessageId=0x2
SymbolicName=CAT_2
Language=English
Category 2
.
MessageId=0x3
SymbolicName=CAT_3
Language=English
Category 3
.
MessageIdTypedef=DWORD
MessageId=0x100
Severity=Error
Facility=Runtime
SymbolicName=MSG_COMMAND_ERR
Language=English
The command is incorrect.
.
MessageId=0x101
Severity=Success
Facility=System
SymbolicName=MSG_STRIKE_ANY_KEY
Language=English
Press any key to continue . . . %0
.
MessageId=0x102
Severity=Error
Facility=System
SymbolicName=MSG_FILE_BAD_CONTENTS
Language=Spanish
File %1 contains %2, which is in error
.
MessageId=0x103
Severity=Warning
Facility=System
SymbolicName=MSG_RETRYS
Language=English
There have been %1 retrys with %2 success! Disconnect from
the server and retry later.
.
MessageId=3051
Severity=Informational
Facility=System
SymbolicName=MSG_INSERT_DISK
Language=Spanish
Insert %%1000 in %%1001 and hit any key when ready...
.
;/* Insert string parameters */
;
MessageId=1000
Severity=Success
Facility=System
SymbolicName=DISK
Language=English
disk%0
.
MessageId=1001
Severity=Success
Facility=System
SymbolicName=DRIVE
Language=English
drive%0
.
|
I made my tests using the 0x102 and 3051 messages. Note that 0x102 is 258 in decimal, so I'll be using 258 in the trace node and ESQL statements.
If I configure the trace node to use the 258 message, it works fine, but if I use the 3051 message, it doesn't work :| .... and the reason is ... the declared error level in the message catalog must match the error level in the trace node !! Which seems to default to "error" level. And note that 258 is at error level, while 3051 is at info level.
So if I want to use the 258 message from ESQL I have to write:
Code: |
LOG EVENT SEVERITY 3 CATALOG 'mymesg7' MESSAGE 258 VALUES('this is an error message');
|
And if I want to use the 3051 message I have to write:
Code: |
LOG EVENT SEVERITY 1 CATALOG 'mymesg7' MESSAGE 3051 VALUES('This is an info message');
|
If they don't match the message number will not be found and you'll get the same errors I was getting.
From the trace node I'm only able to use the 258 message ... so ERROR is the default level? I guess yes, and that's the reason of the former problem
The key to my problems where the error level declared in the message file and the level that was trying to use from the WMB toolkit. It happens that if a message is declared with an error level of ERROR it cannot be used as it were an informational message, and viceversa.
Of course the trace node doesn't let to choose the error level, so I guess it cannot be used with other messages than those from level ERROR.
[/b] |
|
Back to top |
|
 |
mgk |
Posted: Fri Jan 14, 2011 6:47 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Hello:
Quote: |
"Of course the trace node doesn't let to choose the error level, so I guess it cannot be used with other messages than those from level ERROR" |
You are correct, the trace node assumes an Error level for the message. If you need to be able to set the error level on the trace node, please raise a requirement for this...
Kind regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
|