Gopi Chand Maddula

Ranch Hand
+ Follow
since May 11, 2010
Gopi Chand likes ...
Eclipse IDE Firefox Browser
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 Gopi Chand Maddula

Hi all,

I am trying to integrate with a webservice which uses 2 way SSL Authentication. I am using axis and Java 1.7 with Apache Tomcat Server.

My Problem is that when I send request I get NullPointer exception by the stub class.The response send by the server does not come to the client calling class but before that the stub class at the client generates a null pointer exception.

Below is the exception trace for your reference.

AxisFault
faultCode: {http://www.w3.org/2003/05/soap-envelope}Server.userException
faultSubcode:
faultString: java.lang.NullPointerException
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:209)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1781)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2957)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:648)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:332)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
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)
at com.quantiguous.www.services.FundsTransferByCustomerServiceSoap11Stub.getBalance(FundsTransferByCustomerServiceSoap11Stub.java:745)
at com.ds.neft.test.TestFundsTransfer.getBalanceWS(TestFundsTransfer.java:230)
at com.ds.neft.test.TestFundsTransfer.main(TestFundsTransfer.java:426)

{http://xml.apache.org/axis/}hostname:gopichand-Lenovo-G570

java.lang.NullPointerException
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
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)
at com.quantiguous.www.services.FundsTransferByCustomerServiceSoap11Stub.getBalance(FundsTransferByCustomerServiceSoap11Stub.java:745)
at com.ds.neft.test.TestFundsTransfer.getBalanceWS(TestFundsTransfer.java:230)
at com.ds.neft.test.TestFundsTransfer.main(TestFundsTransfer.java:426)
Caused by: java.lang.NullPointerException
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:209)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1781)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2957)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:648)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:332)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
... 12 more
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Request you to please help me in solving this as i didn't find any useful solution online.

Thanks in Advance.

Regards,
Gopi Chand. M



7 years ago
Hello JavaRanch,

While i am trying to post a request to a remote server i am receiving the SSLHandShake Error. I am using apache-commons HTTPClient and PostMethod classes to post the request.
As i tried for the first time while coding it worked well and good. But all of the sudden while testing its showing the error as mentioned.

Below is the code which i used to post


As my application is in testing phase, i got some exceptions while trying to connect to the remote server. After verifying the logs i came to know that the error is caused due to SSLHandshaking.
Below is the ErrorTrace.



As i have taken care of the socketConnectionTimouts and other connection issue, i want to know whether there is any point i am missing out in my code that caused this error.

Thanks in Advance...

12 years ago
Hi JavaRanch,

I am currently using the log4j-1.2.16.jar for my logging purpose in my application.
My requirement is to create a file with some tracking logs of the events occurred in my application, create a backup log file every hour and use that log file for monitoring.

As default by using DatePattern we can create a backup log file every hour, and its working pretty good for me.

But the problem occurs only when the logging event doesn't occur.
The backup file is not getting created.until the logging event occurs in the next hour. The previous data is still in the original logging file which is not rolling by itself.

Is there any possibility that the file gets rolled over irrespective of logging event.
Even if the application is idle for 2 days the file should get rolled over every hour.

while searching i came across an appender which is org.apache.log4j.appender.TimeAndSizeRollingAppender which supports only for log4j-1.2.15.jar
So i downloaded, updated my dependency to 1.2.15 and updated my configuration file as below.



Even if declared its getting rolled only when log event occurs.

Kindly help me in this issue.

Thanks in Advance.

Bear Bibeault wrote:The required jar files are missing from your web app. Add them to WEB-INF/lib.



I have already added all required jars and still showing the error.
But i tried to add commons-logging.jar as well and then it worked fine for me.

As it is working fine with my example i tried to use the same for the cross domain url which returns a json object.
Still my struggle goes on. its working for my sample but not for the cross domain Url.
I think there is a problem in forwarding data to the crossdomain url using $.getJSON() Method.

Am i doing anything wrong which doesn't work for cross domain URL

Thanks in advance......

Rob Spoor wrote:I don't know JSch well and haven't been able to quickly find any Javadoc pages, so my answer's just going to be a guess.

I see two possible options:
1) copy the file from server A to server C, storing the contents in a temporary file. Then copy the file from server C to server B, after which you delete the temporary file.
2) do the same but without storing it as a file. If you can get an InputStream to the file on server A and an OutputStream to the file on server B, simply copy everything from the InputStream to the OutputStream. Data will still be going from server A through server C to server B, but there's no temporary file.



Thanks for your suggestion Rob. I should give it a try.
But if the connection is lost in between the transfer of streams then it would be a big mess for me to get back that files as i am trying to move the files.

Look at the SCP exampls at the following link. This would help you in achieving what you are looking for..

JSCH Examples



I was just those examples only to move the files from server A to server B where my scripts would be on server A or Server B.
But in my case the moving scripts should be on Server C which is impossible to connect to two servers at a time using JSch.

If anybody had a solution for that please suggest me.
12 years ago
Hi JavaRanch,

