Hi Marc, 
Can you please suggest what shall I do to make it work ?

On Monday, September 25, 2023 at 3:49:14 PM UTC+5:30 Aman Singh Tomar wrote:

> Hi,
>
> Thanks for replying...
>
> Can you please help me to identify why this jacoco agent is not running ?
> Am I missing something in configuration of jacoco ? or Do I need to attach 
> it to some lifecycle phase ?
> Or what exactly do I need to do in order to make it work ?
>
> I am been struggling many weeks to figure out this.
>
> Thanks in advance.
>
> On Monday, September 25, 2023 at 2:01:14 PM UTC+5:30 Marc R. Hoffmann 
> wrote:
>
>> Hi,
>>
>> this simply means there is no JaCoCo agent running on localhost port 
>> 36320 at the point in time when you try to generate the dump.
>>
>> With linux tools like netstat -a you can get a list of all ports which 
>> are currently bound.
>>
>> Regards,
>> -marc
>>
>>
>> On 25. Sep 2023, at 09:48, Aman Singh Tomar <amansingh...@gmail.com> 
>> wrote:
>>
>> Hi Developers,
>>
>> Can you please assist me on the below Jacoco maven plugin issue;
>>
>> I am getting connection refused error during jacoco:dump goal.
>>
>> Below is my pom file :
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
>> http://www.w3.org/2001/XMLSchema-instance";
>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
>> https://maven.apache.org/xsd/maven-4.0.0.xsd";>
>> <modelVersion>4.0.0</modelVersion>
>> <parent>
>> <groupId>org.springframework.boot</groupId>
>> <artifactId>spring-boot-starter-parent</artifactId>
>> <version>3.1.3</version>
>> <relativePath/> <!-- lookup parent from repository -->
>> </parent>
>> <groupId>com.example</groupId>
>> <artifactId>jacoco</artifactId>
>> <version>0.0.1-SNAPSHOT</version>
>> <name>jacoco</name>
>> <description>jacoco</description>
>> <properties>
>> <java.version>17</java.version>
>> <jacoco.agent.argLine>
>> -javaagent:/Users/tomara/.m2/repository/org/jacoco/org.jacoco.agent/0.8.10/org.jacoco.agent-0.8.10-runtime.jar=destfile=/Users/tomara/Documents/git/jacoco/target/jacoco.exec
>> </jacoco.agent.argLine>
>> <jacoco.propertyName>coverageAgent</jacoco.propertyName>
>> <jacoco.destFile>${project.build.directory}/coverage.exec
>> </jacoco.destFile>
>> <jacoco.append>false</jacoco.append>
>> <!-- 
>> <jacoco.exclClassLoaders>sun.reflect.DelegatingClassLoader:MyClassLoader</jacoco.exclClassLoaders>-->
>> <!-- <jacoco.inclBootstrapClasses>true</jacoco.inclBootstrapClasses>-->
>> <!-- <jacoco.inclNoLocationClasses>true</jacoco.inclNoLocationClasses>-->
>> <!-- <jacoco.sessionId>session</jacoco.sessionId>-->
>> <jacoco.dumpOnExit>true</jacoco.dumpOnExit>
>> <jacoco.output>file</jacoco.output>
>> <jacoco.address>localhost</jacoco.address>
>> <jacoco.port>36320</jacoco.port>
>> <jacoco.classDumpDir>${project.build.directory}/classdumps
>> </jacoco.classDumpDir>
>> <!-- <jacoco.jmx>true</jacoco.jmx>-->
>>
>> <jacoco.dataFile>${jacoco.destFile}</jacoco.dataFile>
>>
>>
>> </properties>
>> <dependencies>
>> <dependency>
>> <groupId>org.springframework.boot</groupId>
>> <artifactId>spring-boot-starter</artifactId>
>> </dependency>
>>
>> <dependency>
>> <groupId>org.springframework.boot</groupId>
>> <artifactId>spring-boot-devtools</artifactId>
>> <scope>runtime</scope>
>> <optional>true</optional>
>> </dependency>
>> <dependency>
>> <groupId>org.springframework.boot</groupId>
>> <artifactId>spring-boot-starter-test</artifactId>
>> <scope>test</scope>
>> </dependency>
>> <dependency>
>> <groupId>org.ow2.asm</groupId>
>> <artifactId>asm</artifactId>
>> <version>9.5</version>
>> </dependency>
>> <dependency>
>> <groupId>org.ow2.asm</groupId>
>> <artifactId>asm-commons</artifactId>
>> <version>9.5</version>
>> </dependency>
>> <dependency>
>> <groupId>org.ow2.asm</groupId>
>> <artifactId>asm-tree</artifactId>
>> <version>9.5</version>
>> </dependency>
>> <dependency>
>> <groupId>org.ow2.asm</groupId>
>> <artifactId>asm-analysis</artifactId>
>> <version>9.5</version>
>> </dependency>
>> <dependency>
>> <groupId>org.ow2.asm</groupId>
>> <artifactId>asm-util</artifactId>
>> <version>9.5</version>
>> </dependency>
>> <!-- https://mvnrepository.com/artifact/org.jacoco/org.jacoco.cli -->
>> <dependency>
>> <groupId>org.jacoco</groupId>
>> <artifactId>org.jacoco.cli</artifactId>
>> <version>0.8.10</version>
>> </dependency>
>>
>> </dependencies>
>>
>> <build>
>> <plugins>
>> <!-- Configure Surefire plugin for unit tests -->
>> <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-surefire-plugin</artifactId>
>> <version>3.0.0</version> <!-- Use a version compatible with JaCoCo 
>> 0.8.10 -->
>> <configuration>
>> <argLine> ${coverageAgent}</argLine>
>> </configuration>
>> </plugin>
>>
>> <!-- Configure Failsafe plugin for integration tests -->
>> <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-failsafe-plugin</artifactId>
>> <version>3.0.0</version> <!-- Use a version compatible with JaCoCo 
>> 0.8.10 -->
>> <configuration>
>> <argLine> ${coverageAgent}</argLine>
>> </configuration>
>> </plugin>
>> <plugin>
>> <groupId>org.jacoco</groupId>
>> <artifactId>jacoco-maven-plugin</artifactId>
>> <version>0.8.8</version>
>> <executions>
>> <execution>
>> <goals>
>> <goal>prepare-agent</goal>
>> <goal>dump</goal>
>> </goals>
>> </execution>
>> </executions>
>> </plugin>
>> </plugins>
>> </build>
>>
>>
>>
>>
>> </project>
>>
>>  And Below is the maven error :-
>>
>>  --- jacoco-maven-plugin:0.8.8:dump (default) @ jacoco ---
>> [DEBUG] Loading mojo org.jacoco:jacoco-maven-plugin:0.8.8:dump from 
>> plugin realm ClassRealm[plugin>org.jacoco:jacoco-maven-plugin:0.8.8, 
>> parent: jdk.internal.loader.ClassLoaders$AppClassLoader@531d72ca]
>> [DEBUG] Configuring mojo execution 
>> 'org.jacoco:jacoco-maven-plugin:0.8.8:dump:default' with basic configurator 
>> -->
>> [DEBUG]   (f) address = localhost
>> [DEBUG]   (f) append = false
>> [DEBUG]   (f) destFile = 
>> /Users/tomara/Documents/git/jacoco/target/coverage.exec
>> [DEBUG]   (f) dump = true
>> [DEBUG]   (f) port = 36320
>> [DEBUG]   (f) project = MavenProject: com.example:jacoco:0.0.1-SNAPSHOT @ 
>> /Users/tomara/Documents/git/jacoco/pom.xml
>> [DEBUG]   (f) reset = false
>> [DEBUG]   (f) retryCount = 10
>> [DEBUG]   (f) skip = false
>> [DEBUG] -- end configuration --
>> [INFO] Connecting to localhost/127.0.0.1:36320
>> [INFO] Connection refused
>> [INFO] Connecting to localhost/127.0.0.1:36320
>> [INFO] Connection refused
>> [INFO] Connecting to localhost/127.0.0.1:36320
>> [INFO] Connection refused
>> [INFO] Connecting to localhost/127.0.0.1:36320
>> [INFO] Connection refused
>> [INFO] Connecting to localhost/127.0.0.1:36320
>> [INFO] Connection refused
>>
>>
>> Please help mates.... Not able to understand why this is happening
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "JaCoCo and EclEmma Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jacoco+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jacoco/6f96a049-153c-48bb-b418-cee6b4cb02c3n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jacoco/6f96a049-153c-48bb-b418-cee6b4cb02c3n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/4ece8884-6321-455b-870a-60597e681753n%40googlegroups.com.

Reply via email to