Alton Hernandez

Ranch Hand
+ Follow
since May 30, 2003
Merit badge: grant badges
For More
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
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Alton Hernandez

Originally posted by Jignesh Patel:
Use open source framework like log4j. Put debug statement and see where it goes.

Loggers(like log4j) or debuggers doesn't help much in this case as the error happens when the client calls the remote object, unless there is a way to actually debug the call.
17 years ago

Our middleware projects runs on BEA Weblogic. From time to time we would get CORBA Marshal Exception. The problem is when we get this error there is almost nothing in the error message that would give us a hint on what's causing it.

So what is the best way of debugging this kind of error? Are there any debugging tools out there that can at least identify what part of the object that we are passing is causing the error?

17 years ago

Originally posted by Keith Lynn:
mx is just a reference. A reference to the actual object is returned, but the local variable, mx, is destroyed.

Objects are the one that are destroyed, not the variables.
I have an ejb which calls a helper class. I want this helper class to start a thread i.e. I want two instances of this helper to run in parallel. How do I do this?

18 years ago
I have an insert statement that is prepared with Auto-generated keys set:


However, I noticed that if this statement encounters an SQLException, for example a duplicate key, it throws a NullPointer exception instead. Can someone explain why is this?

18 years ago
I have a stateless Session Bean that needs to call another java class. I am currently thinking if I should implement this other java class as a normal java class or as an EJB. So I wondering what are the advantages and disadvatages asuming if this java class will always be local (i.e. never remotely called)


Originally posted by ritwik roy:
plz look at the code
int a=10/0;
if i want to perform it then there will be a run time error. it is fine.
but in
double a=10/0.0 there will not be any run time error and the answer will be infinity. why?
please look at another problem

int x=012;
if ( x==10) { System.out.println("if part"); }
else{System.out.println("else part");}
it is printing "if part" why?

A java.lang.ArithmeticException will be thrown if there is an integer division by zero. However,

- a positive float/double division by zero will result in

- a negative float/double division by zero will result in

In you example, 10 will be promoted to float so the result is infinity.

Hope this helps...

Originally posted by Darya Akbari:

I wonder how I can test all HTTP message types. I am able to test with GET and POST but how can I test the remaining message types

Look the list below, maybe anyone can give a hint and update the list on how to best test these HTTP messages:

  • GET - that is the browser's default
  • POST - created by the browser when HTML contains like <form method="post" action="">
  • HEAD - you say
  • TRACE - you say
  • PUT - you say
  • DELETE - you say
  • OPTIONS - you say
  • CONNECT - you say

  • Regards,

    Just do it manually.

    Telnet to your http server e.g.

    telnet 80

    then issue the http commands e.g.

    GET / HTTP/1.1 <cr-lf>

    Refer to tne HTTP rfc for details....

    Originally posted by kapil munjal:
    API specs give you the correct way of doing things.

    The API specs only tells you what you should do. However,it does not give any explanation on why you should do it this way. That is why I asked what is the implication if you get the printwriter first before you set the content type. If it does not give out any error then what is the problem. Could it be that the behaviour is non-deterministic?

    Originally posted by Sumit Sadana:

    It would use the default content type which is "text/html."



    It does not look like that way. When I modified the program to set the response to "application/jar", the browser treated the output as a download, which is what is expected for that content type:

    It is mentioned in the API doc that

    "If obtaining a PrintWriter, this method should be called first."

    I have a code which does otherwise but doing just fine. What is the implication if the getPrintWriter() is called first before setContentType()?


    Is there a limit on the no. of searched items that can be displayed by the search facility? It looks like it is only limited to 200 entries. How can I changed this limit?

    I am trying to search for topics where I made some postings particularly those that I made recently. Unfortunately, there are a lot I made in the past that those alone it is able to reach the limit. So now I cannot display the recent ones.
    18 years ago

    Could someone elaborate further these 2 specifications:



    2. The container will recursively try to match the longest path-prefix. This is done by stepping down the path tree a directory at a time, using the / character as a path separator. The longest match determines the servlet selected.


    Supposing your mapping is as follows:

    And your URL is /catalog/index.html

    Does recursively means the following:

    1. Try to match /catalog/index.html. Not found!
    2. Step down the path tree which will give you /catalog. Try to match - Found!



    A string beginning with a / character and ending with a /* suffix is used for path mapping.

    Suppose you have a mapping of /foo/bar/*, is the string used for path mapping only includes those characters inside the / and /*, i.e. only foo/bar is used in this example?


    Originally posted by Parameswaran Thangavel:

    i heard that the subclass can access the private field of the superclass
    provided the both classes are members of the same class

    what it means i didn't understand

    can any one explain me?

    I think you mean to say "provided that the subclass is a member of the superclass".