Rajesh Kumar Swain

Greenhorn
+ Follow
since Apr 01, 2007
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 Rajesh Kumar Swain

Hi,

anyone help me in following area:

I am having below exception while sending mails even there is no attachment and email size is in KBs.

MessagingException Caught:
javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: 552 Error: message too large

at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
at sun.reflect.GeneratedMethodAccessor193.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.savvion.sbm.bizlogic.server.EPManager.p(EPManager.java:1005)
at com.savvion.sbm.bizlogic.server.EPManager.b(EPManager.java:471)
at com.savvion.sbm.bizlogic.server.EPManager.processAdapter(EPManager.java:425)
at com.savvion.sbm.bizlogic.server.AdapterRunner.a(AdapterRunner.java:139)
at com.savvion.sbm.bizlogic.server.AdapterRunner.executeUsingUT(AdapterRunner.java:73)
at com.savvion.sbm.bizlogic.server.ejb.BLAdapterMDB.onMessage(BLAdapterMDB.java:68)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:400)
at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:333)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:298)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2686)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2598)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
16 years ago
Thanks for your suggetion.
I got the answer.But Now I am facing problem in reading the null value as follows

jitu||9871162097

It's giving 2 tokens. But as per myrequirement it should give me 3 tokens as follows

1.jitu
2.
3.9871162097

can anyone suggest anything
16 years ago
Hi,

I have a flat file and I want to covert it to XML file by reading it and that flat is with |(pipeline as separator) content of the flat file is as follows

NAME|ADDRESS|MOBILE
rajesh|puri|9873930665
padu|cuttack|9910108576


and the required XML Format is


<DETAILS COUNT='1'>
<NAME>rajesh</NAME>
<ADDRESS>puri</ADDRESS>
<MOBILE>9873930665</MOBILE>
</DETAILS>
<DETAILS COUNT='2'>
<NAME>padu</NAME>
<ADDRESS>cuttack</ADDRESS>
<MOBILE>9910108576</MOBILE>
</DETAILS>

Thanks in advance

Rajesh
16 years ago
Yes I need to know the answer.
16 years ago
Hi,

I want to put data in application scope in hashmap form. The count would be 50 hashmaps having 500 key-value pairs in each and planning to run JVM via 1.4 GB . Is there any limitation for this scenario. If anyone can help me out.
16 years ago
Hi,

I have an issue regarding timezone as follows can anyone help me out.

suppose my database server is iin MST timezone, my application is to be shared across the globe. I want to show the time according to the respective time zone.

Is it possible to have generic method to change time zone by simple passing the offset.

Rajesh
16 years ago
Hi James,

Thanks a lot for your help.

I have tried in the way you suggested . Now It's working fine.


Regards
Rajesh
16 years ago
Hi,

I want to update any text file by simple replacing one line with another new line. Currently I am using MappedByteBuffer to do the task.

If the replaced line and replacing line are of same length then it is working fine.

But if the length is different then It is disturbing the next line.Which I do not want.

So can anyone suggest some thing so that I can do the above task without affecting any line(previos or next).

Thanks
16 years ago
Please help me it is very urgent, i am using the below code which is not working in some cases..

Date l_currentDate = new Date();
System.out.println(l_currentDate.getDate()-1);
SimpleDateFormat l_sfCSVDateName = new SimpleDateFormat("yyyyMMM");
String formatedCurrentDate=l_sfCSVDateName.format(l_currentDate); System.out.println("formatedCurrentDate--"+formatedCurrentDate+(l_currentDate.getDate()-1));

Let say current date is 01/05/2007. Then it will return 2005May0.
And i need 2005Apr30.

Please help.
Thanks in advance
Rajesh Swain.
16 years ago
Thanks satish I got the solution.

what I was tryng is :-

List allNodes = document.selectNodes("Products/Product/DataSource");
//Node individual = (Node) itrNodes.next();
Element individual_1 = (Element) itrNodes.next();

INstead of element I was trying to type cast it to Node that's why I was not getting the getAttributeValue().

Now It has been solved.

Regards
Rajesh
16 years ago
HI,

if your concern is to read the content of column which datatype is BLOB,you may try the following code.

byte[] eventBytes = rs.getBytes("context_obj");
java.io.ObjectInputStream s = new java.io.ObjectInputStream(new java.io.ByteArrayInputStream(b));
Object obj = s.readObject();
System.out.println("Context_obj :"+obj);

You can cast that object to HashMap or Hashtable or any class.

Rajesh
16 years ago

Originally posted by satsranchuser:
Any particular reason that you are not using API's like JDOM. They have good coverage for parsing various components of XML string.



Yes I am bound to USe sax parser as The XML file is of size around some 100 MB. So If I will use DOM then it may give OutOfMemory Error.
So please suggest what to do ?

I need some sample code for that.

Thanks
16 years ago
HI,

I am trying to parse an XML File some of lines are as follows

<Column Name="PROD_LINE_NAME">REFRIGERATOR</Column>
<Column Name="FINAL_PRD_DATE">2006-05-16</Column>
<Column Name="RELEASE_CODE">V</Column>

If I am using DOM Parser then It is not a problem for me.
But The XML File is very large in size, so in that case I do not think that it will be wise to use DOM Parser.
So I am trying to use SAX Parser.

BY using SAX, I am able to read the value of the element like :- REFRIGERATOR,2006-05-16,V
But I am unable to read th value of those attribute like :- PROD_LINE_NAME,FINAL_PRD_DATE,RELEASE_CODE

Some code snippet is as follows :-

document = new SAXReader.read(xmlFile);
List allNodes = document.selectNodes("Column");
Iterator itrNodes = allNodes.iterator();
while (itrNodes.hasNext()) {
Node individual = (Node) itrNodes.next();
System.out.println("Nodes are "+individual.getStringValue());
}

So can anyone help me regarding this.

Thanks and Regards
Rajesh Swain
16 years ago
hey you all,

I just want the conclusion. I am also getting confused after getting different suggestions from different people. Can any one drive me in a right direction.

Thanks to all

Rajesh
16 years ago
hey Campbell,

I have tried 10 times repeatedly but I have not marked any such difference
as I have got the result as follows.

. Increment is always faster than decrement.
. Yes if the time for increment increses(i.e from 2000 ms to 3000 ms) time for decrement also increses approximately in the same ratio.


But according to you time varies sometimes increment is faster and sometimes decrement is faster.

I just want to know is there any reason other than console I/O explained by
Peter Chase.

Thanks Campbell for your valuable time.
16 years ago