murali jackson

Ranch Hand
+ Follow
since Nov 18, 2013
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 murali jackson

Campbell Ritchie wrote:Welcome to the Ranch

That looks as if you were trying to organise an implementation before you have the specification (what you want to do). How would you determine whether a website is up without a specific app? Is that consistent between different sites? How would you log in by hand? Follow all the steps and write them down; if you have that sort of instruction, you will have a chance of implementing it.

Hi Ritchie / Tim,

Thanks for your response and suggestions !!!
I am checking HTMLUnit API.

Please let me put what Im expecting in a little bit more detail.

I have a below URL in my environment. (internal web site)

When I hit the URL, I get a login page for username and password.
When i enter the creds and submit, the website successfully takes me to the home page.
Sometimes when I log in, it shows webpage not found or internal error occurred message.

What I wanted to achieve is to write a java stand alone java program which logs in the same page and see if it successfully receives the home page.
In case of success, nothing happens. If it receives error, I want to trigger an email ( this emailing piece, I already know how to do) to my team saying that the site is down , take appropriate action kind of message.

This is the only site i want to monitor and this is kind of a value add I am planning to implement for my team which will be really helpful.

Please advise. Thanks !!!

2 years ago

Piet Souris wrote:hi Murali,
Now, what happens if 'this.State' does not contain "All", but 'o.State' does? What is returned and what should be returned? And, likewise, what is returned when 'this.State' contains "All", but 'o.State' does not?

Hi Piet Souris,

Thanks for your response.

For both of your questions, I have kept or conditions right in my If Statement ?
So for both of the conditions mentioned your question my program is going to return 0 which means state 'All' is going to get sorted first (atleast thats what I understood after reading the concept of sorting).

Please correct me if im wrong. Thanks !!!
3 years ago
Hi All,

I am trying to learn Comparator in java but somehow I am not getting the desired output which Im expecting.
I have a below list of objects.

I want to sort this arraylist of objects based on below conditions.

1. Objects having State as "ALL" should be sorted first.
2. After the first sorting, it should be followed by other states as per alphabetical order.
3.If second condition has same state value, then it should compare the favorite String.

But my output is different. Please help me on this.

3 years ago

Norm Radder wrote:What is all this after the name of the class file?

Classfile com.devguerrilla.qui

Did you try:
javap -v CountryLookupServiceImpl.class

Yeah , I tried. It shows the same error.

3 years ago

Norm Radder wrote:Can you use the dir command to list all the files in the folder
and then use the javap command that shows the file not found message.

Copy the contents of the command prompt window and paste it here.

Please find the details below

3 years ago

Norm Radder wrote:

ERROR:Could not find CountryLookupServiceImpl.class  

Where is the CountryLookupServiceImpl.class file located?
The javap program can not find it.

Hi Norm,

The CountryLookupServiceImpl.class file is located in the below folder.

I ran the command also from the same folder.

I have used your program and gave the contents of the output earlier, could you please tell me whether that helped in showing where the problem is.

3 years ago
Hi Norm,

I have ran the code using my class file and below is the output im getting.

I am still confused on how to decipher this. Please advise.

Hi Ron,

I tried that JavaP command after putting my classfile in the same path. But im getting below error.


C:\apache>javap -v CountryLookupServiceImpl.class classfile com.devguerrilla.qui
ERROR:Could not find CountryLookupServiceImpl.class

3 years ago

Norm Radder wrote:See if you can find a hex editor to look at the contents of the .class file as hex bytes.

Thanks Norm !!!
I have downloaded Hxd and opened the file.
Below is the content I see on the first line.

In bytes 6 and 7 , its 00 and 32, so it looks like it has been compiled in Java 6 .
3 years ago

Tim Moores wrote:

Tim Moores wrote:examine bytes 5 and 6 of the class file

Oops, that should read bytes 7 and 8. Norm is using byte offsets from the first byte, a (IMO) rather confusing way to count bytes that numbers the first byte as being 0.

Hi Norm/ Tim,

