Ronnie D'costa

Greenhorn
+ Follow
since Dec 05, 2008
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 Ronnie D'costa

Hi guys,

I am using Emma tool for code coverage. I am getting the following error while trying to fetch the coverage dump from my application server (tomcat in this case). I 'googled' a lot; however couldn't get through.

I have verified that 'emma.jar' is added in the required JRE of the jvm which is used by the App server. The focus of concern is error 'Caused by: java.net.ConnectException: Connection refused' for which I couldn't find any explanation.

EMMA: processing control command sequence ...
EMMA: executing [coverage.get (ip2Loc.ec,true,true)] ...
[EMMA v2.1, build 5320 (stable)]
emma ctl: coverage.get: RPC failure while executing [coverage.get]
Exception in thread "main" com.vladium.emma.EMMARuntimeException: coverage.get: RPC failure while executing [coverage.get]
at com.vladium.emma.ctl.CtlProcessor._run(CtlProcessor.java:242)
at com.vladium.emma.Processor.run(Processor.java:88)
at com.vladium.emma.ctl.ctlCommand.run(ctlCommand.java:151)
at emma.main(emma.java:50)
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.<init>(Socket.java:366)
at java.net.Socket.<init>(Socket.java:209)
at com.vladium.emma.rt.RTControllerClientProxy.execute(RTControllerClientProxy.java:84)
at com.vladium.emma.ctl.CtlProcessor._run(CtlProcessor.java:231)
... 3 more

Can anyone please let me know whether I am missing any thing.


Ronnie
15 years ago
Hey Edwin...

Thanks a lot man ... it really works !!!

Another way I found was the use of ProcessBuilder (for JDK1.5 and above)...
This is the next thing to the Runtime.exec

have a look at this example...



Wish you a Happy & Prosperous New Year!!!
15 years ago
Hi All,

I am parsing a WSDL from a remote server. If I have access to that server, I can do it very comfortably.

How do I put a validation like whether that Server is accessible to me. I saw a few examples like the one listed below (where I try to check whether echo port is accessible)

try {
Socket t = new Socket("<servername>", 7);
DataInputStream dis = new DataInputStream(t.getInputStream());
PrintStream ps = new PrintStream(t.getOutputStream());
ps.println("Hello");
String str = dis.toString();
if (str.equals("Hello"))
System.out.println("Alive!") ;
else
System.out.println("Cannot Connect to Server");
t.close();
} catch (Exception e) {
e.printStackTrace();
}

I want to throw an Error message if I am unable to read the file on remote server. Also do I need specify the complete path (along with filename) while checking for the accessibility.

Cheers!!!
Ronnie
15 years ago
Hi All,

I have a maven project which I need to call from my Java program. IS there any way to call this project using the ProcessBuilder.

I tried it using the getRuntime.exec(), however only the basic commands like dir, cmd.exe are working.

Thanks in advance for all the replies
15 years ago
Hi Martijn,

You are near to understanding my problem

This is what exactly happens:
I start with execution of project1 (say in directory C:\MyProjects\project1). During its execution it finds the download path of project2. It now checks out the project2 from CVS (at C:\MyProjects\project2). At this point, I want to execute the project2 (I simply have run the 'mvn test' command in the project2) directory.

Currently I am trying to run the 'mvn test' command using the 'getRuntime.exec()' method in java.

FYI ... I am able to run the project2 from the command line. I just need to know the way to execute it via 'getRuntime.exec()'.

If possible, can anyone provide./direct me to an example of this.

Waiting desperately for this one

Ronnie
15 years ago
Hi Martijn,

Thanks for your suggestion.

It seems I am not clear with my explanation about the problem.

As mentioned earlier; I will be downloading the project at runtime.
The project will be downloaded in one of the directories within my current project (may be src/main/java/project). Now I want to run the downloaded project which has its own build files (in case of ANT) and POM file (in case of Maven) from my current project.

At first place, is this possible to execute all together a nes project from within an existing project??? If yes... how to do that???

Regards,
Abhijit
15 years ago
Thanks Martijn...

My issue is:

Part 1:
I currently have a project developed in Maven. Now I want to run tests from another project : say 'X'(name of this project would be available at runtime). In order to run tests from the project 'X', I need to check it out from the CVS. How can I achieve this using Maven or using JAVA code.

Part 2:
After downloading this project 'X'; how can I redirect the Maven to execute the tests from this project.

Please pour in your vital inputs on this
15 years ago
Hi All,

Newbie to Maven...

I am developing a tool that uses Maven for project management.
I am reading a file which has the details about the project that needs to be checked out from the CVS.

I am aware about the scm plugin for Maven. Since, I will be getting the project at runtime, I am not sure how to use this information in the POM.xml

Also, is it possible to run a sub-project independently from within a project.

Appreciate all your cooments

Thanks,
Scoucers
15 years ago