This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Philip Shanks

Ranch Hand
+ Follow
since Oct 15, 2002
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 Philip Shanks

Since web workers have to be explicitly managed by the developer, I can foresee memory management issues looming on the horizon. Is this a sufficiently worrisome issue, or am I just being paranoid?

- Phil Shanks
Welcome Ido! When do you think mobile browsers will gain web worker support?
Does anyone recognize what I am doing wrong here?

I'm deploying WLS 10.3 on Windows Server 2003, and following instructions for setting up WLS as a Windows Service in "Managing Server Startup and Shutdown" guide for 10.3. I have the start/stop via Windows SCM working, but I'm having problems implementing graceful shutdown.

Here are the steps taken so far:
1) Installed WLS 10.3 into a new BEA Home (fresh server build, no prev. instances)

2) Created a new domain with one admin server and one managed server

3) Created a Java class using JMX API to shutdown a server instance, deployed in a jar file to the server. (This was a bit tricky as the examples contain a lot of deprecated code that won't compile).

4) Added a Windows service for the domain admin server:

* included an appropriate delay for the Windows SCM
* appended the path to the stop class jar file in the CLASSPATH
* included the "-stopclass:package.StopClass" argument for the beasvc command
* changed the stdio path so I can capture all of the start/stop messages.

5) Set the "Graceful Shutdown Timeout" in the AdminServer -> Control -> "Start/Stop" tab.

On server startup I see in the log file my jar file (cleanshutdown103.jar) does get added to the classpath, and I also see other things that I am setting, like the stdio redirect and the SCM delay. But the log file also always shows "lpszStopClass = []".

I can independently confirm that the stop class is not loading and that it's stop() method is not invoked because I have included output to stdout, and it isn't happening. What did I miss?

Or as an alternative, is there a better way to have managed servers start automatically with Windows Server boot?
11 years ago
OP did not say what platform is being employed, but the "nohup" hints that it is a UNIX-like environment.

Also did not state what version of WLS is used, and I think that there are subtle differences with version.

I also have questions about this topic, but I think there is not enough info to work with here.
11 years ago
Got me... is it a naming collision? That's what "weblogic.common.ResourceException: is already bound" suggests to me.
11 years ago

Originally posted by vats rao:
i didnt get you the statement at 25th line ie "q=t" is wrong how it can be made error free with casting does it like q=super(t)?if not whats the other way

This will allow the code to compile, but will result in a runtime error.
13 years ago

Originally posted by josh gibson:
I'm trying to validate a textfield input for street address.
For the address, I used this bit of code:

however some addresses, such as "40 comm ave #3" are rejected.
Can someone help me fix my problem?
Thank you.

Welcome to JavaRanch Josh!

First, generic address matching is not simple. There are lots of variations on the way an address can appear.

Now, for your specific example, the regex specifies one or more spaces between the hash mark and one or more subsequent digits. That rejects your example right there.

Next, if you intended to use an OR operator (the '|' character), then your grouping may not work. Don't use () for grouping unless you intend to also do capturing. If all you want is logical grouping, then use the non-capturing form (?: ).

Lastly, use the shorthand notation for [a-zA-Z], which is \w. That will make the regex a bit more readable (every little bit helps).

This matches the example address string that you provided, and I think it accomplishes what you were trying to do with the OR operator:

Hope this helps.
[ February 15, 2007: Message edited by: Philip Shanks ]
13 years ago
I'm not real great at explaining this stuff, but I'll try anyway.

In object inheritance, you generally add to or change the methods and properties of the base class, but you do not actually remove any of them, so object type casting only works in one direction.

Consider; what if class Q2 contains methods that do not exist in class Test?

If you could assign q=t with or without first casting it to Q2, then you could also try to call a (nonexistent) Q2 method on an object that is really a Test object.

If you try to make the assignment without a cast, then you get a compile time error; the compiler says, "I got a Test object, but this assignment requires a Q2 object," assuming that you know that Q2 subclasses Test. But you say, "Okay, I'll just cast it to Q2" and it compiles.

Great, but now you have a runtime error, because you can't cast types up the inheritance hierarchy -- the parent class might not have all of the methods, etc that the child class has.
13 years ago
Jesper offers good advice, but I think you still need to update your Java runtime environment.

The Sun JRE has its own time zone data, and I would assume that the IBM distribution is similar. This means that even though the OS is patched, you probably still need to update your Java environment.

