Ritu Bansal

Greenhorn
+ Follow
since Nov 07, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Ritu Bansal

The proxy is set up to deal with SSL...could there be any other reason?
8 years ago
I am trying to invoke a SSL webservice via a Proxy server behind a firewall. The call fails with the following exception:

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at com.sun.net.ssl.internal.ssl.InputRecord.handleUnknownRecord(InputRecord.java:523)
at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:355)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:789)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1096)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1123)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1107)
at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:186)
at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)

The webservice invocation works when the proxy is not used. Any ideas why it is failing via Proxy?
8 years ago
I am getting the following exception while trying to send an attachment email using Java mail API. The code runs locally using jetty server.

org.netbeans.modules.viewmodel.TreeModelNode@1f42ccb[Name=, displayName=e] NestedServletException org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.LinkageError: loader constraint violation: when resolving method "javax.mail.internet.MimeBodyPart.setDataHandler(Ljavax/activation/DataHandler;)V" the class loader (instance of org/mortbay/jetty/webapp/WebAppClassLoader) of the current class, org/springframework/mail/javamail/MimeMessageHelper, and the class loader (instance of org/codehaus/classworlds/RealmClassLoader) for resolved class, javax/mail/internet/MimeBodyPart, have different Class objects for the type javax/activation/DataHandler used in the signature
11 years ago

I need to populate a pop up window from a parent session and then once the pop up window is updated pass the data back to Parent session. It does not seem to work. Any ideas on how to achieve this.

Thanks in Advance.
15 years ago
JSP
I was able to get it to work. I used the following Javascript to retrieve the element. I used Prototype.js for retrieving the value of the element. var valueIsReadable = $F(strIsReadable);

for (t = 1; t < table_1.rows.length-1; t++){
var oTable = document.getElementById('oTable' + t);
if(oTable != null){
for (i = 0; i < oTable.rows.length; i++)
{
var x = t-1;
var strIsReadable = 'file['+ x + '].case[' + i + '].isReadable';
var valueIsReadable = $F(strIsReadable);
//alert(strIsReadable + ' :: ' + valueIsReadable);
if(valueIsReadable != null && valueIsReadable=='Y'){
//do something
}
}
}
}
I have a nested table inside 2 struts iterate tags and need to retrieve the value of a field 'isReadable' in Javascript.

file[0].case[0].isReadable
file[0].case[1].isReadable
file[1].case[0].isReadable
file[1].case[1].isReadable

Any suggestions? Thanks in Advance.
I modified the select line to the one below:

<html:select styleClass="ListBox" property='<%= "fileNumberBeans[" + indx + "].singleDefBeans[" + ix + "].offDetail" %>' name="ofaForm" size="1" >
15 years ago
The display works fine now but the values of the form are not getting passed when the form is submitted. I also defined the indexed properties in my Form but looks like there is something wrong over there. I am geting ArrayIndexOutOfBounds Exception.

<logic:iterate id="fileNumberBeans" scope="request" type="com.test.FileBean" name="ofaForm" property="fileNumberBeans" indexId="indx">
<logic:notEmpty name="fileNumberBeans">
<tr>
<td class="TableBorder">
<table id="<bean:write name="fileNumberBeans" />">
<logic:iterate id="offBn" name="fileNumberBeans" type="com.test.OfaSDOBean" property="singleDefBeans" indexId="ix">
<tr>
<td id="<bean:write name="offBn" />" align="left" width="310px" class="TableBorder">
<bean:define id="offDetailSelectList" name="offBn" property="offDetailSelectList" type="java.util.ArrayList" />
<html:select styleClass="ListBox" property="fileNumberBeans[indx.intValue()].offBn[ix.intValue()].offDetail" name="ofaForm" size="1" >
<htmlptions collection="offDetailSelectList" property="value" labelProperty="label" />
</html:select>
</td>
</tr>
</logic:iterate>
</table>
</td>
</tr>

</logic:notEmpty>
</logic:iterate>

Here is my indexed property defined in one of the beans:

private FileBean[] fileNumberBeans = {};

public FileBean getFileNumberBeans(int index){

if(fileNumberBeans[index]==null){
fileNumberBeans[index] = new FileBean();
}

return (FileBean) fileNumberBeans[index];
}
15 years ago
Hi, I am trying to save values of a select in a form. The select is inside 2 nested logic iterate tags. I tried implementing it way described below but I get the following exception:

Invalid indexed property 'fileNumberBeans[indx.intValue()]' on bean class 'class com.test.OfaForm' Invalid index value 'indx.intValue()''

This is what I have in my JSP:

<logic:iterate id="fileNumberBeans" scope="request" type="com.test.FileBean" name="ofaForm" property="fileNumberBeans" indexId="indx">
<logic:notEmpty name="fileNumberBeans">
<tr>
<td class="TableBorder">
<table id="<bean:write name="fileNumberBeans" />">
<logic:iterate id="offBn" name="fileNumberBeans" type="com.test.OfaSDOBean" property="singleDefBeans" indexId="ix">
<tr>
<td id="<bean:write name="offBn" />" align="left" width="310px" class="TableBorder">
<bean:define id="offDetailSelectList" name="offBn" property="offDetailSelectList" type="java.util.ArrayList" />
<html:select styleClass="ListBox" property="fileNumberBeans[indx.intValue()].offBn[ix.intValue()].offDetail" name="ofaForm" size="1" >
<htmlptions collection="offDetailSelectList" property="value" labelProperty="label" />
</html:select>
</td>
</tr>
</logic:iterate>
</table>
</td>
</tr>

