Trish Wu

Ranch Hand
+ Follow
since Oct 09, 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 Trish Wu

Hello all,
When I try to execute a java standalone program using Websphere 5.0 java executable on AIX, the program stops for no reason. When I type "java -verbose", it stops at
[Initializing java/lang/Runtime]
[Running static initializer for java/lang/Runtime]
When I press cntl-c to stop the operation, it halts at
[Running static initializer for java/lang/Shutdown]
[Loaded java.lang.Shutdown$Lock from /usr/WebSphere5/AppServer/java/jre/lib/rt.jar]
[Loading superclasses of java/lang/Shutdown$Lock]
[Preparing java/lang/Shutdown$Lock]
Do you guys know any reason behind this? And any possible solution for solving this problem?
Thanks.
20 years ago
Hello folks,
I will be working on a Websphere upgrade project (from 3.5 to 5.0).
I am wondering if you guys could show me some great books which I can find all the goodies of WAS v5.0.
Thanks!!!
20 years ago
Hi folks, please enlighten me with the meaning of bytecode verfication?
Or show me where to look for it.
Thanks!
20 years ago
IS anonymous inner class allowed in Jsp files?
Given this file a.jsp, why doesnt it work?

_a_jsp_8$1 (wrong name: _a_jsp_8)
java.lang.Exception: _a_jsp_8$1 (wrong name: _a_jsp_8)
at _a_jsp_8._jspService(_a_jsp_8.java:98)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:127)
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:396)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:718)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:885)
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:626)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:160)
at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:287)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:105)
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:360)
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:775)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:701)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:593)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:290)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:189)
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:77)
at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)
at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:106)
at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:160)
at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:300)
at com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run(SQEventListenerImp.java:230)
at com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent(SQEventListenerImp.java:104)
at com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent(SQEventSource.java:212)
at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.notifyService(SQWrapperEventSource.java:353)
at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.run(SQWrapperEventSource.java:220)
at com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run(OutOfProcThread.java:248)
at java.lang.Thread.run(Thread.java:481)
20 years ago
Generic exception is the base class for all the application exception which defines instance fields such as error code, wrapped exception.
And it is marked as checked exception.
Translator serves as getting the first hand of SQLException and determines on the situation to rethrow an application specific exception so that the facade layer can judge whether it is an error that can be retry.
In the JDBC framework, the executeQuery will have a template that looks like this:

In Translator, I will probably have

Now, my translator is bound to change the signature to "throws DataAcessException/or its subclasses.
I was just thinking, am I mixing up the Checked and Unchecked Exceptions handling here???
Or am i doing something totally wrong??
Please help
For a lot of applications, I always begin by defining a generic exception object so that other application specific exceptions can be extended from it. And that generic exception defines fields that are common to all subclasses.
However, at the same time, I want to develop a jdbc /data acess framework that eliminate the code duplication of getting connection, closing statements/resultset and connection.
This framework can also provide users to plug in a exception Translator class that convert/wrap the SQLException to a more application specific exception object.
But if my JDBC framework provides a method that looks like this:

Now, I have doubts in defining the Translator class, as the Translator will rethrow the exception within the runQuery method. As a result, it is bound to throwing only DataAccessException or its subclasses. Then my Translator is in effect becomes meaningless.
Since there is no multiple inheritance in Java, my application specific exceptions object can no longer extends from the generic exception object that I have mentioned in the first paragraph.
Am I doing something wrong??? Please help.
You can find useful info from this whitepaper
Quoting from :
WebSphere connection pool

ORPHAN_TIMEOUT - The number of seconds that an application is allowed to hold an
inactive connection. The default is 1800 seconds (30 minutes). Any non-negative integer
is a valid value. If there is no activity on an allocated connection for longer than the
ORPHAN_TIMEOUT number of seconds, the connection is marked for orphaning. After
another ORPHAN_TIMEOUT number of seconds, if the connection still has no activity,
the connection is returned to the pool. If the application tries to use the connection again,
it is thrown a StaleConnectionException. Connections that are enlisted in a transaction
are not orphaned. Setting this value to 0 disables the orphan timeout.

21 years ago
You can also try and use Jakarta POI.
21 years ago
Thanks, Kyle.
If I put that wrapper class as well as all the other beans stuff in a single ejb-jar file, it should be loaded with one classloader.
Quoted from: Wesbphere 3.5 system admin manual

JARClassLoader. There is one instance of it for each application server accessible through the EJBJARManager.

I need to write a few session beans that resides on two different VM's and I am using WebSphere 3.5.4 and EJB1.0. I am faced with the problem of loading up a connection pool for middleware integradtion. Since I only want to load the pool up once per VM (under the condition of not allowing to write a servlet to do the job), is it possible to have a wrapper class that is GOF Singleton designed , which loads up the pool in its private constructor. So that the pool should only be loaded once per JVM.
Is this a bad practise??
Hello folks,
I have a question regarding Websphere 3.5. I am currently developing a few stateless session beans for my client.
All these session beans need to connect to a middleware for accessing some mainframes' data.
The middleware comes with a connection pool, the problem I have is that I cant preload the connection pool once only for each vm without
writing a servlet and do the loading in the "init()" method.
Do you guys have any other good ideas for preloading resources for Stateless Session beans?
Thanks.
21 years ago
Thank you Jim and Micheal for your advice.
So I will have to assume certain rows of data are SJIS encoded while some other are IS08859_1, do the conversion and then tell my clients to verify with their own eyes.
21 years ago
Thanks for your reply, Michael.
I am doing this encoding conversion so that my client can upgrade to a newer version content management system which only capable of interpreting UTF8 data.
Actually, the Japanese (SJIS) to UTF8 conversion works fine. My problem is how to determine the data is originally SJIS encoded from the byte array. Because there isa lot of data and it is very hard for me to find out which is Chinese/Japanese/Korean encoded..
21 years ago
Hello folks,
I have a problem with converting data to UTF-8.
My task involves a Oracle database table with a long field.
First of all, the data in this table can be Chinese/Japanese/English/Korean encoded.
So when I retrieve the data, I will need to invoke:

where rs is java.sql.ResultSet
Then I will need to store the utf8 String to a new database table.
Since the default encoding is "ISO8859_1" and that I have no idea whether the data is
Chinese/Japanese/English/Korean encoded, how can I make the proper conversion?
Since the data is in Long Field and I will have to use getBytes() to get the data and
convert it to the local encoding.
So I am asking if there is any way that I can determine what these bytes'
original encoding was?
Is there anything in Character class that I can make use of??
Pls help.
21 years ago
Sounds like a must for singleton with Data object.
But one thing i am not sure is that, how do u guys make sure each client can only unlock its own lock without keeping the state in the Data object and changing the lock and unlock method signature??