Can you please tell me how i can view the contents of a class file.
I just tried opening it in a text pad and i got this strange contents in the file. I could not even copy and put it here as it says null characters.
If i try de-compile, then I will get the java class only right ? I dont know how to check the data which you have advised. Please advise.
3 years ago
Dear All,

Sorry for very late reply. I was out for a week . I could not check the post.
Thanks very much for your suggestions, I will check and update here shortly.
3 years ago
Dear All,

I have googled before posting this question as I could not solve my issue.
I am learning webservice and have created a WAR file in Java 6 and trying to install it in IBM Websphere which is also Java 6.
I get below error during deployment. Please help me understand this error.

3 years ago
Hi All,

I am using hibernate to connect to my DB and retrieve the records. Basically I am trying to run the below query in my java class.

But Im getting below exception. Please throw some light on this. Thanks !!!

public class Billing_Cons_Producer_Assoc {
   private BillingConsolidation BILLING_CONS_ID;
   private String BRANCH_CD;
   private String PRODUCER_CD;
   private String MASTER_IND;
   private java.sql.Date CREATED_DT;
   private int INACTIVE_IND;
   private String GEN_ID;
public class BillingConsolidation {
   private String BILLING_CONS_ID;
   private String BILLING_CONS_NAM;
   private java.util.Date CREATED_DT;
   private int ACTIVE_ROW_IND;
   private int PAPERLESS_IND;
   private java.util.Date UPDATED_DT;
   private int DB_COMM_STMT_IND;
   private int DB_COMM_PYMT_IND;
   private int JPMC_SETUP_IND;
   private String BANK_ACCT_NBR;
   private String BANK_ROUTING_NBR;
   private String UPDATED_USER_ID;
   private int GEN_ID;
   private int DB_AGENT_COMBO_IND;
   private int EANDO_PAPERLESS_IND;
   private int EANDO_EMAIL_IND;
   private int DB_PAPERLESS_IND;
   private int DB_PAYGO_SPRT_CHECK_IND;
   private int WCP_STMT_IND;
   private int DB_STMT_IND;
   private int AGENT_STMT_IND;

public class TestingService {

   public static void main(String args[]){
SessionFactory factory =
   new Configuration().configure("hibernate.cfg.xml").buildSessionFactory();
Billing_Cons_Producer_Assoc obj = new Billing_Cons_Producer_Assoc();
Session session = factory.openSession();

Query query = session.createQuery("select * from Billing_Cons_Producer_Assoc c inner join "
+ "Billing_Consolidation b on B.Billing_Cons_Id=C.Billing_Cons_Id ");
       ArrayList a = (ArrayList) query.list();


Hi Ron,

I have found the problem just now.
As i mentioned before the socket required header in the first line. Earlier I manually opened the file using textpad and updated the first line.
Later i used the modified file to be sent to printer without issues. Later I tried to do this first line addition programatically using stringbuilder.replaceAll() Method.
There was something wrong in that logic which prevented the socket from accepting the file. I corrected it using below code and now all is well. Thanks !!!

3 years ago
Hi Ron,

I am not sure which protocol is used for connecting  to the printer. I use below statement to write data  to the socket.

I am not sure which protocol is used behind the scenes. I will try to read chunk of data and write to output stream. I will post the result here. Thanks !!!
3 years ago
Hi Ron,

It is related to the same function but the question i posted in the previous thread was resolved after using the tool .
The file was not having the header in the first line

After adding the first line , it went through successfully. The problem now is if send a file (with first required line) which is large (ex more than 10 to 50 MB), I am getting the connection reset error.
But if i send 1 mb file, it goes through successfully.

If i send 50 MB file many times, every now and then its getting successful. What i thought is the printer socket is unable to handle large volume of data but printer team is saying the problem is on my side like a defective code.
I dont know the correct way to approach this issue. Do i have to increase my JVM heap size or something like that.. (Please note that this is not running in a app server, its just a Jar running using standard JRE).
Can you please guide me.
3 years ago