IBM provides information on a time zone update utility which appears to be similar to the tzupdater tool offered by Sun.
[ February 13, 2007: Message edited by: Philip Shanks ]
13 years ago

Originally posted by Adam Kjems:
I've been assigned to make a java search engine that can sort and display information about universities, according to certain criteria. I've decided to use xml since its universal and the data can be easily edited in excel. Can anyone suggest a good tutorial or give lend some advice on xml searching through java.

You can start with the XQuery page at W3C, and if you decide that's still the approach you want to take, then search for XQuery tutorials on Google.

You will also want to see if there is an implementation that you are comfortable with, and most of what I have seen is part of some larger product, like an app server or XML database. Scan through the products section of the W3C page referenced above.

If I were undertaking this project, I would check out the Saxon parser project as a good implementation of XQuery.

Good luck!
13 years ago
I think that JSR-80 is what you may be interested in. Unfortunately, it does not appear that this project has gotten much traction. See this article from July of 2006 to learn more about it.

The official site for JSR-80 (the javax.usb specification) is here., and there is an open source implementation project on; its project page is here

Good luck!
13 years ago
I see little difference from a security perspective. The primary difference is whether the generic JDBC call is translated to the vendor specific call on the client or on the server. The client, server and data stream are all equally vulnerable in either case.

I think that the layered security approach will be the same regardless of which JDBC driver type is chosen. You will want to limit which clients the DB server will accept connections from, use encrypted connections wherever possible, adequate authentication and strong access policies.

Originally posted by Reema Patel:
Hi William,
Thanks for the post.

What you said is very apt. Apache is a full blown web server. Tomcat is just a servlet container. But, Tomcat also has the capabilities of a web server. Does this mean that Tomcat runs the HTTPD service? Just wondering, why isn't called HTTP service instead of HTTPD?


Hi Reema,

The "D" stands for daemon, and it seems a bit redundant when combined with the word service, which evokes the Windows terminology for daemon.

I used to think about web servers as being programs that just serve static content (and launch CGI processes). But nowadays I find it more useful to think of a web server as a specialized program who's main purpose is to converse with clients using the HTTP protocol (and/or HTTPS as the case may be).

Tomcat's main function is to provide a container in which the servlet and JSP API's are implemented. That it has the ability to also communicate with clients via HTTP is secondary. It could just as well be using the AJP protocol to communicate through a web server intermediary, letting the web server handle all of the HTTP connections and SSL negotiations.

I have not seen any indication that the Tomcat HTTP engine has poorer performance than dedicated web servers like Apache, Sun JES or IIS, but there are other reasons besides performance for putting a web server in between the client and the servlet container.

It may be that an existing web site has dynamic content based on CGI or some other technology, and "bolt-on" Java capability is desired. Or one could have some sort of clustering architecture that recommends using a web server front-end. Or the enterprise security policy may forbid HTTP requests to come in past the DMZ, and we want to keep the application on an internal network close to the data and directory services, etc. This is where the aforementioned AJP protocol might come into play. There are many situations where you might not choose to use the Tomcat HTTP implementation.

So it's good to understand the difference between web server and servlet container, but stay away from the broader generalization that you always (or never) need to use both together.
[ February 14, 2007: Message edited by: Philip Shanks ]
13 years ago

Originally posted by George Lin:
Hello everyone,

When running my program on Java JVM 5.0, there are strange stack errors. What may be the root cause?

(foo.dll is my JNI invoked native library.)

<<< snip >>>

Stack: [0x0c1e0000,0x0c220000), sp=0x0c21f30c, free space=252k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM cod6, C=native code)
C [foo.dll+0x18070]
C [foo.dll+0x18147]

thanks in advance,

I don't know, but it seems a stack overflow in your "foo.dll" isn't out of the question.

Sorry, that's a pretty lame answer, but there isn't a whole lot to go on.
[ February 09, 2007: Message edited by: Philip Shanks ]
13 years ago

Originally posted by Eric Pascarello:
There is no action fired for the back button.


True, there is no direct Javascript hook for this (should there be? I imagine it would be heavily abused), but I believe that the dojo packages are using iframe navigation to provide a logical hook. I think this is why their mechanism doesn't work in Safari.

On the other hand, wouldn't the onunload event get fired as a result of a back-button click? Perhaps this could somehow be leveraged to alert the application that the back button *may* have been used. I don't know how this could be made either efficient or effective.
[ February 09, 2007: Message edited by: Philip Shanks ]