ganesh pol

Ranch Hand
+ Follow
since Apr 29, 2005
Merit badge: grant badges
For More
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 ganesh pol


I want to use hibernate with JTA transaction in weblogic application server
where my service layer is designed in pojo and wants to handle programmetic JTA transactions

my configuration file for hibernate is

for above config file i got messages on my server console as

18:22:41,432 INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions)18:22:41,448 INFO TransactionManagerLookupFactory:38 - instantiating TransactionManagerLookup: org.hibernate.trans
18:22:41,464 INFO TransactionManagerLookupFactory:42 - instantiated TransactionManagerLookup

looking for earliest response from your end
[ August 06, 2008: Message edited by: ganesh pol ]
i am facing some problem while uploading multiple files

attributes in my form bean
private Collection carImages;
//getters and setters

i tried with FormFile array , also with ArrayList but it throws me following exception

java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(
at org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(
at org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(
at org.apache.commons.beanutils.PropertyUtilsBean.setProperty(
at org.apache.commons.beanutils.BeanUtilsBean.setProperty(
at org.apache.commons.beanutils.BeanUtilsBean.populate(
at org.apache.commons.beanutils.BeanUtils.populate(

i tried to post my jsp code but it creates problem while posting hence

view related code is at this

looking for earliest help
[ November 26, 2007: Message edited by: ganesh pol ]
16 years ago
i want to load page as follows

var frame = document.createElement('iframe');
frame.src = "/birthDayReminder/search.htm";

here i am giving context name as hard coded value

is there any way to get this context name dynamically

some work around in java is
1] define hidden variable like
<input type="hidden" id="contextName" value="<%=request.getContextPath()%>">

2] access this variable in java script as follows
var contextName=document.getElementById("contextName");frame.src = contextName.value+"/search.htm";
[ October 29, 2007: Message edited by: ganesh pol ]
16 years ago
Thanks for both of your reply

some more questions comes in my mind

consider following use case

1] user logged in
my login controller or service object will use following business logic when user is authenticates
i]when username password provided by user matche with any record in my user table i will keep that record in HttpSession in some value object
ii]i am updating flag for user record that he/she logged in and updating his last logged in time

now consider following 2 scenarios
2.1]user is using my application and then he clicks logged out
i] in my logout service or controller i will update flag for user record that he has logged out
ii]i will terminates user's HttpSession object
here we get success as we expect

2.2]user started application and browser is idle for long time
i]session get terminated
imp note i observed one thing although my session is terminated HttpSession object is not null

is there is any way that when server terminates user's session how to update this user is logged out

i.e. is there is any way that when server wants to terminate user session my code will intercept and updates is logged out flag in database

[ October 01, 2007: Message edited by: ganesh pol ]
16 years ago
while accessing my net banking account
i observed one nice thing
once by mistake i close the net banking window without logout(i know this is not nice thing)

i tried to login again after somewhere around 2 min in that case my net banking application gives me message like your last logging is not properly terminated
and make me unable to access system.

i am not the hardcore client side developer but this thing increase my curiosity how to implement this logic in some simple application

can any one give me some kind of hint to solve this issue

how could it possible for my server side code that some one closed window without logout

[ September 29, 2007: Message edited by: ganesh pol ]
[ September 29, 2007: Message edited by: ganesh pol ]
16 years ago
hi ,

i am using
bea weblogic 8.1
servlet specifications 2.3
and struts

Following JSP works fine in Apache Tomcat 5.5.23 and JBOSS
application server 4.2

<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>


<html:form action="/login">
<table align="center" width="50%">
<table align="center" width="50%">
User Name
<html:text property="userName" value="" />
<html assword property="password" value=""/>
<table align="center" width="50%">
<tr align="center" width="50%">
<td align="center" width=25%>
<input type="submit" value="login"/>

similarly web.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "">








but when i deployed this application on bea weblogic 8.1
weblogic console gives me following exception

