Chris Snapp

Greenhorn
+ Follow
since Nov 14, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Chris Snapp

I have a rather unusual situation where by design I have 15+ JVM's running at the same time on a server. Most of these processes use a lot of memory and each has a max heap size set to 2GB. It seems that once a JVM grows its heap size there is no mechanism to release that memory back to the OS. So even with GC working fine within the JVM the memory is still unusable to any of the other processes. Anyone have a way to give memory back to the OS from a JVM?

NOTE:
* This system is running on a Linux OS if that matters
* I'd like to focus on the question of releasing JVM memory back to the OS rather than discuss the design decision of separate JVMs please.

Thanks all
13 years ago
Huh, I'm an idiot.....a simple fix for the javascript problem would be to escape the CDATA tags.....a'lika so:


[ September 26, 2005: Message edited by: Chris Snapp ]
[ September 26, 2005: Message edited by: Chris Snapp ]
17 years ago
JSP
So I'm attempting to use purely XML based JSP 2 tag files and I've bumped into a couple of problems. I'll toss a snippet of code to help with the explanation.

  • I'd like to dynamically generate an XHTML checkbox via a JSP tag that takes in parameters and determines whether to build the element with the "checked" or "disabled" attributes. I thought I could get away with throwing some <c:if> tags around the <jsp:attribute> tag but it fails with a nullPointerException. Anyone know how to choose what attributes are added to a <jsp:element> tag?


  • I'd like to pass a bunch of parameters in the body of a tag, this was easy when I was making the JSP tags using class files but I'm not sure how to pull it off with JSP tag files. Any pointers to info on this would be swell.


  • Any ideas on how I could place dynamic info inside of a CDATA tag on my JSP tag file would be greatly appreciated. Since the tag files are themselves XML documents, the dynamic pieces do not get rendered.



  • Any help on these problems would be greatly appreciated, hopefully I'm not pushing to much in one post.

    - Thanks all
    [ September 26, 2005: Message edited by: Chris Snapp ]
    17 years ago
    JSP
    Wow....I was completely prepared for a response along the lines of "Holy Heck you need to just stop what you're doing and do it this way!...".

    <William Brogden> I'll have to read up on serialization of objects because to be totally honest I really don't have a clue how that works. Pretty sad, I know. But setting a cookie that exists while the person is working on the form is a pretty good idea. Hopefully if I can figure out the other part I can confidently say its a great idea.

    <Stan James> In response to the in-memory solutions....that is actually what the issue is right now. I am currently working against a farm that has not only a Tomcat session timeout but a load-balancer timeout period.
    As for saving to the database, I had thought of doing this awhile back and it was only going to be able to be done two ways the way I see it.

    1. Dupe the entire table structure of the form to be used as a temporary holding area. (Horribly nasty in my mind, especially since I have multiple large forms with the same issue)

    2. Allow the user to work directly off of the final version of the form. This becomes an issue when they are allowed to go back and edit it since they would be saving their changes as they go. That might confuse someone and also there would be no way for them to hit a cancel button and not have the changes take effect.

    Please feel free to let me know if this is only an issue because I am not following some strict standard or something. Another reason for my posting to a forum is to find out if I am going down a horrible path. I have never worked with EJB's and I have minimized my use of strict servlets by using JSP to pass objects to session POJO objects handling DB transactions through Hibernate.
    17 years ago
    Hi, I've been having problems with my web application where I have a large multi-paged form that the users need to fill out. Currently this form's fields are populating a POJO object sitting in the session scope. As you navigate between tabs the form on the page is submitted and a homegrown "beanfiller" takes the parameters being passed up and populates the POJO.

    In any case the issue is that this app is hosted on a farm of Tomcat servers where the session timeout is set to 30 minutes. So if someone were to start filling out a form and then take a phone call, when they returned and clicked on another tab the previous data would be gone since the POJO object had been dumped.

    I'm not sure how to handle session timeouts without persisting the form page data to the database on each tab change. Any help would be appreciated. Hopefully I explained the problem correctly. I don't have a lot of experience with forums.

    Thanks
    17 years ago
    I wasn't sure if this is a beginner post or not, but I'm trying to use java to dump the event logs of multiple win2k servers to a single database. I was hoping there was already some windows api that would allow this to be done easily. If someone could point me in the right direction I'd appreciate it. Also, is there any way to easily grab other informational data (ie. available disk space, current system resources...etc)?
    Thanks
    -Chris
    18 years ago
    Well thanks to all who were patient enough to hold my hand through this stuff. I appreciate the info, and I'm sure I'll be busy trying to learn everything. Thanks again
    -Chris
    19 years ago
    Hmmm....call me an idiot, but that sounds like I need to type:
    java -classpath "C:\eclipse\Servlet JAR\junit3.8.1\junit.jar" "c:\eclipse\workspace\Idealens\test" junit.swingui.TestRunner tests.AllTests
    kinda seems like that can't be right.
    -Chris
    19 years ago
    Thanks for the kick in the tail....I'm working through your "Friki Way" articles now. I've never run any java from the command prompt....I'm on article two for the testing piece and when I type:
    "java junit.swingui.TestRunner tests.AllTests"
    I get this as an error:
    Exception in thread "main" java.lang.NoClassDefFoundError: junit/swingui/TestRunner
    Sorry to pester with a simple beginner problem, but it'd be nice to continue with the articles and not be stuck with an error.
    -Chris
    19 years ago
    Ok, I'm not a Java guru in the least. I am not familiar with it, so I haven't attained an object oriented look to programming yet. I've recently tried to tackle Java as a replacement to PHP. In any case I may be missing out on some cool features to servlets, here's my attempt and maybe someone can give me a shove in the right direction.
    Basically what I want is the following:
    An application that's web interface is a page broken into five zones that form the core structure (top and bottom rows, left center and right columns). These zones would be filled with small web parts that would each have there own logic to handle database query's and such. The main idea relied on these web parts handling all of the logic and only relied on the servlet for the db connections. Also I wanted the web parts to be in seperate files so that creating a new web part or modifying an old one would be isolated.
    Here's the way I was thinking I could do it:
    I was looking to have a servlet that maintained db connections to a users db and handled only user authentication, once the user was verified they would be passed to another servlet that maintained db connections to the application db. I was thinking that the web parts could be stored each in their own folder that would contain a code file and a jsp file. On initializing, the servlet would look for these folders and would import the code files. Then you would be left with a huge servlet that had all of the logic in it to handle requests and pass the responses to the web parts jsp pages for display. The main problem that I saw was that if I wanted these jsp pages to handle displaying just the web part, then I would have to import their output into another jsp that handled the core zoning structure. (ie web part 1's output is placed in left zone column and web part 2's output is placed in the center column).
    If anyone actually read through this whole post, I would be really happy if they could give me a better way of doing this. A shove in the right direction would be a huge help. Thanks
    -Chris
    19 years ago
    Sorry for the delayed response, holidays had me busy. Thanks Tim....I'm gonna give yer method a shot. It's definitely a huge help in getting me going on this. I've downloaded the ldap editor...one question on that. I'm running XP at home and was looking to test it, does XP use an active directory? Obviously my lack of knowledge on this ldap stuff should be apparent. Thanks again.
    -Chris
    19 years ago
    Basically I'm looking to verify username and password from web inputs against the active directory. I would like to have a database table that associates that user and password with a "workspace". Upon a successfull login the server would check which "workspace" the user is authorized to view and pass them over to the servlet handling data connections for that "workspace". Anyways....as you can tell, I'm not familiar at all with working against an LDAP. Any info would be greatly appreciated.
    -Thanks
    Chris
    19 years ago
    I'm not sure if this post is in the right area, but I'm in need of some direction. I've been working through a document library web app and it's working like a champ. I've come to find out that the project is requiring that the users come from win2000 active directory instead of a database. Does anyone have information or know where I can find info on how to get my servlet to be able to query the domain controllers active directory for user info?
    -Thanks
    Chris
    19 years ago
    Shankar - I'm setting the user object in the login method (see below)
    Benny - Sorry I'm pretty new to the Java world so I'm not sure about what you're talking about.
    edited by MC: converted tabs to spaces in code.
    [ December 02, 2003: Message edited by: Mike Curwen ]
    19 years ago
    Hi all,
    This is most likely a common problem, but many a day has been spent working on it prior to this post.
    I'm attempting to check for the existance of a "user" object in a session. If it exists then I want to parse the provided "run" parameter for method names and invoke them. If the "user" object does not exist than I want to direct the person to the login screen.
    The login method will create the user based on a successful login attempt.

    My problem is that by attempting to check if I always end up with it equaling null and so I always hit the login function.
    -Chris

    edited by MC: removed tabs from code.
    [ December 02, 2003: Message edited by: Mike Curwen ]
    19 years ago