Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Paul Frey

Greenhorn
+ Follow
since Apr 25, 2002
geocities.com
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 Paul Frey

Ulf Dittmer wrote:

This servlet was written from the standpoint that is loaded once at server restart and stays up until server shutdown.


I don't have an idea on how to prove this w/o code changes, but I seem to remember that the servlet spec is quite clear on that it is up to the servlet container on when to initialize and destroy a servlet. While most do it once on web app startup/shutdown (which is reasonable), that is not guaranteed behavior. So if the servlet is written in a way like you describe, I'd call that a bug, because it is relying on undocumented behavior (which may change from container to container, and even between versions of the same container).


I agree it is a bug and not dependable behavior according the J2EE spec. But this problem is only happening in our production environment and we can't push code with logging statements out until April 2010. I was hoping to find something such as a logging setting or something in websphere that would be able to help me determine this life cycle behavior.
12 years ago
I need a way to see a servlet's lifecycle in WebSphere. I can't change the servlet's code to add logging to the destroy() method in a particular servlet. But I have a hunch the servlet is getting unloaded periodically throughout the day. This servlet was written from the standpoint that is loaded once at server restart and stays up until server shutdown. I think this servlet is being unloaded in between these lifecycle states. But I need a way to prove my theory correct.

Does anyone know of a way to see servlet lifecycle status' in WebSphere?
12 years ago
The DB2 JDBC driver is looking for a native file db2jdbc.dll and it can't find it. It should be on your PATH.
I've been looking into the same thing myself with a DB2 connection. Searches on Google have returned many different options, none very elegant. One thing that I've found just recently is the CachedRowSet interface that is supplied in J2SE 1.5. It was also available separately in J2SE 1.4. However, the reference implementation does not support paging. I'm still looking if any JDBC DB2 vendor has an implementation of this interface. I have followed a trail that said that Oracle does have an implementation with paging. But I haven't found the actual code yet.
17 years ago
JSP
The variable t would be threadsafe but the variable i would be defined as a page variable and therefore would exist at the class level and is therefore, not threadsafe.
17 years ago
JSP
Wouldn't a Filter be a better solution here?
17 years ago
I think what you are looking for is available in Java 1.4's NIO api:
ScatteringByteChannel
You can read more about the NIO package at High-Performance I/O Arrives
18 years ago
The concept of GUID's (or UUID's) is not directly related to RMI. It has applications in distributed computing, database projects, etc.
Perhaps I should have started off my discussion thread with the 2 questions I had at the bottom of my message.
So if members who have experience with the search for creating GUID's (or UUID's) could take a look at just the questions - that would be helpful.
Thanks,
Paul
18 years ago
There is some debate between members of my team on my implementation of GUID generator. I am relying on the VMID class to seed the SecureRandom class (see code below):

Then I'm using nextLong() and if the GUID the user is generating allows for characters (not just digits), I'm converting the resulting number to base 36 number (using BigDecimal). Base 32 will give me a much wider range of unique values than base 10 or 16.
I've run this code on multiple machines and within multiple threads on these machines, over many days. I've yet to find a duplicate return value.
So I have 2 questions:
1. Does anyone else out there have some real world feedback from using the SecureRandom generator to generate GUID's (or UUID's depending on your preference)?
2. Does anyone know of a white paper that describes the effectiveness of using the SecureRandom class to generate GUID's (or UUID's)?
Thanks,
Paul
18 years ago
There are many ways to implement unique client identification. If there is only one chat server and the clients have to be unique within that server, then you could keep a list of all active chat clients (probably in the ServerListener.java). Then during the handshake between the server and client, you send the assigned ID to the client (which would include the index of that client in the list of clients).
Another method would be to use either java.rmi.dgc.VMID or java.rmi.server.UID to come up with a unique name you could send to the client during the initial handshake.
Once the initial handshake is done, all subsequent messages from the client would transmit the ID they were assigned. The advantage to this method is no housekeeping is necessary to purge a list of clients and the ID would be unique across chat servers.
Hope this helped.
Paul Frey
Periodically, we have been receiving an IOException using the HIT JDBC DB2 driver HIT SW with a DB2 database connection. The message associated with IOException references a "Broken pipe". I know from my socket programming background that a broken pipe message is normally encountered when the server severs the socket connection to the client. However, the database adminstrators (at a remote location) are not seeing any problems at their end. One other piece of information, this appears to only be happening in our WebLogic 6.1 environment (at least that's the only place we've seen it happen). We have connetion pools continually being tested to ensure that they are valid (this is the reserved pool setting in WebLogic). The other item we noticed was that after a weekend of no user activity, the broken pipe message is the first thing users encounter if there is a call to a DB2 stored procedure. But then the problem appears to go away. Also, the Broken pipe message is only happening on DB2 stored procedures and these same procedures are functioning fine the majority of the time.
Has anyone out there encountered something similar to this?
Thanks,
Paul Frey
Brendan,
You might want to take a look the code at http://jiu.sourceforge.net/
There are classes for converting images to Palm bitmaps.
Sincerely,
Paul Frey
19 years ago
Question: Can software still be sold commercially that and be proprietary when parts of it are based on GPL code?
Details: I am intending to sell software that I'm working on. My problem is some parts of the software (like the Look and Feel classes, etc) are based on GPL based (open source) software code. I have not modified the GPL code, I just use the API. The GPL appears to not address (at least as far as I can tell) use of an GPL API. Anyone out there ever tackle this question?
Thanks in advance.
I use Xvfb to supply the X server. This allows the java applications to run without a display (actually Xvfb creates a buffer for the display).
19 years ago
JSP
I need to tie a Session object to a device ID that will be included in GET or POST operation originating from a PDA device. Is it possible to write a filter that wraps the HTTPRequest so that I could control the Session management (ie. create the session object) by using the device ID instead of a cookie or URL rewriting (which will not work with this device)?
The advantage I see to using this method would be that the web application would be insulated from having to behave differently (outside of the filter of course) for different devices.
If you have any feedback, I'd appreciate it. I'd like to get feedback before I venture into too much coding
Thanks.
19 years ago