Mark Smyth

Ranch Hand
+ Follow
since Feb 04, 2004
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Mark Smyth

Thank for the advice however what is really confusing me is I am just not sure how to load up the document schema during the xsl processing to match the number.

The Source file is

And the document I want to produce is as follows.

I know that my XSL script must load the schema, find the value position, somehow pass in the number in DigitNumber element, find that position within the anumber simpletype and then output the text string at that position.

Something like the XSL below, which is completely wrong but I am totally lost at this stage.

While this is a trivial example in real application I will be mapping code numbers to messages.

Google is not being kind to me today either.

Thanks again, Mark.

Hi guys I have a question. (This is a simplified version of my real world scenario)

I have an xml source document that has a single element that can accept the numbers 1,2, or 3. The target document has a single element that can takethe values one, two or three". (Both of these are constrained by enumeration restrictions).

Is there any way in XSL that I can take the number from the source document, and map it to the position of the enumerator of the second document, in order to return the string representation. (Like you would do if it was in a programming language array).

In my real program I am mapping potenntiially hundreds of codes to status strings, so a simple xsl:choice solution is not reallly an option (The enumerators are guaranteed to be defined in the correct order so that will not be an issue).

So I end up with the following mappings:

Source Schema:

Target Schema:

Originally posted by Jakub Drzazga:
Alecsandru Cocarla have already passed SCJD? If yes, what do they said about runtime exceptions?

If somebody else knows what examinators think about runtime exceptions please write.

I have passed last year using the runtime exception approach.

The examiners will not be too concerned about which strategy you use, as there is no 'right' answer, many people have passed using all sorts of different approaches.

The poor specifications are a test of your ability to weigh up the pros and cons of a design choice and to then be able justify your choice.

Once your logic for selecting one particular strategy over the other is consistent and sound, then you will be fine.
Unless it has changed recently (in the last year or so), I don't think that there is any time limit on finishing the assignment.

The Sun Certified Enterprise Architect part II assignment now has a limit of a year, where there used to be an unlimited time period for completion, so perhaps it is the same for the SCJD assignment now as well?

The safest thing to do is write a mail to Sun Training, to ask them to clarify the situation.
[ December 19, 2008: Message edited by: Mark Smyth ]

Originally posted by Paul Clapham:
In XML file 1, your Book and Title elements are in the default namespace. But your XPath expression is looking for Book and Title elements that are not in a namespace. This is a defect in XPath. The workaround I usually use is something like this:

That did the trick, exactly what I was looking for. An oddity of XPath I was unaware of before.

Hi I have a problem with XPath and XMLUnit.

I have two versions of an xml file one with namespace declarations and one without. Basically what I am trying to do is check if an element exists in the xml file using and Xpath expression and XMLUnit test methods.

When I use the second version of the file the test passes ok. But when I use the first version of the file the test fails.

I am calling the test method as follows: The parameters are an Xpath expression and a document. If the element exists the method does nothing, if it fails and Assertion Error is thrown.

XMLAssert.assertXpathExists("/Book/Title", xml1);

XMLAssert.assertXpathExists("/Book/Title", xml2);

XML File 1

XML File 2

Any ideas?
Thanks, Mark.

Originally posted by Freddy Wong:
As far as I know java version "1.6.0_03" is a production version of Sun JVM. The letter b there stands for build. But I'm not sure about which version that SCJD requires.

Any version of java 1.5 or 1.6 is still perfectly acceptable for the assignment. Java 1.5 will remain valid for about another year as 1.6 has only been out for approximately 6 months or so. As 1.7 has not been released yeat it is safe to say that any version of 1.6 will be safe to use for at least the next two or three years.

Originally posted by gaurav kumar:
I m getting the following error while starting my server on Weblogic.