I am trying to copy/move files from server A to server B. Both the servers are in Linux and it is done successfully. In order to do this my moving script files should be either on Server A or Server B.
But recently my requirement has been changed that my moving scripts should not be on both the servers i.e., the scripts for moving the files should be on server C, where the files will be moving within the servers A&B. So can any one help me achieving this scenario...

Thanks in Advance......
12 years ago
I mentioned earlier that my code is working fine when log4j is removed from my project,
but as log4j is important i am still debugging the issue.

Meanwhile i want try my code with the another URL rather than using my example which returns JSON object,
But there is no response in this scenario as well.

what are the changes i should need to do, so that i can access the outside URL which returns JSON Object.

Bear Bibeault wrote:Using a JSP to generate the JSON is a major problem. Use a servlet instead.



Thanks for your Reply.

Yes as per your suggestion i changed jsp and declared as servlet.

Below is the servlet is had written.



and when i run the following script, to my surprise the servlet thrown a weird errortrace which is



As it clearly states that org.apache.log4j.Category class is missing, i verified my log4j-1.2.16.jar and it contains the mentioned class.

Just for debugging i thought of removing the log4j jar and run, i did it and it executed correctly. and given response correctly.
But for my project the log4j-1.2.16.jar is mandatory for logging.

I am little bit confused with the jars that are required for using json. In a example i saw that the required jars are.
commons-lang 2.3
commons-beanutils 1.7.0
commons-collections 3.2
commons-logging 1.1
ezmorph 1.0.4.jar
json-lib-2.2.2-jdk15.jar

I added all those jars and as i said early my project requires log4j as well.
so the WEB-INF/lib folder contains all the list of jars mentioned along with log4j-1.2.16.jar.
But it json isn't working if i have log4j.jar in my lib folder.


Am i doing any mistake or please let me know the procedure which is greatly appreciated.
Hi JavaRanch,

I recently came to know that there is a process of data exchange which is light-weighted called as JSON objects. I feel interested and tried to implement it using JSON objects.

My example calls a serverside jsp which will return a JSON object. But the callback function in the .getJSON method is not working. Please help me resolving this issue.

The serverside jsp is--service.jsp


the above jsp returns just JSON object, and if i try to execute the jsp in the browser the response is as follows.


but when i try to get the JSON object using jquery's $.getJSON method its not giving any response.



you can see some debugging alerts as well in my example. But the alert in the callback function isn't getting executed. And for your info the server side jsp is executing for sure.


Can somebody assist me rectifying the errors i have made.

Thanks in Advance.


Hi,

I am a newbie in Javascript. I have a requirement of displaying different div's based upon which radio button is selected.

I should forward messages in two ways. either by sms or by mail.
So i have two div's one for sms, another for email and respective radio buttons as well.

if i select sms then i should display div related to sms and if email i should hide the sms div and display the email div.

here is my code


and my java script is



Am i following the right procedure? But it is not working in my browser, but i am not using any IDE.
I think my code have some syntax errors as well, i am unable to debug whats the problem.

Please suggest me to correct my code.

Thanks in Advance,
Thanks for your Reply.

That was a one good solution. But i do want to know that is there is any rule that an XML may or may not contain the Parent Node.
But as i am using DOM to parse the XML, i require the parent node for sure.

Please let me know whether there is any other possibility to parse the XML which doesn't have a parent Node.

I am Using DOM Parser for now. Is it the good practice or else i should go for SAX. Please Help me which is better way to parse and WHY?
Hi Java Ranch,

While going through some requirements doc i came to know that i have to parse an xml which has not even having a parent node.

First of all i was wondering that can we define any xml without having a parent node?

Irrespective of the rules for writing the xml i thought of trying and written a method which takes an xmlstring as input and gives map as output.

Below is my method snippet



and my xml which has to be parsed looks like this.


but even i try to execute the method i am getting the response as expected which is




can anyone help me in parsing the xml, and let me know the mistake i was doing.

Jan Cumps wrote:

Gopi Chand Maddula wrote:...But my requirement is just getting the last 100 rows of the each table and thats it.

That is different than your original post:

I have a Requirement to display the latest 100 rows inserted into the table.




Anyway i don't realize any difference between both. The last records inserted will be the latest record inserted, Right?
The order bothers when we are getting the latest 10 or 15, if we can't confirm that the last inserted rows are the latest records.

As i was searching for latest 100 i thought the last 100 would resolve my problem and meet the requirement.

Is there any big difference between the last and the latest for my scenario???

Please let me know if i miss anything...!

Deepak Bala wrote:
You do of course realize that is not a valid solution ? "select *" in the second query does not order by any column. If you are able to obtain the desired result, it is purely by coincidence.



Offcourse i do realise Deepak.
But my requirement is just getting the last 100 rows of the each table and thats it. If i should have to get the results in order then i should go for Paul's Suggestion. But its far away from my reach and i cant afford that time as well for the requirement.

Paul Sturrock wrote:No.





I think No would not be the answer or suggestion Paul. Anyway thanks for your help throughout the post, but i got the result for the requirement

Here is the simple query i tried for the requirement.

count = select count(*) from table_name;
select * from table_name LIMIT count-100,100

i got the result by using count. It simple returns the last 100 records in the table provided.


Thanks alot guys.