Pradeep Kumar

Ranch Hand
+ Follow
since Sep 08, 2006
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 Pradeep Kumar

I am exposing a service using httpInvoker and is working fine when working with DispatcherServlet. When I switch from RequestDispatcher to HttpRequestHandlerServlet I am getting an error Did not receive successful HTTP response: status code = 500, status message = [Internal Server Error]. Below are the configuration files. I have already spend 2 days debugging and have no clue. Please let me know where I am going wrong. The code is checked in Git repo. Link is - https://github.com/prashdeep/spring-remoting.git

Inside my web.xml file:



Inside my client-config.xml file:


In the index.jsp



In the process.jsp


Finally in my ClientInvoker.java


Error log on the browser:


7 years ago

Jeanne Boyarsky wrote:Pradeep,
You are going to need to refactor that code to make it testable. Ideas:

  • 3) Make the private method default access or protected and override it to do nothing.


  • #3 is often a hack, but it is easiest to do. Especially if you can't change the code much.



    I like the idea of the 3rd option. How do i override the method and test the method. Do you mean extends the class and override the method and test the sub class?
    11 years ago
    Hi friends,
    I am a beginner in Junit testing and just started exploring Junit for writing the test cases. I have a scenario where I am struck and finding it difficult to proceed. The scenario is that I am testing a public method which internally calls private methods. In on of the private method, the method tries to connect to the environment and the properties of the environment is fetched in the private method. How can i override the behavior such that I can override the behavior by populating the properties and mimic the environment dependency even though I do not directly call the private method.

    Ex:

    In the main class:

    In the ConfigDetail class



    Please let me know to do proceed.
    Thanks and Regards,
    Pradeep
    11 years ago
    Hi Duran,
    I would love to hear the motive behind writing the scripts to build and deploy using a shell script when you can use a continuos integration tools like hudson/Jenkins . Its so easy for building and managing the complete project build and deployment infrastructure.

    http://www.unixonthego.com
    11 years ago
    My two cents on this. How is that you can login to ServerB from ServerA and not from your local windows machine.

    To verify if the ServerB is accessible from your local windows machine try pinging the serverB from the cmd window. If you cannot ping then the serverB is not in the same network or domain.
    To verify that the ports are open form your local windows machine try doing telnet to serverB from putty to port 22 which is the default port for ssh login. If you are not able to telnet to ServerB you cannot login to the remote machine.

    Also are ServerA and your machine on the same domain? In case they are not in same domain, you need to use SSL VPN to connect to the ServerB from your local machine.

    In case they are in the same domain, you need to see if there is any proxy required to login to ServerB from your local machine. Check with your system administrator for more details.

    Hope this helps.

    Http://www.unixonthego.com
    11 years ago
    Yes. The history of commands executed for the users will be stored in the .bash_history file inside the home directory. Also the number of commands to be stored in history can be configured using the H!ISTSIZE property. Some additional useful commands can be found on http://www.unixonthego.com/history-command-with-unix/ website.
    11 years ago
    To transfer files between Unix and Windows you can install WinSCP tool which is a free tool. Once installed the files can be copied from and to Unix and Windows machine.

    Regards,
    Pradeep
    http://www.unixonthego.com
    11 years ago
    To execute the pel script from the Java code you can use the ProceeBuilder API from Java. I would prefer ProcessBuilder over System.exec since the former gives you a handle to the inputStream as well as the outputStream. Here is the sample code.



    Hope this helps

    Regards,
    Pradeep

    http://www.unixonthego.com
    11 years ago

    I would suggest you "Unix Power Tools" book. Very comprehensive and informative.


    Regards,
    Pradeep
    http://www.unixonthego.com
    11 years ago

    Anayonkar Shivalkar wrote:

    Pradeep Kumar wrote:My question is if it is singleton, how is it an issue?


    Ok. Let's assume that class is not singleton. Now, what you are gonna do is : create different objects of that class - each object will carry configuration of one external system, and provide one object per thread. So that you'll attempt different connections at the same time.


    Pradeep Kumar wrote:Also if we create threads and run on a singleton object why is is not a parallel process.


    Because, all threads run under same process, so, it is multithreading, not multiprocessing.

    I hope this helps.



    Yes i got the difference you mentioned with the singelton that you were referring to.


    What I am still not clear is if its not a singleton and we create n threads and n number of objects for n configurations, how is this better than looping in a for loop and testing each configuration at a time inside a for loop without the thread concept. What is the advantages?

    Please let me know your thoughts on the same.

    Anayonkar Shivalkar wrote:
    This is not parallel processing. Here, we are running threads.
    I hope this helps.



    The class was a singleton because it was a utility class and will be used throughout the application to connect to external system. My question is if it is singleton, how is it an issue? since we are creating threads, and threads can operate on a singleton object. a thread can notify other threads when one of the thread succeeds.

    Also if we create threads and run on a singleton object why is is not a parallel process. Yes i agree, that it ups to the scheduler to pick which thread to run but we can assume that threads all threads are sharing the CPU and hence assume its running in parallele

    Please comment on the same.

    Regards,
    Pradeep

    Hi Friends,

    Its a long time since I have logged into this site.

    I have a singleton object which has a method containing some parameters (external systems credentails). The singleton object tries to connect to external systems based on the arguments passed. one of them gets connected and the rest fails. Now currently I am doing it in a sequential way. i.e first try to send the details to the singleton object and see the response. If its not connected then try with different arguments until the singleton object establishes the connection for which i know the credentials. Can i do it using threads? so that i need not have to wait for n attempts before getting the right one.

    If yes.Is it equivalent to have a parallel process running. Are there any risks like deadlock etc.

    Regards,
    Pradeep
    Hi friends,
    I have a requirement to execute different goals for different project in a multi project build system. Ho can i do it? The below is what it looks like



    Now i need to execute mvn packagefor project1, mvn install for project2, mvn compile for project3 and mvn deploy for project4. Also preferably, it should be externalizable.

    How do i achieve this in maven? Please let me know.


    12 years ago
    I could resolve it by temporarily uploading the artifact to the internal repository. The reason I was not able to download the artifact behind the proxy is that I was using the maven-external-dependency plugin to download from n external url and the plugin is not connection the url through the proxy setting. I guess its a bug in the plugin.

    12 years ago