Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!

Karl Krasnowsky

Ranch Hand
+ Follow
since Jan 16, 2009
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 Karl Krasnowsky

I'm trying to upgrade a legacy SOAP web service (I mean LEGACY) from its current Netbeans/Glassfish setup to Maven/Spring web service container
Following an example project, it recommends using the tomcat7-maven-plugin for an "easy" tool to run my service in development without having to install an entire server.
Everything was fine until I attempted to update the hibernate system from v4 (told you it was LEGACY) to v5 (v5.4.1.Final to be exact) .
Now when attempting to start the service in the tomcat plugin I get:

Actually multiple of the above, sighting numerous target jars.

Everything I can find related to this online mentions to upgrade to tomcat8 , but all attempts to do this with tomcat8-maven-plugin fail to resolve the plugin and comments imply that this plugin is not available (for a long time!) and many suggestions on how to get around this by actually installing a local tomcat 8 server, which is exactly what I'm wanting to avoid.

If it helps, here's my pom:

I'm going around on circles on this and just want a simple server to do some local testing against.

10 months ago
Reactjs with backing microservices, with whatever code base you're comfortable with.
I don't want to get into a discussion about angular vs. reactjs, just my preference.
1 year ago
Thanks Tim, I was afraid this was the case. Was hoping it wouldn't have to get that involved (we're moving the app stack entirely off of the jsf/rf/jsp platform anyway).
Guess will live with the warts until we get the new platform built.
2 years ago
It's been quite a while since I've had to work with JSP, so please forgive me if this is a bit rudimentary.
I have a jsp form that currently, when submitted and processed successfully, will render a "success" jsp page that provides a link whose value is coming from the contents of a session bean, like so (using jsf):

And in this legacy code, in order to access the Project that was generated you click on the link that is generated by:

What I'd like to do, is change this behavior so instead of rendering this page, simply redirect to
from this success page. I can't figure out how to format that bean value into the success page properly. I've tried this among other things:

and it simply bombs (won't accept #{projectbean.projectURL}). Other attempts clearly didn't like how and where I was trying to add the bean value.

also tried using this:

but can't figure out the proper syntax to add the projectbean.projectURL to the Location header.
Any help/ideas on this would be greatly appreciated.

2 years ago
Hi Budi,
Just playing devil's advocate and would be willing to take your book for a spin to determine this myself, but there are plenty of books and resources available on this subject, in your opinion what would differentiate your offering from others already on the market?

9 years ago

Karl Krasnowsky wrote:but if the original object that was returned was being referenced for contained properties by client 1 and it was unexpectedly deleted by a second client process during this event ...

I guess it's not technically deleted by the update process, simply replaced, so the original should still be accessible by the initial client undisturbed until its reference is released? I guess I'm looking at this as if I'm modifying the same object, but essence this isn't the case. I also think I'm using the term "guess" too much. Makes me nervous.

Dieter Quickfend wrote:What do you consider the problem with that object becoming detached when the cache is refreshed?

Hi Dieter,
I would think somewhat obvious, but if the original object that was returned was being referenced for contained properties by client 1 and it was unexpectedly deleted by a second client process during this event wouldn't/couldn't it result in a null pointer (or some other reference exception) condition? or should the GC not allow the deletion since it's being referenced by another thread?

I'll attempt to explain this a clearly as possible.
1) A JSP tag library that serves language localized UI objects for company Web applications.
2) Information that generates these objects is provided via the parsing of xml files read in from the local file system (via UrlClassLoader).
3) In order to minimize footprint, only one instance of the DataServer object module must be shared across all session instances (possibly thousands).
4) Object server content must be dynamically reloadable upon,
a) A configurable timer that when run sets a flag to indicate that the xml file source needs to be checked for updates during the next access.
b) next access after flag is checks a date stamp in the xml file(s) and if different then the prior access, refreshes the cache of the singleton DataServer instance.

So a typical SimpleTag process would do something like this:

(pseudo SimpleTag code):

seems simple enough... however, the obvious issue for me in this case is after the ds.getSomeObjectList() is performed and the objects are in the process of being sent to the session space and then rendered via the JSP client code in one client, another client wanting this same DataServer comes in... and during this access it is deemed necessary to reload the object cache as per the rules stated above. If this should happen the objects that the first client is processing are deleted due to the cache refresh and all hell is to be paid.

This has to be a relatively common problem with possibly many approaches to guarantee the integrity if the DataServer objects across multiple clients?
Personally I can come up with no logical solution to absolutely guarantee that at no particular time a referenced object will become unglued due to the dynamic reloading requirement.

Can anyone provide suggestions on how to approach this? Other then coming up with an elaborate access counting algorithm which would be very difficult to support, I'm at a loss as to what to do about this.


I came across a technique for utilizing the log4j logger within jsp scripts for providing diagnostic feedback.
I was hoping I could add, e.g.,

throughout my code for development level information and when ready for production, define the priority for the package to ERROR so such messages would no longer be logged without touching code. Seemed like a clean solution.
However, the priority rule doesn't seem to work with JSPs?
In order to determine the classpath for the compiled jsp I println out the this.getClass().getName() information of the jsp.
This came back as:
(cart being the class that was generated).

so I figured adding a rule like this:

would do the trick, but when set this way I still get debug level output. Is it possible to control the priority level logging of jsps? and if so, how?
10 years ago
I was expecting to find readily available examples of this, but what I'd like to do is have a sub location of a package set to one log level while setting the rest to another... e.g.,

but it would appear that he 2nd rule trumps the first. Is there syntax that will allow me to apply this properly?

Bear Bibeault wrote:All this information is on the request, which can be obtained from the PageContent.

Yea, got that, but how do you get to the PageContent from the SimpleTagSupport? [before I searched coderanch]

Okay... so I found a reply from you for this very question a real long time ago here:

I should have done a bit more searching...

10 years ago
I thought this would be relatively simple, but now I'm not so sure.
In a doTag() block of my handler I want to detect if a certain parameter had been passed into the page via url, e.g.,

I want to find the showkey parameter, but I don't see anything in the SimpleTagSupport that would provide such access.

There must be a way to do this?

10 years ago

Tim Holloway wrote:I'm not sure I understood that, but if you're saying what I'm thinking you're saying, you can define a resource property and use JNDI code in the app to get its value. Simple property values can be read directly that way. If you have lots of properties, setup a simple property that locates the property set. Something like the absolute path of an externally-supplied properties file or a jdbc URL.

Well, I need something even more basic.

In JBoss you can simply do something like this:

and (I assume) on jvm startup of the server it simply appends this to the property set so in your code you can do this:

and there you go... no special context mapping, just a basic property call.
10 years ago
Tomcat 6

While I can find reams of information on setting up an OS environment for running tomcat, I'd like to define a variable within tomcat so that when my jsp's and supporting bean code run they can utilize these variables at server runtime.

Hoping this is pretty obvious, but where/how are such variables defined within the Tomcat configuration system?

In JBoss I can do this by defining such properties in the deploy/properties-service.xml
Is there a like process for doing this in vanilla Tomcat?

10 years ago

Paul Clapham wrote:Well, it is "since 1.6". But those poor Java engineers... labouring away in their grotty cubicles making neat new stuff, and nobody notices.

Well, the caching apparently has been there for awhile but the ability to control it is new with 1.6.

Product I'm working with is dependent on Jre 1.5 so using these new services isn't really available anyway.
10 years ago