</logic:notEmpty>
</logic:iterate>

Is there any alternative way of doing this? Any help on this will be greatly appreciated.

Ritu

15 years ago
Hi, I am trying to save values of a select in a form. The select is inside 2 nested logic iterate tags similar to the solution provided below. I tried implementing it the same way but I get the following exception:

Invalid indexed property 'fileNumberBeans[indx.intValue()]' on bean class 'class com.test.OfaForm' Invalid index value 'indx.intValue()''

This is what I have in my JSP:

<logic:iterate id="fileNumberBeans" scope="request" type="com.test.FileBean" name="ofaForm" property="fileNumberBeans" indexId="indx">
<logic:notEmpty name="fileNumberBeans">
<tr>
<td class="TableBorder">
<table id="<bean:write name="fileNumberBeans" />">
<logic:iterate id="offBn" name="fileNumberBeans" type="com.test.OfaSDOBean" property="singleDefBeans" indexId="ix">
<tr>
<td id="<bean:write name="offBn" />" align="left" width="310px" class="TableBorder"> 
<bean:define id="offDetailSelectList" name="offBn" property="offDetailSelectList" type="java.util.ArrayList" />
<html:select styleClass="ListBox" property="fileNumberBeans[indx.intValue()].offBn[ix.intValue()].offDetail" name="ofaForm" size="1" >
<html:options collection="offDetailSelectList" property="value" labelProperty="label" />
</html:select>
</td>
</tr>
</logic:iterate>
</table>
</td>
</tr>

</logic:notEmpty>
</logic:iterate>

Any help on this will be greatly appreciated.

Ritu
15 years ago
Thanks everyone. I have it resolved now. I noticed that only the format method produces the correct timezone based time. So I am using the date string produced by the format. If I try to parse it to get the date object, it doesn't work.
16 years ago
Thanks everyone for taking interest in my problem.

The above code looks complicated so I have tried to make it simpler below. I still need to produce a timestamp based on the timezone.

Date date = new Date();
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SS");
df.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));
Timestamp tsPST = new Timestamp(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SS").parse(df.format(date)).getTime());
System.out.println(tsPST.toString());


My local machine is in Eastern timezone and the server is in US Central time zone. I ran the same piece of code exactly at the same time on both machines and I get 2 different sets of time with an hour difference which I shouldn't. The generated timestamp (from the system out )that I get at my local machine is 2007-11-07 12:28:17.549 and at the server is 2007-11-07 11:28:17.549. The server seems to be not producing correct timestamp.

The server is running jdk 142_11. What patch should be applied to the server to reflect correct results.
16 years ago
I have a piece of code that generates timestamps based on US TimeZones such as Pacific, Central and Eastern. I get correct results when I run this code locally (EST) but get results an hour off when I run the same code on a server running in US central time. See the results below and the code that I run.

Results from running the code on Dev Server:
ts: 2007-11-05 10:39:03.19 (Default time)
tsEST: 2007-11-05 10:39:03.019 (EST based on TimeZone String America/New_York, should be 11:39)
tsCST: 2007-11-05 09:39:03.019 (Central time based on TimeZone String US/Central, should be 10:39)
tsPST: 2007-11-05 07:39:03.019 (Pacific time based on TimeZone String America/Los_Angeles, should be 8:39)

Results from running the same code on Local machine:
tsEST: 2007-11-05 11:39:01.272 (Eastern Time based on TimeZone String America/New_York)
tsCST: 2007-11-05 10:39:01.272 (Central time based on TimeZone String US/Central)
tsPST: 2007-11-05 08:39:01.272 (Pacific time based on TimeZone String America/Los_Angeles)

Below is the code that I ran.

Timestamp ts = new Timestamp(Calendar.getInstance().getTime().getTime());
DateFormat df1 = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss.SS" );

GregorianCalendar cal1 = new GregorianCalendar();
Timestamp tsNow = new Timestamp(cal1.getTimeInMillis());

TimeZone tsEST = TimeZone.getTimeZone("America/New_York");
String inPattern = "yyyy-MM-dd HH:mm:ss.SS";
DateFormat df = new SimpleDateFormat(inPattern);
df.setTimeZone(tsEST);
Date date = df.parse(tsNow.toString());
df.setTimeZone(tsEST);
ts = new Timestamp( df1.parse( df.format(date) ).getTime() );
System.out.println("tsEST: " + ts.toString());

DateFormat df2 = new SimpleDateFormat(inPattern);
TimeZone tsCST = TimeZone.getTimeZone("US/Central");
df2.setTimeZone(tsCST);
ts = new Timestamp( df1.parse( df2.format(date) ).getTime() );
System.out.println("tsCST: " + ts.toString());

TimeZone tsPST = TimeZone.getTimeZone("America/Los_Angeles");
df.setTimeZone(tsPST);
ts = new Timestamp( df1.parse( df.format(date) ).getTime() );
System.out.println("tsPST: " + ts.toString());

Can somone help me identify why the server is not producing correct time.
16 years ago