weblogic.nodemanager.NodeManagerException: [The request to start the server EBTApps1 of domain ebtdomain failed because the node manager did not hear from the managed server in the configured timeout period. Despite this, if the managed server has not failed, it will come up and the node manager will start monitoring it. To adjust this timeout so that the task does not fail prematurely, please refer to the node manager property ScavangerDelaySeconds (Default value : 180 seconds. Current value : 180 seconds).]
at weblogic.nodemanager.client.CommandInvoker.execute(
at weblogic.nodemanager.client.CommandInvoker.invoke(
at weblogic.nodemanager.client.NodeManagerClient.executeCommand(
at weblogic.nodemanager.client.NodeManagerExecuteRequest.execute(
at weblogic.kernel.ExecuteThread.execute(
No Exception Messages

Cud anyone please help me on that.


The server timeout is set to three minutes currently so if the server has not finished starting up after this time period then nodemanager considers it to have failed.

The question is wuld you normally expect the server to boot up within this time period? If the answer is yes then you will have to look in the managed server startup logs to find out what is going wrong.

If on the other hand you would not expect the server to fully boot up within three minutes then you could try increasing the the timeout period to a larger value.
10 years ago

Originally posted by Alex Belisle Turcot:
I agree with you Mark, which is why I choose to throw RecordNotFound from my find method...

Do you throw "DuplicateKeyException" in your create method ? (its a dilemma if you use recNo as your key which easily leads to the impossibility of having a duplicate key.. (ex: key = maxRecNo + 1).

I don't know if I should still add the code to throw DuplicateKeyException and insert a comment stating that "it is currently not possible to meet this condition, but it is kept in order to support future modifications..."

Do you understand my point ? What's your opinion on that ?


Hi Alex,

That is pretty much the same approach as I took to solve this problem. I think it is perfectly acceptable to drop the DuplicateKeyException from the create method and simply document your reasons for doing so.

[ December 12, 2007: Message edited by: Mark Smyth ]

Originally posted by Simon O'Brien:
Great, that is what I was thinking, I just needed clarification! Thanks for all your help.


Hi Simon,

I think it is perfectly valid to drop the RecordNotFoundException from your implementation. Remember that clients should be using the DBMain interface reference type when interacting with your implementation class rather that a reference type of Data itself.

If clients are using a DBMain reference type as they should be, a client must be prepared to handle the exception regardless of whether or not your Data implementation actually throws it. I personaly feel it woul be bad priogramming practice to declare an exception to be thrown from a method when it never can be.
[ December 12, 2007: Message edited by: Mark Smyth ]
If the classes in the jar have been compilled using java version 1.5 then any code compilled using java 1.4 or less will not be able to call any classes in the jar. You need to get a 1.4 version of this jar file.
10 years ago

Originally posted by Raghven k b:
Hello Folks,

My App server contains more than 50 web modules and 10 ejb modules,
I am getting java.lang.OutOfMemory error often.

Later i heard that it might be because of memory leaks (Example : an application running an infinite loop which eats up the memory).

But my idea is to identify where and why this is happening ?
It is very difficult for me to debug by looking to each and every module.

So is there any tool that resolves my problem, probably a monitoring tool that should tell how much memory each module is occupying at a given time.

JDK Version : 1.4
Max JVM Heap Size specified : 256

Correct me if my approach is wrong.

Thanks Ragav.

More than likely it is the memory setting that are incorrect rather than a memory leak. 256 does sound much too low indeed. What Application server are you using? It would be worth changing the max size of the heap when starting the application to 512 or 1024 if the memory on the box allows.
10 years ago

Originally posted by Raghven k b:
Hello Folks,

The below one is a JVM log, it looks like it is logged during garbage collection, Just curious to know what individual paramters are ?

[GC 123175K->94091K(159472K) eden 30464K->0K survivor 714K->1152K tenured 91996K->92939K, 0.0289656 secs]

Any idea ?
or any literature that speaks about GC logs.

Thanks Ragav.

I am no expert on this area but the 123175K->94091K is the size of live objects on the heap before and after GC. (159472K) Is the total available space for the application.

The rest is the summary of the different generations of the heap Eden, Survivour and Tenured.

Garbage collection is quite complicated but there is a good article here article on 1.4 GC (Principles should be basically unchanged for 1.5 - 1.6)

1.4.2 GC
10 years ago

Originally posted by Ajay Divakaran:
There are no compilation errors, but when i run the program I get an NullPointerException in the indicated line below. How do I rectify this?

class A
int i,j;
public class ArrayObjects
public static void main( String args[] )
A ob[]= new A[5];
for( int i=0; i<5; i++ )
ob[i].i=1; //NullPointerException

Not an SJCD problem but I'll answer befroe it is moved. A ob[]= new A[5]; creates and array of size 5. But the objects within the array have not been intialised so the references default to null. This is the same as the statement A ob[]= {null,null,null,null,null};
Use the -d flag to specify an output directory for the javadoc command. This way the html will not be mixed in with the source code.