francisk

Greenhorn
+ Follow
since Feb 18, 2002
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 francisk

I just pick up the log4J last week. So I have not much idea of this thing work. As far as I know is when I want to use a config file to control the logging, I need to call a static method PropertyConfigurator.config(String fileName) after I obtain a Logger instance. However I am quite confuse about that, since in my project there are other resource code (jar file) already using log4J for doing logging and it is using a.property file for doing configuration. And now I need to log my part and using b.property, and the logging part is within a thread. So I am wondering when PropertyConfigurator was being called in two different places and with two different property files, will that mess up the logger configuration. I am confuse of how the PropertyConfigurator works, since I am not passing an instance in to the configurator for doing configuration, and it sounds scary that the Logger may not using the configuration that I specified in my property file. Anyone can explain how PropertyConfigurator work. Thanks.
Yes, you can name it to be appender1 or what ever you like. It is just an identifer for the appender.
So I can do something like.

log4j.rootCategory=INFO, appender1
log4j.appender.appender1=org.apache.log4j.RollingFileAppender
log4j.appender.appender1.MaxFileSize=5MB
log4j.appender.appender1.MaxBackupIndex=1
log4j.appender.appender1.File=/local/pkg/logs/test.log
log4j.appender.appender1.Append=true
log4j.appender.appender1.layout=org.apache.log4j.PatternLayout
log4j.appender.appender1.layout.ConversionPattern=%d{yyyy.MM.dd, HH:mm:ss} - %m%n
1. A
Because it said HttpServlet class. If it said ServletRequest, I will pick B. getParameter()
2. A, B
When the deployment descriptor file have specified <load-on-startup>, it will load when web server start, otherwise it will load when the first request comming in.
3. A
Hi,
First, let say about the back ground. I have written an application using the URL class to call an servlet that reside in a cluster (2) of WebSphere servers with a load balancer to distribute jobs between servers. Now I have a problem when my application try to call the servlet application, it turn out both servlet in each server get response and taking process, but I just need it to process once not twice. I don't know why that happen, is it the problem of the load balancer distribute job to both server or the http protocol firing twice from my remote application because it get no response from the 1st http request or is there any other reason? Is there any way to prevent this kind of action? Thanks!
Francis Kwok
Oops...
here is the class path
classpath=;C:\IBMCON~1\CICS\Classes\CTGCLI~1.JAR;C:\IBM Connectors\classes;;.
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=FRANCIS-KWOK
ComSpec=C:\WINNT\system32\cmd.exe
I got your book, let me take a look first. But is there any difference between connecting to EJB and rmi remote object? Because I tried to solve this problem using a stateless session bean and it can successfully run under the JDK1.2.2, but on the other hand when I run the rmi remote method, it just give me that MarshelException. Anyway, I will take a look on your book first. Thanks!
22 years ago
I found out that I am using a different ver. of JDK than the WAS 3.5 using. So I tried it with the same ver. of JDK, this time, no more exception from creating the initialContext. Now it can look up to the object, but when I tried to execute the remote method. It throw a MarshalException... not sure what it is, I can give more detail later. Anyone know what that exception mean?
Francis Kwok
22 years ago
Kyle,
Here is the classpath in the DOS env.
C:\>set
ALLUSERSPROFILE=C:\Documents and Settings\All Users
classpath=;%CLASSPATH%;.
CommonProgramFiles=C:\Program Files\Common Files
ComSpec=C:\WINNT\system32\cmd.exe
EXT=
FILE_SERVER=WEAAPPS1
HOMEDRIVE=C:
HOMEPATH=\
IMNINST=help
IMNINSTSRV=C:\IMNnq_NT
include=;%INCLUDE%;.
lib=;%LIB%;.
maprootoff=1
NLSPATH=C:\IBM Connectors\Encina\%L\%N
NUMBER_OF_PROCESSORS=1
NWLANGUAGE=English
OS=Windows_NT
Os2LibPath=C:\WINNT\system32\os2\dll;
Path=;C:\IBMCON~1\CICS\BIN;;C:\IBM Connectors\Encina\bin;;C:\WINNT\system32;C:\W
INNT;C:\WINNT\System32\Wbem;C:\WINNT\system32\nls;C:\WINNT\system32\nls\English;
C:\PROGRA~1\IBM\CLIENT~1;C:\PROGRA~1\IBM\CLIENT~1\Shared;C:\PROGRA~1\IBM\CLIENT~
1\Emulator;;C:\IMNnq_NT;Z:.
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 8 Stepping 6, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0806
ProgramFiles=C:\Program Files
PROMPT=$P$G
SystemDrive=C:
SystemRoot=C:\WINNT
windir=C:\WINNT
Here is my testing sequence.
Also I am using VA-Java ver. 3.5 and when I run the code out side of VAJ, I export it to c:\temp
dir
1.
naming server: tnameserv (from JDK1.3.1)
ContextFactory: com.sun.jndi.cosnaming.CNCtxFactory
Client: localhost (my workstation) in DOS env.
Server: localhost (my workstation) in DOS env.
result: success, without any problem
2.
naming server: WAS 3.5 naming server
ContextFactory: com.ibm.ejs.ns.jndi.CNInitialContextFactory
Client: (my workstation) inside VA-Java env.
Server: WAS 3.5 server
result: success, without any problem
3.
naming server: WAS 3.5 naming server
ContextFactory: com.ibm.ejs.ns.jndi.CNInitialContextFactory
Client: (my workstation) in DOS env.
Server: WAS 3.5 server
result: the problem describe above.
do I need to add extra class path?
Francis Kwok
22 years ago
I am coding an application that are using rmi-iiop, and using the Websphere naming server in WAS 3.5. After I installed the remote implementation code to the server, I test the client code from VA-Java, every things working fine. But when I export the client code to the jdk1.3.1 environment, it cannot able to look up the server and throw an exception like this...
javax.naming.NamingException: Error during resolve. Root exception is
java.lang.NullPointerException
at com.ibm.ejs.ns.jndi.CNContextImpl.doLookup(CNContextImpl.java:726)
at com.ibm.ejs.ns.jndi.CNContextImpl.lookup(CNContextImpl.java:584)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.wea.leave.system.ListenerRunnerClient.main(ListenerRunnerClient.java:50)
Error during resolve
null
java.lang.NullPointerException
also I am using com.ibm.ejs.ns.jndi.CNInitialContextFactory. I have no idea why everythings working in VA-java env. but not working when I am just using the JDK. I really need to app to run in the JDK env. Am I missing any configuration need to be set before I run it in the command prompt? Thanks for any advice.
Francis Kwok
hwkwok@chorus.net
[ February 18, 2002: Message edited by: francisk ]
22 years ago