Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

swapnil dangore

Ranch Hand
+ Follow
since Jun 05, 2006
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 swapnil dangore

Hi All,
We are migrating one of our application from Webspere 5 to Webspere 6.1. I am seeing strange behaviour on Webspere 6.1 in terms of handling StaleConnection exception.

Here is the exception that I get


Below is the code for handling this


So, whenever we get above exception on Websphere 6.1 the SQLException block gets excuted. However, on Websphere 5 StaleConnection block gets executed.
Please help
11 years ago
Thanks Mark for the reply.

I tried your solution. but, even that also didn't worked for me.

IS this proble related to Websphere 6.1.

I also, have some plain JDBC code like below.



If StaleConnection occures, StaleConnection catch block does not execute on WAS6.1. Same code works on WAS5.

Could anybody tell me what I am missing. Has it to do anything with any missing JARS.
11 years ago
Hi All,
We are using Spring JDBC in our application.. We have DB2 as backend. We are using DB2 Type 4 Driver for DB communication.
Our requirement is Whenever we get Stale Connection, we should retry 3 times.. See below code that I have written.



But,to my surprise, if(dae.getCause() instanceof StaleConnectionException) always returns me false, even though the cause is com.ibm.websphere.ce.cm.StaleConnectionException.

I also tried using if(dae.getRootCause() instanceof StaleConnectionException){ .

Could anybody tell me how to deal with StaleConnectionException in Spring.
11 years ago
Hi Ranchers,
We are using DB2 type 4 driver and Spring JDBC for DB communications. We have a column "COLUMN1" defined as DECIMAL(15,2).
The Spring-defination for this column is as


After executing stored procedure, when I try to get value for "COLUMN1" from output map , it returns me "0E-8".

What is most annoying is,it returns me "0E-8" , whether column value is "0.000" or "1234.56" or "56673.67".

Bottom line is , I am always getting "0E-8".

Please, let me know if you need more input.

Thanks in advance
Hi David & Tim,
Thanks for your reply. I have solved the isuue. The issue was with JRE that I was using (IBM). I have installed JDK5 and it started working
12 years ago
Hi All,
I am getting MavenExecutionException while running package command. I am using JDK5 (Program Files\IBM\SDP\runtimes\base_v61\java\bin).
Below is the stacktrace.

+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: unknown

Reason: Failed to build model from file 'D:\ALL_WORKSPACE\AEDC MAVEN Build\MS3_Was6\MS3\pom.xml'.
Error: 'null' for project unknown


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Failed to build model from file 'D:\ALL_WORKSPACE\AEDC MAVEN Build\MS3_Was6\MS3\pom.xml'.
Error: 'null' for project unknown
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:448)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:316)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:372)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Failed to build model from file 'D:\ALL_WORKSPACE\AEDC MAVEN Build\MS3_Was6\MS3\pom.xml'.
Error: 'null' for project unknown
at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1606)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:522)
at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:216)
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:648)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:531)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:604)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:435)
... 11 more
Caused by: sun.io.MalformedInputException
at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java:262)
at sun.nio.cs.StreamDecoder$ConverterSD.convertInto(StreamDecoder.java:316)
at sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:366)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:252)
at java.io.InputStreamReader.read(InputStreamReader.java:212)
at hidden.org.codehaus.plexus.util.xml.XmlReader.read(XmlReader.java:440)
at java.io.Reader.read(Reader.java:143)
at hidden.org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:212)
at hidden.org.codehaus.plexus.util.IOUtil.toString(IOUtil.java:416)
at hidden.org.codehaus.plexus.util.IOUtil.toString(IOUtil.java:405)
at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1621)
at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1597)
... 17 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Sat May 08 18:03:02 IST 2010
[INFO] Final Memory: 2M/5M
[INFO] ------------------------------------------------------------------------
D:\ALL_WORKSPACE\AEDC MAVEN Build\MS3_Was6>


Please help.

Thanks
12 years ago
Hi All,
I am new bee in RAD/Websphere. I want to know, what are all the places,where websphere 6.1 searches for a particular class used in my application , if I choose class loader mode as "PARENT_LAST".
The first place will be in my WEB-INF/lib or jars packaged in my EAR project.
What are the rest of places, if it does not find class there.
12 years ago
Guys,
The anchor tag I used in value attribute(a href="some link".) for Javaranch, got converted to a link.
But,on my Jsp, its not rendering a link. Its simple a plain text that we use for link a href="some link".
12 years ago
Hi Ranchers,
On my jsp I am displaying a message from resource bundle. Some part of this message contains a hyperlink. Please, tell me how can use for the value in properties file.
Here is a dummy example

Message Resource:

mykey=This is swapnil guys.Want your help.Want to visit
 Javaranch.How to do?.

Jsp File:

<bean:message key="mykey"/>

Here it is getting displayed as it is, "This is swapnil guys.Want your help.Want to visit  Javaranch.How to do?."
Wherein I want a link on "Javaranch".

Help me out...
12 years ago
Hi ranchers,
I'm integrating spring with struts. But, in my Action class , I'm getting NULL ApplicationContext. Please, let me know what I'm missing.
I'm using WSAD 5.1.2. Below is the configuration+code.

13 years ago
Hi Piya,
You can not call a non-static method from a static one.The only way to do so , is to use a dot(.) on the instance and c
all the non-static method.

How did you run the code , without compiling it?
Hi Piya,
You can not call a non-static method from a static one.The only way to do so , is to use a dot(.) on the instance and c
all the non-static method.

How did you run the code , without compiling it?
Static method can be re-defined and not overriden..This is redefination of method...Only instance method can be overriden...Method() is called twice because reference type is class A
Put it in ServletContext..You will be having values untill context is destroyed/server is shutdown..
13 years ago
it dosen't throw any exception..It calls pageContext's toString() method