<May 16, 2007 6:17:58 PM IST> <Warning> <HTTP> <BEA-101248> <[C:\bea\user_projects\domains\mydomain\sc.war]: Deployment descriptor
"web.xml" is malformed. Check against the DTD: org.xml.sax.SAXParseException: The content of element type "web-app" must match "(
ecurity-role*,env-entry*,ejb-ref*,ejb-local-ref*)". (line 44, column 11).>

<May 16, 2007 6:17:58 PM IST> <Warning> <HTTP> <BEA-101247> <C:\bea\user_projects\domains\mydomain\lesson1.war: Public ID referenc
es the old version of the Servlet DTD. You must change the public ID in web.xml file to "-//Sun Microsystems, Inc.//DTD Web Applic
ation 2.3//EN".>
<May 16, 2007 6:17:58 PM IST> <Warning> <HTTP> <BEA-101248> <[C:\bea\user_projects\domains\mydomain\lesson1.war]: Deployment descr
iptor "web.xml" is malformed. Check against the DTD: org.xml.sax.SAXParseException: The content of element type "web-app" must mat
ch "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,se
ig?,security-role*,env-entry*,ejb-ref*)". (line 19, column 11).>
log4j:WARN No appenders could be found for logger (org.apache.struts.util.PropertyMessageResources).
log4j:WARN Please initialize the log4j system properly.
<May 16, 2007 6:17:58 PM IST> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "myserver" for domain "mydomai
n" running in Development Mode>
<May 16, 2007 6:17:58 PM IST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
<May 16, 2007 6:17:58 PM IST> <Notice> <WebLogicServer> <BEA-000355> <Thread "ListenThread.Default" listening on port 7001, ip add
ress *.*>
<May 16, 2007 6:19:12 PM IST> <Error> <HTTP> <BEA-101020> <[ServletContext(id=14763676,name=sc,context-path=/sc)] Servlet failed w
ith Exception
weblogic.servlet.jsp.JspException: (line 1): Error in using tag library uri='/WEB-INF/tld/struts-bean.tld' prefix='bean': The Tag
class 'org.apache.struts.taglib.bean.IncludeTag' has no setter method corresponding to TLD declared attribute 'name', (JSP 1.1 spe
c, 5.4.1)
at weblogic.servlet.jsp.StandardTagLib.tld_jspException(

at weblogic.servlet.jsp.StandardTagLib.parseTagDD(
at weblogic.servlet.jsp.StandardTagLib.parseDD(
at weblogic.servlet.jsp.StandardTagLib.<init>(
at weblogic.servlet.jsp.TagLibHelper.loadTagLib(
at weblogic.servlet.jsp.JspLexer.loadTagLib(
at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE_BODY(
at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE(
at weblogic.servlet.jsp.JspLexer.mDIRECTIVE(
at weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(
at weblogic.servlet.jsp.JspLexer.mTOKEN(
at weblogic.servlet.jsp.JspLexer.nextToken(
at weblogic.servlet.jsp.JspLexer.parse(
at weblogic.servlet.jsp.JspParser.doit(
at weblogic.servlet.jsp.JspParser.parse(
at weblogic.servlet.jsp.Jsp2Java.outputs(
at weblogic.utils.compiler.CodeGenerator.generate(
at weblogic.servlet.jsp.JspStub.compilePage(
at weblogic.servlet.jsp.JspStub.prepareServlet(
at weblogic.servlet.jsp.JspStub.prepareServlet(
at weblogic.servlet.internal.ServletStubImpl.getServlet(
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(
at weblogic.servlet.internal.WebAppServletContext$
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(
at weblogic.servlet.internal.ServletRequestImpl.execute(
at weblogic.kernel.ExecuteThread.execute(

can any one give me solution for it
[ May 16, 2007: Message edited by: ganesh pol ]
16 years ago
I am new to web servcies .
On the net i found various implementaions
of ESB(Enterprise service bus) such as Open ESB(sun's implementaion),Service Mix(apache's implementaion)
how should i compare these various ESBs which are using JBI (Java Business Integration)
I have'nt find proper section on java ranch for JBI or ESB hence i am posting this message here since these technologies are related to web services
[ May 03, 2007: Message edited by: ganesh pol ]
16 years ago
Hay... someone should give answer to it
I am searching for it from last 2 days on web also
16 years ago
Hi All,
I am new to portals and experimenting with available portlets

I want to know what is subtle difference between local and remote preference

The idea behind asking this question is as follows

1] i got success in configuring my wsrp proxy with edit Local Preferences
as steps explained in this url

2] now i tried following to access remote portlet
2.1] started second instance of liferay on other machine
in this case this other machine will act as producer
and my machine will act as consumer

2.2] through browser i just call my machine
and added wsrp proxy content to my page

2.3] now page shows me 2 links
edit local preferences
and edit remote preferences

2.4]since i want to access portlet running on other machine
i click edit remote preferences
i got error message like
Portlet is temporarily unavailable

2.5] so i moved back to same page which shows me two links
edit local preferences
and edit remote preferences

2.6] and clicked on edit local preferences
at this time i got proper window
here i just change
where ps2740 is machine name on which 2nd instance of liferay is running
now my question is that how to call remote preferences
[ April 25, 2007: Message edited by: ganesh pol ]
16 years ago
This is one of the main issue in designing the javascript.
i want to know is it possible for me to check if client's browser support javascript
i am having requiremnt for getting id value of my html element

<th id="test1" width="5%">Attempted RRC Connection</th>

in above case test1 is value of my th element
how should i get it using javascript
following is part of my code for creating JAR File

public class JarFileManager {

public JarFileManager() {
// TODO Auto-generated constructor stub

public static JarOutputStream getJarOutPutStream(String fileLocation){
JarOutputStream jarOutPutStream=null;
jarOutPutStream=new JarOutputStream(new FileOutputStream(fileLocation));
}catch(IOException ioException){
return jarOutPutStream;

public static void createJarFile()throws Exception{
String directoryLocation="/home/g.pol/projects/practice/binaryTransfer/classes";
String outFileLocation="/home/g.pol/Desktop/Out.jar";
JarOutputStream jarOutPutStream=getJarOutPutStream(outFileLocation);

FileInputStream in = new FileInputStream(directoryLocation);

* @param args
public static void main(String[] args)throws Exception {


initially i was just thinking that if we provide directory location then java code will create jar with all the folders beloow that directory

but i got following exception i know this is not correct way to create FileInputStream for directory
bu how should i create jar which contains my packages
Exception in thread "main" /home/g.pol/projects/practice/binaryTransfer/classes (Is a directory)
at Method)
at JarFileManager.createJarFile(
at JarFileManager.main(

my question is that how to create jar file if i know that at

i have all my .class files in package struture
17 years ago
Dear friends,
i want some hint if i have diffenet images files of type .jpeg, bmp etc then can any one tell me how should i convert it to .png file
i searched the java api but i did not got any clue
similarly i have requirement for conversion of audio files to .midi format
and video files to .3gp format can any one send me java code or link to write such type of conversion code
it would be great help to me
17 years ago
This is reply to my post

now my code works fine

i have made some changes in my jsp code which my tagLibs Guru Mahesh has explained me some time before

String requestURI="request.getContextPath()/a.c";

<display:table name="users"
<display:column title="Record Number" headerClass="th1" class="cellText">
<display:column property="firstName" title="firstName" maxLength="10" headerClass="th1" class="cellText" />
<display:column property="middleName" headerClass="th1" class="cellText"/>
<display:column property="lastName" headerClass="th1" class="cellText"/>
<display:column property="email" headerClass="th1" class="cellText"/>
<display:column property="age" headerClass="th1" class="cellText"/>
<display:column property="dateOfJoin" headerClass="th1" class="cellText"/>
<display:setProperty name="paging.banner.placement" value="bottom" />

where requestURI is nothing but my controllers url mapping

which i did in web.xml as


a.c is url mapping of my controller from where i got list
[ November 24, 2006: Message edited by: ganesh pol ]
17 years ago
you can use display tag libs

we can do pagination in jsp with help of it
[ November 24, 2006: Message edited by: ganesh pol ]
17 years ago