Alex Givant

Greenhorn
+ Follow
since Nov 12, 2001
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 Alex Givant

I've found answer myself: Thread class doesn't implement Serializable, so it should be 'transient'.
We has bunch of classes that need to be serialize/de-serialize and some of them contains reference to Thread object.
My question is: should those refernces to be 'transient' or Thread object could be safely serialize/de-serialize.
If it should be 'transient', what is the way to restore and re-run these threads after object has been de-serialized? Should I use Externalizable interface instead of Serializable to create and create methods readExternal()/writeExternal() to deal with Thread objects.
Any advice/tip/link will be highly appriciated.
May be I need to clarify that: in run() method of the Thread belongs to BP we call some synchronous method and after we return from it, run() finished and thread should be released back to thread pool. So we need to suspend/resume thread(s) during this synch call.
I need to implement following logic:
- Number of Business Process (BP) run using 1 or more threads each.
- We need to implement suspend/resume for BP
- Suspend should suspend all thread(s) belong to chosen BP
- Resume should resume all thread(s) belong to this BP
Each thread in BP in run() method has some useful functionality, so it's impossible to make while(true) and check if the thread should be suspended or resumed.
Any idea how to implement that? All comments/ideas/hints will be grateful appreciated.
Hi, Budy!
I've asked questions couple of days ago, I've got answer to question # 1, could you, please, take a look and give me some idea about question # 2. My questions are here
My Questions
Thank you in advance.
Alex Givant.
Hi, All!
Let me first explain what is a structure of our J2EE Web Application:
We have WAR file with following structure:
/web/jsp - All JSP files
/EU - End User JSP pages
/SA - System Administrator JSP pages
/WEB-INF
web.xml - Deployment descriptor
/classes - servlet + additional classes
/lib - all third-party libraries
/taglib - TLD files
Configuration files located outside of WAR file.
Application server is Tomcat 4.0.4.
Here are questions:
Question #1: How to point servlet to read configuration files from a relative path. As I mentioned we have configuration files outside of WAR file, so in our web.xml we have section for servlet which contains:
<init-param>
<param-name>AdmConf</param-name>
<param-value>ABSOLUTE_PATH_TO_CONF_FILE</param-value>
</init-param>
It's not a problem to read config file if you have an absolute path, however when I try to put relative path (such as ../../conf/config_name), it doesn't behave properly. From my search I found that the user directory is C:\WinNT\System32.
Is anyone had this kind of problem and how you solve it.

Question #2: Rigth now we're running our application from open (non WAR) mode. We've created in server.xml (Tomcat configuration file) 3 entries:
1st - points to core servlet;
2nd - points to System Administrator's entry page (JSP file);
3rd - points to End User's entry page (JSP file).
If we pack everything in WAR file, the is no problem to create 1st entry since we have web.xml which tells to application service what is name and class for servlet. Problems arise with 2nd and 3rd entry. How can we point to EU and SA JSP pages that located in WAR file?
Any comments/ideas will be appreciated.
Thank you in advance.
Alex Givant.
Thank you for response, but we need to produce distribution in ZIP format, which will be used by QA and customer.
Any other thoughts?
Alex Givant.
21 years ago
Hi, All!
I've got the problem: When I create .zip file with Ant's "zip" task, I can't open it with Winzip 6.2 (it opens all file with 0 byte length). If I try Winzip 8.0 or WinRar, everything is OK.
Does anybody have the same problem and what you did to solve it.
Thank you in advance.
Alex Givant.
21 years ago
Check which version of JDK you have on this machine.
Log4J doesn't work with JDK less than 1.2, I've got the very same problem under OS/390 + WebSphere.
Hope it'll help.
Alex.
They tell you that Log4J support JDK 1.1.x but it's not so, I have problem to run it under something lower than 1.2 because it's using JavaBeans with some definitions exist only since 1.2
Beside that it's just *excellent* product and I enjoy it a lot.
Hi, Mike!
IntelliJ IDEA is a great editor and they have
specification for next release (Ariadna) posted
on web site IntelliJ IDEA EAP, so take a look.
Now about your questions:
1) Servlet is a Java class, so you can do that
througth the class, they don't have any wizard
to support servlet creation, but you can use
Ctrl+O and Ctrl+I to override or implement methods
2) Sorry, I never used this one, so no comments.
3) When you go to "Project Properties", in "Path"
you'll see "JavaDoc API Paths", so you have
donwload it from Sun web site, open zip file and
put path here. IDEA not comming with JavaDoc.
Have a nice day and happy IDEA usage.
Alex Givant.
There is not much to set, I would suggest that you can set your
own HostnameVerifier (it's like callback that check if name of
the host in server's certificate is the same as name of host
that you connect to).
After that you just getInputStream() and getOutputStream() and
you do whatever you do with regular input/output streams.
If you want to know which cipher suite is using for connection,
call to getCipherSuite().
To get server certificates call to getServerCertificates().
That's pretty it.
If you have any other question, ask, it's always pleasure to
help.
Have a nice day.
Alex Givant.
Try IDEA from www.intellij.com. They have everything that you
need for Java development and debugging, as well as CVS and
SourceSafe support + Ant + JUnit integration.
I'm working with it more than 2 month and it's just a
pleasure.
Go to http://www.intellij.com/eap/ , register yourself and
donwload latest version, you won't regret!
Alex.
[This message has been edited by Alex Givant (edited November 29, 2001).]
[This message has been edited by Alex Givant (edited November 29, 2001).]
Hi, James!
Thank you for answer, but setSoTimeout works for socket that you
already opened. What I need to do it to try to open a socket and
if the socket cann't be open in n seconds, just exit from method.
I know that it's possible to do with thread that wait n second
and than throws some kind of exception.
I was only wondering if there is standard remedy to achive the
same goal.
Thank you.
Alex Givant.
Hi, guys.
Here is my question related to socket creation timeout. We want
to control process of socket creation and if socket hasn't been
created in timeout period just continue with the program flow.
Here I've wrote some simple program and it's shows me different
results on different platforms:


Here I'm using "10.0.10.146" as IP address of non-exist computer
When I run it on Windows 2000 - it gives me ~ 21.5 second. But
Sun Solaris - 219.5 second (x10 from Windows time).
So my question: Is any way to control that (beside creating
thread which will wait for n seconds and if socket not exists
yet will send some kind of exception)?
Any answer appriciated.
Alex.

[This message has been edited by Alex Givant (edited November 27, 2001).]