Win a copy of Head First Android this week in the Android forum!

Jayakumar Gopalan

+ Follow
since Jan 27, 2001
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jayakumar Gopalan

Is there any good materials (docs, examples etc.) about Interceptor patterns apart from POSA site and TomcatBook (from
Thanks in advance.
Hi all,
While lookingup EJB from JSP, I am getting the ClassCastException. I am using Sun ONE Application server 7.0 on Win2K machine with JDK1.4. The web module and ejb module are deployed separately as war and jar (not as ear).
Below is my part of code
InitialContext context = null;
context = new InitialContext();
Object homeObj = context.lookup("java:comp/env/ejb/Gateway");

GatewayHome gatewayHome = (GatewayHome) javax.rmi.PortableRemoteObject.narrow(homeObj, GatewayHome.class);

Gateway gateway = gatewayHome.create();

msg = gateway.process();

} catch( Exception ex )
And below is the exception i am getting
[07/Nov/2002:20:13:41] INFO ( 1784): CORE3282: stdout: hObj =$1
[07/Nov/2002:20:13:41] INFO ( 1784): CORE3282: stdout: Exception$1
[07/Nov/2002:20:13:41] WARNING ( 1784): CORE3283: stderr: java.lang.ClassCastException:$1
[07/Nov/2002:20:13:41] WARNING ( 1784): CORE3283: stderr: at _jasper._MyTest_jsp._jspService(
[07/Nov/2002:20:13:41] WARNING ( 1784): CORE3283: stderr: at org.apache.jasper.runtime.HttpJspBase.service(
[07/Nov/2002:20:13:41] WARNING ( 1784): CORE3283: stderr: at javax.servlet.http.HttpServlet.service(
[07/Nov/2002:20:13:41] WARNING ( 1784): CORE3283: stderr: at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(

Can anybody help me.
Thanks in advance.
Cany anybody help me. Where to place the thiry party packages in Weblogic 6.0? I am having 20 beans which access these third party packages which is more than 5MB in size. I want to place this packages so that all my beans will use it.
20 years ago
Hi Sumit vashishta!
Whether it is servlets or JSP, ultimately HTML is going to be displayed in the browser. Once a page is displayed, by default browser will cache the page and its content. So, if the user click on the back button etc. to go to the previous page, browser will display the previous cached page without going contacting the server for the page content. So it is NOT possible (anyone correct me if I am wrong) to prevent the browser to show the previous page with the help of JAVA. So you have to rely on JavaScript only.
However, if you set the expiration of the page to zero, then browser will not cache the page and contacts the server to get the page content. So at this point of time, you can have some session objects to store the visited pages and prevent him to see the previous page.
Any comments ...
20 years ago
Hi sumit vashishta!
Try this:
<script language='JavaScript'>window.history.forward(1);</script>");
out.println(" .......... </head><body> .......... </body></html>");
Hope this will help you.
20 years ago
Hi Florence,
Include jbosssx-client.jar (which is in the jboss/client directory), in the classpath.
20 years ago
Hi Pankaj,
it seems you have not imported java.util.Collection. try importing it and compile then.
Hi Prabhu Vastrad,
Thanks for your interest to shed some light on my problem. I am using Oracle as my backend. If you know any sample code of how to put the messages in the queue from Oracle trigger, can you please point me to those urls.
Thanks in advance.
Mike Curwen,
Thanks for your interest response. I will explain my problem in detail so that you can get the background of it. I am having a client (JSP) which will display some data from the database and it has to be updated as soon as the data is changed in the database. The changing of data in the database table, may happen at any time. So it is not possible to keep on pooling the database for changes. If some changes happened in the database, a trigger will be fired and I want to know how to catch that changes by some way (may be put that to a queue/topic) and give that changed data it to EJB (Message Driven Bean can take that).
If anybody have any idea of how to do this, please reply.
Thanks in advance.

Originally posted by Mike Curwen:
EJB's always perform ejbLoad before the execution of a transactional business method, and always call ejbStore after the method completes.

So if your database has changed in the meantime, it doesn't matter that the bean is not immediately refreshed, since it is guaranteed to be fresh when it's really needed.

Also - and I haven't confirmed it... but I understand that the container will know when you have deleted rows from the database, and it will unload the corresponding EJB's. I would assume it would do this when an attempt is made to findByPrimaryKey, but I'm not sure.

How to notify the EJB when some datas are being inserted or updated into the database table? I wrote a trigger to fire when there is some changes in the table, but I don't know how to notify EJB? Is it possible by some means that the trigger will create or put in to the particular queue/topic so that I can use the Message Driven Beans to receive it? If yes, how? Can any one please help me on this issue. Any pointers related to this or any sample codes will be of great help to me?
Thanks in advance!
I know how to convert the Document to string i.e. like this
Document doc = ....
org.apache.crimson.tree.XmlDocument xmlDoc = (XmlDocument) doc;
String xmlString = xmlDoc.toString();
I want to how to convert the string which contains the valid xml content (in this case xmlString) to form DOM Document.
Please help.
It is because we can't use IO streams in EJB and it is not my design decision.
Hi Ajith Kallambella!
I can't use InputStream or InputSource, because we can't use IO packages in EJB applications. Regarding the String parameter, that string is the URI not the xml string. Am I correct? If not correct me. And any alternate ways please.

Originally posted by Ajith Kallambella:
This is hardly a problem. Almost all the parsers has overloaded parse methods that take InputStream, InputSource and String as arguments. You can use any of these.
Checkout the parser documentation to see what flavours of parse methods are available...

Hi All,
While trying to pass XML Document from one EJB to another EJB, I got NotSerializableException? Later I found that org.w3c.dom.Document is not serializable. Then I thought I can convert the xml to string and pass it. But I couldn't find any API's for directly parsing the xml string (I am using JAXP). Since it is not possible to use IO classess in EJB, can anybody suggest me any alternatet ways to do this.
Thanks in advance.
Hi narenkumar!
I have to use JAXP or anyother java based parser because I am working in EJB applications. Can you please suggest me any other java based parser. And one thing I am wondering, why the org.w3c.dom.Document is not made as serializable.?

Originally posted by narenkumar:
use microsoft's DOM parser, which is inbuilt in IE 5.x
u should achieve it easily