exec:java doesn't find classes from jar files

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

exec:java doesn't find classes from jar files

Raivo Rebane
Hello

If I use single httpclient.jar it doesn't find HttpClient.class

if I duplicate dependencies wuidth addisional httpclient-beta.jar it
finds HttpClient.class

Then it didn't find HttpClientConnectionManager.class witch exist in
both jars :

org/apache/http/conn/OperatedClientConnection.class
org/apache/http/conn/ManagedClientConnection.class
org/apache/http/conn/ConnectionRequest.class
org/apache/http/conn/EofSensorInputStream.class
org/apache/http/conn/ClientConnectionOperator.class
org/apache/http/conn/HttpClientConnectionOperator.class
org/apache/http/conn/BasicManagedEntity.class
org/apache/http/conn/ConnectionKeepAliveStrategy.class
org/apache/http/conn/ManagedHttpClientConnection.class
org/apache/http/conn/BasicEofSensorWatcher.class
org/apache/http/conn/HttpClientConnectionManager.class
org/apache/http/conn/HttpRoutedConnection.class
org/apache/http/conn/EofSensorWatcher.class
org/apache/http/conn/SchemePortResolver.class
org/apache/http/conn/ClientConnectionManager.class

What to do ?

Regrds

Raivo


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: exec:java doesn't find classes from jar files

Tomo Suzuki
Hi Raivo,

Interesting problem. Would you share the entire error message and minimum
reproducible pom.xml?

Tomo

On Sat, Oct 31, 2020 at 07:17 Raivo Rebane <[hidden email]> wrote:

> Hello
>
> If I use single httpclient.jar it doesn't find HttpClient.class
>
> if I duplicate dependencies wuidth addisional httpclient-beta.jar it
> finds HttpClient.class
>
> Then it didn't find HttpClientConnectionManager.class witch exist in
> both jars :
>
> org/apache/http/conn/OperatedClientConnection.class
> org/apache/http/conn/ManagedClientConnection.class
> org/apache/http/conn/ConnectionRequest.class
> org/apache/http/conn/EofSensorInputStream.class
> org/apache/http/conn/ClientConnectionOperator.class
> org/apache/http/conn/HttpClientConnectionOperator.class
> org/apache/http/conn/BasicManagedEntity.class
> org/apache/http/conn/ConnectionKeepAliveStrategy.class
> org/apache/http/conn/ManagedHttpClientConnection.class
> org/apache/http/conn/BasicEofSensorWatcher.class
> org/apache/http/conn/HttpClientConnectionManager.class
> org/apache/http/conn/HttpRoutedConnection.class
> org/apache/http/conn/EofSensorWatcher.class
> org/apache/http/conn/SchemePortResolver.class
> org/apache/http/conn/ClientConnectionManager.class
>
> What to do ?
>
> Regrds
>
> Raivo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
> --
Regards,
Tomo
Reply | Threaded
Open this post in threaded view
|

Re: exec:java doesn't find classes from jar files

Raivo Rebane
Hello

My pom is as follows:

<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>

     <groupId>1</groupId>
     <artifactId>p0</artifactId>
     <version>0.0.1</version>

     <name>A Solr project</name>
     <url>http://www.devonlinux.net</url>

     <properties>
         <solr.version>3.r4.0</solr.version>
         <solr.port>8983</solr.port>
     </properties>

<repositories>
   <repository>
     <id>project.local</id>
     <name>project</name>
     <url>file:${project.basedir}/repo</url>
   </repository>
</repositories>

     <dependencies>

         <dependency>
           <groupId>lib</groupId>
           <artifactId>solrj</artifactId>
           <version>1.0</version>
         </dependency>


         <dependency>
           <groupId>lib</groupId>
           <artifactId>httpclient</artifactId>
           <version>1.0</version>
         </dependency>

         <dependency>
           <groupId>lib</groupId>
           <artifactId>httpcore</artifactId>
           <version>1.0</version>
         </dependency>


         <dependency>
           <groupId>lib</groupId>
           <artifactId>codec</artifactId>
           <version>1.0</version>
         </dependency>

         <dependency>
           <groupId>lib</groupId>
           <artifactId>logging</artifactId>
           <version>1.0</version>
         </dependency>

         <dependency>
           <groupId>lib</groupId>
           <artifactId>httpclient-beta</artifactId>
           <version>1.0</version>
         </dependency>

         <dependency>
           <groupId>lib</groupId>
           <artifactId>apache-httpmime</artifactId>
           <version>1.0</version>
         </dependency>

         <dependency>
           <groupId>lib</groupId>
           <artifactId>slf4j</artifactId>
           <version>1.0</version>
         </dependency>

         <dependency>
           <groupId>lib</groupId>
           <artifactId>logback-classic</artifactId>
           <version>1.0</version>
         </dependency>

         <dependency>
           <groupId>lib</groupId>
           <artifactId>logback-core</artifactId>
           <version>1.0</version>
         </dependency>

     </dependencies>

     <build>

         <resources>
             <resource>
<directory>src/main/resources</directory>
                 <filtering>true</filtering>
             </resource>
         </resources>

         <plugins>


     <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
         <configuration>
             <source>1.7</source>
             <target>1.7</target>
         </configuration>
     </plugin>

             <plugin>
                 <groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
                 <version>6.1.25</version>
                 <configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
                     <stopKey>foo</stopKey>
                     <stopPort>9999</stopPort>
                     <contextPath>/solr</contextPath>
                     <connectors>
                         <connector
implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                             <port>${solr.port}</port>
<maxIdleTime>60000</maxIdleTime>
                         </connector>
                     </connectors>
                     <systemProperties>
                         <systemProperty>
                             <name>solr.data.dir</name>
                             <value>target/data</value>
                         </systemProperty>
                     </systemProperties>
                 </configuration>
                 <executions>
                     <execution>
                         <id>start-jetty</id>
<phase>pre-integration-test</phase>
                         <goals>
                             <goal>run</goal>
                         </goals>
                         <configuration>
                             <daemon>true</daemon>
                         </configuration>
                     </execution>
                     <execution>
                         <id>stop-jetty</id>
<phase>post-integration-test</phase>
                         <goals>
                             <goal>stop</goal>
                         </goals>
                     </execution>
                 </executions>
             </plugin>


             <plugin>
                 <groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
                 <version>6.0.2</version>
                 <configuration>
<skipProvidedScope>true</skipProvidedScope>
<skipRuntimeScope>true</skipRuntimeScope>
                 </configuration>
                 <executions>
                     <execution>
                         <goals>
                             <goal>check</goal>
                         </goals>
                     </execution>
                 </executions>
             </plugin>

             <plugin>
                 <groupId>org.easyb</groupId>
<artifactId>maven-easyb-plugin</artifactId>
                 <version>1.3</version>
                 <executions>
                     <execution>
<phase>integration-test</phase>
                         <goals>
                             <goal>test</goal>
                         </goals>
                     </execution>
                 </executions>
                 <configuration>
<easybTestDirectory>${basedir}/src/test/stories</easybTestDirectory>
<storyReport>${project.build.directory}/easyb-stories.txt</storyReport>
<xmlReport>${project.build.directory}/easyb-report.xml</xmlReport>
                     <storyType>html</storyType>
<storyReport>${project.build.directory}/acceptance/stories.html</storyReport>
                 </configuration>
             </plugin>

         </plugins>

     </build>
</project>

And error message is as follows:

Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 11.0.9, vendor: Ubuntu, runtime:
/usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-52-generic", arch: "amd64", family: "unix"
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by
com.google.inject.internal.cglib.core.$ReflectUtils$1
(file:/usr/share/maven/lib/guice.jar) to method
java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of
com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal
reflective access operations
WARNING: All illegal access operations will be denied in a future release
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG]   Imported: javax.annotation.* < plexus.core
[DEBUG]   Imported: javax.annotation.security.* < plexus.core
[DEBUG]   Imported: javax.enterprise.inject.* < plexus.core
[DEBUG]   Imported: javax.enterprise.util.* < plexus.core
[DEBUG]   Imported: javax.inject.* < plexus.core
[DEBUG]   Imported: org.apache.maven.* < plexus.core
[DEBUG]   Imported: org.apache.maven.artifact < plexus.core
[DEBUG]   Imported: org.apache.maven.classrealm < plexus.core
[DEBUG]   Imported: org.apache.maven.cli < plexus.core
[DEBUG]   Imported: org.apache.maven.configuration < plexus.core
[DEBUG]   Imported: org.apache.maven.exception < plexus.core
[DEBUG]   Imported: org.apache.maven.execution < plexus.core
[DEBUG]   Imported: org.apache.maven.execution.scope < plexus.core
[DEBUG]   Imported: org.apache.maven.lifecycle < plexus.core
[DEBUG]   Imported: org.apache.maven.model < plexus.core
[DEBUG]   Imported: org.apache.maven.monitor < plexus.core
[DEBUG]   Imported: org.apache.maven.plugin < plexus.core
[DEBUG]   Imported: org.apache.maven.profiles < plexus.core
[DEBUG]   Imported: org.apache.maven.project < plexus.core
[DEBUG]   Imported: org.apache.maven.reporting < plexus.core
[DEBUG]   Imported: org.apache.maven.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.rtinfo < plexus.core
[DEBUG]   Imported: org.apache.maven.settings < plexus.core
[DEBUG]   Imported: org.apache.maven.toolchain < plexus.core
[DEBUG]   Imported: org.apache.maven.usability < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.* < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.authentication < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.authorization < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.events < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.observers < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.proxy < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.resource < plexus.core
[DEBUG]   Imported: org.codehaus.classworlds < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.* < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.classworlds < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.component < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.configuration < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.container < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.context < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.lifecycle < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.logging < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.personality < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser <
plexus.core
[DEBUG]   Imported:
org.codehaus.plexus.util.xml.pull.XmlPullParserException < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer <
plexus.core
[DEBUG]   Imported: org.eclipse.aether.* < plexus.core
[DEBUG]   Imported: org.eclipse.aether.artifact < plexus.core
[DEBUG]   Imported: org.eclipse.aether.collection < plexus.core
[DEBUG]   Imported: org.eclipse.aether.deployment < plexus.core
[DEBUG]   Imported: org.eclipse.aether.graph < plexus.core
[DEBUG]   Imported: org.eclipse.aether.impl < plexus.core
[DEBUG]   Imported: org.eclipse.aether.installation < plexus.core
[DEBUG]   Imported: org.eclipse.aether.internal.impl < plexus.core
[DEBUG]   Imported: org.eclipse.aether.metadata < plexus.core
[DEBUG]   Imported: org.eclipse.aether.repository < plexus.core
[DEBUG]   Imported: org.eclipse.aether.resolution < plexus.core
[DEBUG]   Imported: org.eclipse.aether.spi < plexus.core
[DEBUG]   Imported: org.eclipse.aether.transfer < plexus.core
[DEBUG]   Imported: org.eclipse.aether.version < plexus.core
[DEBUG]   Imported: org.fusesource.jansi.* < plexus.core
[DEBUG]   Imported: org.slf4j.* < plexus.core
[DEBUG]   Imported: org.slf4j.event.* < plexus.core
[DEBUG]   Imported: org.slf4j.helpers.* < plexus.core
[DEBUG]   Imported: org.slf4j.spi.* < plexus.core
[DEBUG] Populating class realm maven.api
[INFO] Error stacktraces are turned on.
[DEBUG] Message scheme: color
[DEBUG] Message styles: debug info warning error success failure strong
mojo project
[DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml
[DEBUG] Reading user settings from /home/hydra/.m2/settings.xml
[DEBUG] Reading global toolchains from /usr/share/maven/conf/toolchains.xml
[DEBUG] Reading user toolchains from /home/hydra/.m2/toolchains.xml
[DEBUG] Using local repository at /home/hydra/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0
for /home/hydra/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project 1:p0:jar:0.0.1: (none)
[DEBUG] Looking up lifecycle mappings for packaging jar from
ClassRealm[plexus.core, parent: null]
[WARNING]
[WARNING] Some problems were encountered while building the effective
model for 1:p0:jar:0.0.1
[WARNING] 'build.plugins.plugin.version' for
org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 171,
column 13
[WARNING]
[WARNING] It is highly recommended to fix these problems because they
threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support
building such malformed projects.
[WARNING]
[DEBUG] Resolving plugin prefix exec from [org.apache.maven.plugins,
org.codehaus.mojo]
[DEBUG] Could not find metadata
org.apache.maven.plugins/maven-metadata.xml in local
(/home/hydra/.m2/repository)
[DEBUG] Skipped remote request for
org.apache.maven.plugins/maven-metadata.xml, locally cached metadata
up-to-date.
[DEBUG] Could not find metadata org.codehaus.mojo/maven-metadata.xml in
local (/home/hydra/.m2/repository)
[DEBUG] Skipped remote request for org.codehaus.mojo/maven-metadata.xml,
locally cached metadata up-to-date.
[DEBUG] Resolved plugin prefix exec to
org.codehaus.mojo:exec-maven-plugin from repository central
[DEBUG] Could not find metadata
org.codehaus.mojo:exec-maven-plugin/maven-metadata.xml in local
(/home/hydra/.m2/repository)
[DEBUG] Skipped remote request for
org.codehaus.mojo:exec-maven-plugin/maven-metadata.xml, locally cached
metadata up-to-date.
[DEBUG] Resolved plugin version for org.codehaus.mojo:exec-maven-plugin
to 3.0.0 from repository central (https://repo.maven.apache.org/maven2,
default, releases)
[DEBUG] === REACTOR BUILD PLAN
================================================
[DEBUG] Project: 1:p0:jar:0.0.1
[DEBUG] Tasks:   [exec:java]
[DEBUG] Style:   Regular
[DEBUG]
=======================================================================
[INFO]
[INFO] --------------------------------< 1:p0
 >--------------------------------
[INFO] Building A Solr project 0.0.1
[INFO] --------------------------------[ jar
]---------------------------------
[DEBUG] Resolving plugin prefix exec from [org.apache.maven.plugins,
org.codehaus.mojo]
[DEBUG] Could not find metadata
org.apache.maven.plugins/maven-metadata.xml in local
(/home/hydra/.m2/repository)
[DEBUG] Skipped remote request for
org.apache.maven.plugins/maven-metadata.xml, locally cached metadata
up-to-date.
[DEBUG] Could not find metadata org.codehaus.mojo/maven-metadata.xml in
local (/home/hydra/.m2/repository)
[DEBUG] Skipped remote request for org.codehaus.mojo/maven-metadata.xml,
locally cached metadata up-to-date.
[DEBUG] Resolved plugin prefix exec to
org.codehaus.mojo:exec-maven-plugin from repository central
[DEBUG] Could not find metadata
org.codehaus.mojo:exec-maven-plugin/maven-metadata.xml in local
(/home/hydra/.m2/repository)
[DEBUG] Skipped remote request for
org.codehaus.mojo:exec-maven-plugin/maven-metadata.xml, locally cached
metadata up-to-date.
[DEBUG] Resolved plugin version for org.codehaus.mojo:exec-maven-plugin
to 3.0.0 from repository central (https://repo.maven.apache.org/maven2,
default, releases)
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources,
process-sources, generate-resources, process-resources, compile,
process-classes, generate-test-sources, process-test-sources,
generate-test-resources, process-test-resources, test-compile,
process-test-classes, test, prepare-package, package,
pre-integration-test, integration-test, post-integration-test, verify,
install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] === PROJECT BUILD PLAN
================================================
[DEBUG] Project:       1:p0:0.0.1
[DEBUG] Dependencies (collect): []
[DEBUG] Dependencies (resolve): [test]
[DEBUG] Repositories (dependencies): [project.local
(file:/home/hydra/workspace1/p0/repo, default, releases+snapshots),
central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG] Repositories (plugins)     : [central
(https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG]
-----------------------------------------------------------------------
[DEBUG] Goal: org.codehaus.mojo:exec-maven-plugin:3.0.0:java (default-cli)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <addOutputToClasspath
default-value="true">${addOutputToClasspath}</addOutputToClasspath>
   <addResourcesToClasspath
default-value="false">${addResourcesToClasspath}</addResourcesToClasspath>
   <arguments>${exec.arguments}</arguments>
   <classpathScope
default-value="runtime">${exec.classpathScope}</classpathScope>
   <cleanupDaemonThreads
default-value="true">${exec.cleanupDaemonThreads}</cleanupDaemonThreads>
   <commandlineArgs>${exec.args}</commandlineArgs>
   <daemonThreadJoinTimeout
default-value="15000">${exec.daemonThreadJoinTimeout}</daemonThreadJoinTimeout>
   <includePluginDependencies
default-value="false">${exec.includePluginsDependencies}</includePluginDependencies>
   <includeProjectDependencies
default-value="true">${exec.includeProjectDependencies}</includeProjectDependencies>
   <keepAlive default-value="false">${exec.keepAlive}</keepAlive>
   <killAfter default-value="-1">${exec.killAfter}</killAfter>
   <mainClass>${exec.mainClass}</mainClass>
   <plugin default-value="${plugin}"/>
   <pluginDependencies default-value="${plugin.artifacts}"/>
   <project default-value="${project}"/>
   <session default-value="${session}"/>
   <skip default-value="false">${exec.skip}</skip>
   <sourceRoot>${sourceRoot}</sourceRoot>
   <stopUnresponsiveDaemonThreads
default-value="false">${exec.stopUnresponsiveDaemonThreads}</stopUnresponsiveDaemonThreads>
   <testSourceRoot>${testSourceRoot}</testSourceRoot>
</configuration>
[DEBUG]
=======================================================================
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=516192,
ConflictMarker.markTime=332042, ConflictMarker.nodeCount=11,
ConflictIdSorter.graphTime=294827, ConflictIdSorter.topsortTime=2838477,
ConflictIdSorter.conflictIdCount=10,
ConflictIdSorter.conflictIdCycleCount=0,
ConflictResolver.totalTime=4584323,
ConflictResolver.conflictItemCount=10,
DefaultDependencyCollector.collectTime=31459895,
DefaultDependencyCollector.transformTime=10101662}
[DEBUG] 1:p0:jar:0.0.1
[DEBUG]    lib:solrj:jar:1.0:compile
[DEBUG]    lib:httpclient:jar:1.0:compile
[DEBUG]    lib:httpcore:jar:1.0:compile
[DEBUG]    lib:codec:jar:1.0:compile
[DEBUG]    lib:logging:jar:1.0:compile
[DEBUG]    lib:httpclient-beta:jar:1.0:compile
[DEBUG]    lib:apache-httpmime:jar:1.0:compile
[DEBUG]    lib:slf4j:jar:1.0:compile
[DEBUG]    lib:logback-classic:jar:1.0:compile
[DEBUG]    lib:logback-core:jar:1.0:compile
[INFO]
[INFO] --- exec-maven-plugin:3.0.0:java (default-cli) @ p0 ---
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=325150,
ConflictMarker.markTime=2163066, ConflictMarker.nodeCount=127,
ConflictIdSorter.graphTime=290464, ConflictIdSorter.topsortTime=26735,
ConflictIdSorter.conflictIdCount=30,
ConflictIdSorter.conflictIdCycleCount=0,
ConflictResolver.totalTime=2861730,
ConflictResolver.conflictItemCount=74,
DefaultDependencyCollector.collectTime=164187130,
DefaultDependencyCollector.transformTime=5725131}
[DEBUG] org.codehaus.mojo:exec-maven-plugin:jar:3.0.0
[DEBUG]    org.apache.maven:maven-model:jar:3.0:compile
[DEBUG]    org.apache.maven:maven-artifact:jar:3.0:compile
[DEBUG]    org.apache.maven:maven-core:jar:3.0:compile
[DEBUG]       org.apache.maven:maven-settings:jar:3.0:compile
[DEBUG] org.apache.maven:maven-settings-builder:jar:3.0:compile
[DEBUG] org.apache.maven:maven-repository-metadata:jar:3.0:compile
[DEBUG]       org.apache.maven:maven-model-builder:jar:3.0:compile
[DEBUG] org.apache.maven:maven-aether-provider:jar:3.0:runtime
[DEBUG]       org.sonatype.aether:aether-impl:jar:1.7:compile
[DEBUG]          org.sonatype.aether:aether-spi:jar:1.7:compile
[DEBUG]       org.sonatype.aether:aether-api:jar:1.7:compile
[DEBUG]       org.sonatype.aether:aether-util:jar:1.7:compile
[DEBUG] org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2:compile
[DEBUG] org.sonatype.sisu:sisu-inject-bean:jar:1.4.2:compile
[DEBUG] org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7:compile
[DEBUG] org.codehaus.plexus:plexus-interpolation:jar:1.14:compile
[DEBUG] org.codehaus.plexus:plexus-classworlds:jar:2.2.3:compile
[DEBUG] org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile
[DEBUG]          org.sonatype.plexus:plexus-cipher:jar:1.4:compile
[DEBUG]    org.apache.maven:maven-plugin-api:jar:3.0:compile
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:3.0.20:compile
[DEBUG] org.codehaus.plexus:plexus-component-annotations:jar:1.6:compile
(optional)
[DEBUG]    org.apache.commons:commons-exec:jar:1.3:compile
[DEBUG] org.apache.maven.shared:maven-artifact-transfer:jar:0.10.1:compile
[DEBUG]
org.apache.maven.shared:maven-common-artifact-filters:jar:3.0.1:compile
[DEBUG] org.apache.maven.shared:maven-shared-utils:jar:3.1.0:compile
[DEBUG]             commons-io:commons-io:jar:2.5:compile
[DEBUG]       commons-codec:commons-codec:jar:1.11:compile
[DEBUG]       org.slf4j:slf4j-api:jar:1.7.5:compile
[DEBUG] Created new class realm
plugin>org.codehaus.mojo:exec-maven-plugin:3.0.0
[DEBUG] Importing foreign packages into class realm
plugin>org.codehaus.mojo:exec-maven-plugin:3.0.0
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm
plugin>org.codehaus.mojo:exec-maven-plugin:3.0.0
[DEBUG]   Included: org.codehaus.mojo:exec-maven-plugin:jar:3.0.0
[DEBUG]   Included: org.sonatype.aether:aether-util:jar:1.7
[DEBUG]   Included: org.sonatype.sisu:sisu-inject-bean:jar:1.4.2
[DEBUG]   Included: org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7
[DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.14
[DEBUG]   Included: org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3
[DEBUG]   Included: org.sonatype.plexus:plexus-cipher:jar:1.4
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.0.20
[DEBUG]   Included: org.codehaus.plexus:plexus-component-annotations:jar:1.6
[DEBUG]   Included: org.apache.commons:commons-exec:jar:1.3
[DEBUG]   Included:
org.apache.maven.shared:maven-artifact-transfer:jar:0.10.1
[DEBUG]   Included:
org.apache.maven.shared:maven-common-artifact-filters:jar:3.0.1
[DEBUG]   Included: org.apache.maven.shared:maven-shared-utils:jar:3.1.0
[DEBUG]   Included: commons-io:commons-io:jar:2.5
[DEBUG]   Included: commons-codec:commons-codec:jar:1.11
[DEBUG] Configuring mojo org.codehaus.mojo:exec-maven-plugin:3.0.0:java
from plugin realm
ClassRealm[plugin>org.codehaus.mojo:exec-maven-plugin:3.0.0, parent:
jdk.internal.loader.ClassLoaders$AppClassLoader@55054057]
[DEBUG] Configuring mojo
'org.codehaus.mojo:exec-maven-plugin:3.0.0:java' with basic configurator -->
[DEBUG]   (f) addOutputToClasspath = true
[DEBUG]   (f) addResourcesToClasspath = false
[DEBUG]   (f) arguments = []
[DEBUG]   (f) classpathScope = runtime
[DEBUG]   (f) cleanupDaemonThreads = true
[DEBUG]   (f) daemonThreadJoinTimeout = 15000
[DEBUG]   (f) includePluginDependencies = false
[DEBUG]   (f) includeProjectDependencies = true
[DEBUG]   (f) keepAlive = false
[DEBUG]   (f) killAfter = -1
[DEBUG]   (f) mainClass = SolrJExample
[DEBUG]   (f) plugin = Component Descriptor: role:
'org.apache.maven.plugin.Mojo', implementation:
'org.codehaus.mojo.exec.ExecMojo', role hint:
'org.codehaus.mojo:exec-maven-plugin:3.0.0:exec'
role: 'org.apache.maven.plugin.Mojo', implementation:
'org.codehaus.mojo.exec.HelpMojo', role hint:
'org.codehaus.mojo:exec-maven-plugin:3.0.0:help'
role: 'org.apache.maven.plugin.Mojo', implementation:
'org.codehaus.mojo.exec.ExecJavaMojo', role hint:
'org.codehaus.mojo:exec-maven-plugin:3.0.0:java'
---
[DEBUG]   (f) pluginDependencies =
[org.codehaus.mojo:exec-maven-plugin:maven-plugin:3.0.0:,
org.apache.maven:maven-model:jar:3.0:compile,
org.apache.maven:maven-artifact:jar:3.0:compile,
org.apache.maven:maven-core:jar:3.0:compile,
org.apache.maven:maven-settings:jar:3.0:compile,
org.apache.maven:maven-settings-builder:jar:3.0:compile,
org.apache.maven:maven-repository-metadata:jar:3.0:compile,
org.apache.maven:maven-model-builder:jar:3.0:compile,
org.apache.maven:maven-aether-provider:jar:3.0:runtime,
org.sonatype.aether:aether-impl:jar:1.7:compile,
org.sonatype.aether:aether-spi:jar:1.7:compile,
org.sonatype.aether:aether-api:jar:1.7:compile,
org.sonatype.aether:aether-util:jar:1.7:compile,
org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2:compile,
org.sonatype.sisu:sisu-inject-bean:jar:1.4.2:compile,
org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7:compile,
org.codehaus.plexus:plexus-interpolation:jar:1.14:compile,
org.codehaus.plexus:plexus-classworlds:jar:2.2.3:compile,
org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile,
org.sonatype.plexus:plexus-cipher:jar:1.4:compile,
org.apache.maven:maven-plugin-api:jar:3.0:compile,
org.codehaus.plexus:plexus-utils:jar:3.0.20:compile,
org.codehaus.plexus:plexus-component-annotations:jar:1.6:compile,
org.apache.commons:commons-exec:jar:1.3:compile,
org.apache.maven.shared:maven-artifact-transfer:jar:0.10.1:compile,
org.apache.maven.shared:maven-common-artifact-filters:jar:3.0.1:compile,
org.apache.maven.shared:maven-shared-utils:jar:3.1.0:compile,
commons-io:commons-io:jar:2.5:compile,
commons-codec:commons-codec:jar:1.11:compile,
org.slf4j:slf4j-api:jar:1.7.5:compile]
[DEBUG]   (f) project = MavenProject: 1:p0:0.0.1 @
/home/hydra/workspace1/p0/pom.xml
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@2add4d24
[DEBUG]   (f) skip = false
[DEBUG]   (f) stopUnresponsiveDaemonThreads = false
[DEBUG] -- end configuration --
[DEBUG] Invoking : SolrJExample.main()
[DEBUG] Plugin Dependencies will be excluded.
[DEBUG] Project Dependencies will be included.
[DEBUG] Collected project artifacts [lib:solrj:jar:1.0:compile,
lib:httpclient:jar:1.0:compile, lib:httpcore:jar:1.0:compile,
lib:codec:jar:1.0:compile, lib:logging:jar:1.0:compile,
lib:httpclient-beta:jar:1.0:compile,
lib:apache-httpmime:jar:1.0:compile, lib:slf4j:jar:1.0:compile,
lib:logback-classic:jar:1.0:compile, lib:logback-core:jar:1.0:compile]
[DEBUG] Collected project classpath
[/home/hydra/workspace1/p0/target/classes]
[DEBUG] Adding to classpath : /home/hydra/workspace1/p0/target/classes
[DEBUG] Adding project dependency artifact: solrj to classpath
[DEBUG] Adding project dependency artifact: httpclient to classpath
[DEBUG] Adding project dependency artifact: httpcore to classpath
[DEBUG] Adding project dependency artifact: codec to classpath
[DEBUG] Adding project dependency artifact: logging to classpath
[DEBUG] Adding project dependency artifact: httpclient-beta to classpath
[DEBUG] Adding project dependency artifact: apache-httpmime to classpath
[DEBUG] Adding project dependency artifact: slf4j to classpath
[DEBUG] Adding project dependency artifact: logback-classic to classpath
[DEBUG] Adding project dependency artifact: logback-core to classpath
[DEBUG] joining on thread Thread[SolrJExample.main(),5,SolrJExample]
[WARNING]
java.lang.NoClassDefFoundError:
org/apache/http/conn/HttpClientConnectionManager
     at org.apache.solr.client.solrj.impl.HttpSolrClient.<init>
(HttpSolrClient.java:204)
     at org.apache.solr.client.solrj.impl.HttpSolrClient$Builder.build
(HttpSolrClient.java:968)
     at SolrJExample.getSolrClient (SolrJExample.java:189)
     at SolrJExample.<clinit> (SolrJExample.java:33)
     at jdk.internal.misc.Unsafe.ensureClassInitialized0 (Native Method)
     at jdk.internal.misc.Unsafe.ensureClassInitialized (Unsafe.java:1042)
     at
java.lang.invoke.DirectMethodHandle$EnsureInitialized.computeValue
(DirectMethodHandle.java:357)
     at
java.lang.invoke.DirectMethodHandle$EnsureInitialized.computeValue
(DirectMethodHandle.java:354)
     at java.lang.ClassValue.getFromHashMap (ClassValue.java:226)
     at java.lang.ClassValue.getFromBackup (ClassValue.java:208)
     at java.lang.ClassValue.get (ClassValue.java:114)
     at java.lang.invoke.DirectMethodHandle.checkInitialized
(DirectMethodHandle.java:378)
     at java.lang.invoke.DirectMethodHandle.ensureInitialized
(DirectMethodHandle.java:368)
     at java.lang.invoke.DirectMethodHandle.internalMemberNameEnsureInit
(DirectMethodHandle.java:318)
     at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
     at java.lang.Thread.run (Thread.java:834)
Caused by: java.lang.ClassNotFoundException:
org.apache.http.conn.HttpClientConnectionManager
     at java.net.URLClassLoader.findClass (URLClassLoader.java:471)
     at java.lang.ClassLoader.loadClass (ClassLoader.java:589)
     at java.lang.ClassLoader.loadClass (ClassLoader.java:522)
     at org.apache.solr.client.solrj.impl.HttpSolrClient.<init>
(HttpSolrClient.java:204)
     at org.apache.solr.client.solrj.impl.HttpSolrClient$Builder.build
(HttpSolrClient.java:968)
     at SolrJExample.getSolrClient (SolrJExample.java:189)
     at SolrJExample.<clinit> (SolrJExample.java:33)
     at jdk.internal.misc.Unsafe.ensureClassInitialized0 (Native Method)
     at jdk.internal.misc.Unsafe.ensureClassInitialized (Unsafe.java:1042)
     at
java.lang.invoke.DirectMethodHandle$EnsureInitialized.computeValue
(DirectMethodHandle.java:357)
     at
java.lang.invoke.DirectMethodHandle$EnsureInitialized.computeValue
(DirectMethodHandle.java:354)
     at java.lang.ClassValue.getFromHashMap (ClassValue.java:226)
     at java.lang.ClassValue.getFromBackup (ClassValue.java:208)
     at java.lang.ClassValue.get (ClassValue.java:114)
     at java.lang.invoke.DirectMethodHandle.checkInitialized
(DirectMethodHandle.java:378)
     at java.lang.invoke.DirectMethodHandle.ensureInitialized
(DirectMethodHandle.java:368)
     at java.lang.invoke.DirectMethodHandle.internalMemberNameEnsureInit
(DirectMethodHandle.java:318)
     at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
     at java.lang.Thread.run (Thread.java:834)

Looking forward

Raivo


On 31.10.20 14:02, Tomo Suzuki wrote:

> Hi Raivo,
>
> Interesting problem. Would you share the entire error message and minimum
> reproducible pom.xml?
>
> Tomo
>
> On Sat, Oct 31, 2020 at 07:17 Raivo Rebane <[hidden email]> wrote:
>
>> Hello
>>
>> If I use single httpclient.jar it doesn't find HttpClient.class
>>
>> if I duplicate dependencies wuidth addisional httpclient-beta.jar it
>> finds HttpClient.class
>>
>> Then it didn't find HttpClientConnectionManager.class witch exist in
>> both jars :
>>
>> org/apache/http/conn/OperatedClientConnection.class
>> org/apache/http/conn/ManagedClientConnection.class
>> org/apache/http/conn/ConnectionRequest.class
>> org/apache/http/conn/EofSensorInputStream.class
>> org/apache/http/conn/ClientConnectionOperator.class
>> org/apache/http/conn/HttpClientConnectionOperator.class
>> org/apache/http/conn/BasicManagedEntity.class
>> org/apache/http/conn/ConnectionKeepAliveStrategy.class
>> org/apache/http/conn/ManagedHttpClientConnection.class
>> org/apache/http/conn/BasicEofSensorWatcher.class
>> org/apache/http/conn/HttpClientConnectionManager.class
>> org/apache/http/conn/HttpRoutedConnection.class
>> org/apache/http/conn/EofSensorWatcher.class
>> org/apache/http/conn/SchemePortResolver.class
>> org/apache/http/conn/ClientConnectionManager.class
>>
>> What to do ?
>>
>> Regrds
>>
>> Raivo
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>> --
> Regards,
> Tomo
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: exec:java doesn't find classes from jar files

Bernd Eckenfels
Hello,

I don't think it is a good idea to repackage or relocate common external libraries. It looks like you moved everything to groupid=lib, this is a not very common Maven usage. I am not saying you can't get it to work, but it needs some advanced skills and it is unlikely we can easily help you.

This might also be the reason why your transitive dependencies are no longer detected automatically, because you don't have the upstream POMs.

Your particular error seems to be an effect of that,  maybe mixing different library versions.

You can try to debug it by looking at "mvn dependency:tree"

Gruss
Bernd


--
http://bernd.eckenfels.net
________________________________
Von: Raivo Rebane <[hidden email]>
Gesendet: Saturday, October 31, 2020 2:20:21 PM
An: [hidden email] <[hidden email]>
Betreff: Re: exec:java doesn't find classes from jar files

Hello

My pom is as follows:

<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>

     <groupId>1</groupId>
     <artifactId>p0</artifactId>
     <version>0.0.1</version>

     <name>A Solr project</name>
     <url>http://www.devonlinux.net</url>

     <properties>
         <solr.version>3.r4.0</solr.version>
         <solr.port>8983</solr.port>
     </properties>

<repositories>
   <repository>
     <id>project.local</id>
     <name>project</name>
     <url>file:${project.basedir}/repo</url>
   </repository>
</repositories>

     <dependencies>

         <dependency>
           <groupId>lib</groupId>
           <artifactId>solrj</artifactId>
           <version>1.0</version>
         </dependency>


         <dependency>
           <groupId>lib</groupId>
           <artifactId>httpclient</artifactId>
           <version>1.0</version>
         </dependency>

         <dependency>
           <groupId>lib</groupId>
           <artifactId>httpcore</artifactId>
           <version>1.0</version>
         </dependency>


         <dependency>
           <groupId>lib</groupId>
           <artifactId>codec</artifactId>
           <version>1.0</version>
         </dependency>

         <dependency>
           <groupId>lib</groupId>
           <artifactId>logging</artifactId>
           <version>1.0</version>
         </dependency>

         <dependency>
           <groupId>lib</groupId>
           <artifactId>httpclient-beta</artifactId>
           <version>1.0</version>
         </dependency>

         <dependency>
           <groupId>lib</groupId>
           <artifactId>apache-httpmime</artifactId>
           <version>1.0</version>
         </dependency>

         <dependency>
           <groupId>lib</groupId>
           <artifactId>slf4j</artifactId>
           <version>1.0</version>
         </dependency>

         <dependency>
           <groupId>lib</groupId>
           <artifactId>logback-classic</artifactId>
           <version>1.0</version>
         </dependency>

         <dependency>
           <groupId>lib</groupId>
           <artifactId>logback-core</artifactId>
           <version>1.0</version>
         </dependency>

     </dependencies>

     <build>

         <resources>
             <resource>
<directory>src/main/resources</directory>
                 <filtering>true</filtering>
             </resource>
         </resources>

         <plugins>


     <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
         <configuration>
             <source>1.7</source>
             <target>1.7</target>
         </configuration>
     </plugin>

             <plugin>
                 <groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
                 <version>6.1.25</version>
                 <configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
                     <stopKey>foo</stopKey>
                     <stopPort>9999</stopPort>
                     <contextPath>/solr</contextPath>
                     <connectors>
                         <connector
implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                             <port>${solr.port}</port>
<maxIdleTime>60000</maxIdleTime>
                         </connector>
                     </connectors>
                     <systemProperties>
                         <systemProperty>
                             <name>solr.data.dir</name>
                             <value>target/data</value>
                         </systemProperty>
                     </systemProperties>
                 </configuration>
                 <executions>
                     <execution>
                         <id>start-jetty</id>
<phase>pre-integration-test</phase>
                         <goals>
                             <goal>run</goal>
                         </goals>
                         <configuration>
                             <daemon>true</daemon>
                         </configuration>
                     </execution>
                     <execution>
                         <id>stop-jetty</id>
<phase>post-integration-test</phase>
                         <goals>
                             <goal>stop</goal>
                         </goals>
                     </execution>
                 </executions>
             </plugin>


             <plugin>
                 <groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
                 <version>6.0.2</version>
                 <configuration>
<skipProvidedScope>true</skipProvidedScope>
<skipRuntimeScope>true</skipRuntimeScope>
                 </configuration>
                 <executions>
                     <execution>
                         <goals>
                             <goal>check</goal>
                         </goals>
                     </execution>
                 </executions>
             </plugin>

             <plugin>
                 <groupId>org.easyb</groupId>
<artifactId>maven-easyb-plugin</artifactId>
                 <version>1.3</version>
                 <executions>
                     <execution>
<phase>integration-test</phase>
                         <goals>
                             <goal>test</goal>
                         </goals>
                     </execution>
                 </executions>
                 <configuration>
<easybTestDirectory>${basedir}/src/test/stories</easybTestDirectory>
<storyReport>${project.build.directory}/easyb-stories.txt</storyReport>
<xmlReport>${project.build.directory}/easyb-report.xml</xmlReport>
                     <storyType>html</storyType>
<storyReport>${project.build.directory}/acceptance/stories.html</storyReport>
                 </configuration>
             </plugin>

         </plugins>

     </build>
</project>

And error message is as follows:

Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 11.0.9, vendor: Ubuntu, runtime:
/usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-52-generic", arch: "amd64", family: "unix"
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by
com.google.inject.internal.cglib.core.$ReflectUtils$1
(file:/usr/share/maven/lib/guice.jar) to method
java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of
com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal
reflective access operations
WARNING: All illegal access operations will be denied in a future release
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG]   Imported: javax.annotation.* < plexus.core
[DEBUG]   Imported: javax.annotation.security.* < plexus.core
[DEBUG]   Imported: javax.enterprise.inject.* < plexus.core
[DEBUG]   Imported: javax.enterprise.util.* < plexus.core
[DEBUG]   Imported: javax.inject.* < plexus.core
[DEBUG]   Imported: org.apache.maven.* < plexus.core
[DEBUG]   Imported: org.apache.maven.artifact < plexus.core
[DEBUG]   Imported: org.apache.maven.classrealm < plexus.core
[DEBUG]   Imported: org.apache.maven.cli < plexus.core
[DEBUG]   Imported: org.apache.maven.configuration < plexus.core
[DEBUG]   Imported: org.apache.maven.exception < plexus.core
[DEBUG]   Imported: org.apache.maven.execution < plexus.core
[DEBUG]   Imported: org.apache.maven.execution.scope < plexus.core
[DEBUG]   Imported: org.apache.maven.lifecycle < plexus.core
[DEBUG]   Imported: org.apache.maven.model < plexus.core
[DEBUG]   Imported: org.apache.maven.monitor < plexus.core
[DEBUG]   Imported: org.apache.maven.plugin < plexus.core
[DEBUG]   Imported: org.apache.maven.profiles < plexus.core
[DEBUG]   Imported: org.apache.maven.project < plexus.core
[DEBUG]   Imported: org.apache.maven.reporting < plexus.core
[DEBUG]   Imported: org.apache.maven.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.rtinfo < plexus.core
[DEBUG]   Imported: org.apache.maven.settings < plexus.core
[DEBUG]   Imported: org.apache.maven.toolchain < plexus.core
[DEBUG]   Imported: org.apache.maven.usability < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.* < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.authentication < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.authorization < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.events < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.observers < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.proxy < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.resource < plexus.core
[DEBUG]   Imported: org.codehaus.classworlds < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.* < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.classworlds < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.component < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.configuration < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.container < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.context < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.lifecycle < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.logging < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.personality < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser <
plexus.core
[DEBUG]   Imported:
org.codehaus.plexus.util.xml.pull.XmlPullParserException < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer <
plexus.core
[DEBUG]   Imported: org.eclipse.aether.* < plexus.core
[DEBUG]   Imported: org.eclipse.aether.artifact < plexus.core
[DEBUG]   Imported: org.eclipse.aether.collection < plexus.core
[DEBUG]   Imported: org.eclipse.aether.deployment < plexus.core
[DEBUG]   Imported: org.eclipse.aether.graph < plexus.core
[DEBUG]   Imported: org.eclipse.aether.impl < plexus.core
[DEBUG]   Imported: org.eclipse.aether.installation < plexus.core
[DEBUG]   Imported: org.eclipse.aether.internal.impl < plexus.core
[DEBUG]   Imported: org.eclipse.aether.metadata < plexus.core
[DEBUG]   Imported: org.eclipse.aether.repository < plexus.core
[DEBUG]   Imported: org.eclipse.aether.resolution < plexus.core
[DEBUG]   Imported: org.eclipse.aether.spi < plexus.core
[DEBUG]   Imported: org.eclipse.aether.transfer < plexus.core
[DEBUG]   Imported: org.eclipse.aether.version < plexus.core
[DEBUG]   Imported: org.fusesource.jansi.* < plexus.core
[DEBUG]   Imported: org.slf4j.* < plexus.core
[DEBUG]   Imported: org.slf4j.event.* < plexus.core
[DEBUG]   Imported: org.slf4j.helpers.* < plexus.core
[DEBUG]   Imported: org.slf4j.spi.* < plexus.core
[DEBUG] Populating class realm maven.api
[INFO] Error stacktraces are turned on.
[DEBUG] Message scheme: color
[DEBUG] Message styles: debug info warning error success failure strong
mojo project
[DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml
[DEBUG] Reading user settings from /home/hydra/.m2/settings.xml
[DEBUG] Reading global toolchains from /usr/share/maven/conf/toolchains.xml
[DEBUG] Reading user toolchains from /home/hydra/.m2/toolchains.xml
[DEBUG] Using local repository at /home/hydra/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0
for /home/hydra/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project 1:p0:jar:0.0.1: (none)
[DEBUG] Looking up lifecycle mappings for packaging jar from
ClassRealm[plexus.core, parent: null]
[WARNING]
[WARNING] Some problems were encountered while building the effective
model for 1:p0:jar:0.0.1
[WARNING] 'build.plugins.plugin.version' for
org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 171,
column 13
[WARNING]
[WARNING] It is highly recommended to fix these problems because they
threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support
building such malformed projects.
[WARNING]
[DEBUG] Resolving plugin prefix exec from [org.apache.maven.plugins,
org.codehaus.mojo]
[DEBUG] Could not find metadata
org.apache.maven.plugins/maven-metadata.xml in local
(/home/hydra/.m2/repository)
[DEBUG] Skipped remote request for
org.apache.maven.plugins/maven-metadata.xml, locally cached metadata
up-to-date.
[DEBUG] Could not find metadata org.codehaus.mojo/maven-metadata.xml in
local (/home/hydra/.m2/repository)
[DEBUG] Skipped remote request for org.codehaus.mojo/maven-metadata.xml,
locally cached metadata up-to-date.
[DEBUG] Resolved plugin prefix exec to
org.codehaus.mojo:exec-maven-plugin from repository central
[DEBUG] Could not find metadata
org.codehaus.mojo:exec-maven-plugin/maven-metadata.xml in local
(/home/hydra/.m2/repository)
[DEBUG] Skipped remote request for
org.codehaus.mojo:exec-maven-plugin/maven-metadata.xml, locally cached
metadata up-to-date.
[DEBUG] Resolved plugin version for org.codehaus.mojo:exec-maven-plugin
to 3.0.0 from repository central (https://repo.maven.apache.org/maven2,
default, releases)
[DEBUG] === REACTOR BUILD PLAN
================================================
[DEBUG] Project: 1:p0:jar:0.0.1
[DEBUG] Tasks:   [exec:java]
[DEBUG] Style:   Regular
[DEBUG]
=======================================================================
[INFO]
[INFO] --------------------------------< 1:p0
 >--------------------------------
[INFO] Building A Solr project 0.0.1
[INFO] --------------------------------[ jar
]---------------------------------
[DEBUG] Resolving plugin prefix exec from [org.apache.maven.plugins,
org.codehaus.mojo]
[DEBUG] Could not find metadata
org.apache.maven.plugins/maven-metadata.xml in local
(/home/hydra/.m2/repository)
[DEBUG] Skipped remote request for
org.apache.maven.plugins/maven-metadata.xml, locally cached metadata
up-to-date.
[DEBUG] Could not find metadata org.codehaus.mojo/maven-metadata.xml in
local (/home/hydra/.m2/repository)
[DEBUG] Skipped remote request for org.codehaus.mojo/maven-metadata.xml,
locally cached metadata up-to-date.
[DEBUG] Resolved plugin prefix exec to
org.codehaus.mojo:exec-maven-plugin from repository central
[DEBUG] Could not find metadata
org.codehaus.mojo:exec-maven-plugin/maven-metadata.xml in local
(/home/hydra/.m2/repository)
[DEBUG] Skipped remote request for
org.codehaus.mojo:exec-maven-plugin/maven-metadata.xml, locally cached
metadata up-to-date.
[DEBUG] Resolved plugin version for org.codehaus.mojo:exec-maven-plugin
to 3.0.0 from repository central (https://repo.maven.apache.org/maven2,
default, releases)
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources,
process-sources, generate-resources, process-resources, compile,
process-classes, generate-test-sources, process-test-sources,
generate-test-resources, process-test-resources, test-compile,
process-test-classes, test, prepare-package, package,
pre-integration-test, integration-test, post-integration-test, verify,
install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] === PROJECT BUILD PLAN
================================================
[DEBUG] Project:       1:p0:0.0.1
[DEBUG] Dependencies (collect): []
[DEBUG] Dependencies (resolve): [test]
[DEBUG] Repositories (dependencies): [project.local
(file:/home/hydra/workspace1/p0/repo, default, releases+snapshots),
central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG] Repositories (plugins)     : [central
(https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG]
-----------------------------------------------------------------------
[DEBUG] Goal: org.codehaus.mojo:exec-maven-plugin:3.0.0:java (default-cli)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <addOutputToClasspath
default-value="true">${addOutputToClasspath}</addOutputToClasspath>
   <addResourcesToClasspath
default-value="false">${addResourcesToClasspath}</addResourcesToClasspath>
   <arguments>${exec.arguments}</arguments>
   <classpathScope
default-value="runtime">${exec.classpathScope}</classpathScope>
   <cleanupDaemonThreads
default-value="true">${exec.cleanupDaemonThreads}</cleanupDaemonThreads>
   <commandlineArgs>${exec.args}</commandlineArgs>
   <daemonThreadJoinTimeout
default-value="15000">${exec.daemonThreadJoinTimeout}</daemonThreadJoinTimeout>
   <includePluginDependencies
default-value="false">${exec.includePluginsDependencies}</includePluginDependencies>
   <includeProjectDependencies
default-value="true">${exec.includeProjectDependencies}</includeProjectDependencies>
   <keepAlive default-value="false">${exec.keepAlive}</keepAlive>
   <killAfter default-value="-1">${exec.killAfter}</killAfter>
   <mainClass>${exec.mainClass}</mainClass>
   <plugin default-value="${plugin}"/>
   <pluginDependencies default-value="${plugin.artifacts}"/>
   <project default-value="${project}"/>
   <session default-value="${session}"/>
   <skip default-value="false">${exec.skip}</skip>
   <sourceRoot>${sourceRoot}</sourceRoot>
   <stopUnresponsiveDaemonThreads
default-value="false">${exec.stopUnresponsiveDaemonThreads}</stopUnresponsiveDaemonThreads>
   <testSourceRoot>${testSourceRoot}</testSourceRoot>
</configuration>
[DEBUG]
=======================================================================
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=516192,
ConflictMarker.markTime=332042, ConflictMarker.nodeCount=11,
ConflictIdSorter.graphTime=294827, ConflictIdSorter.topsortTime=2838477,
ConflictIdSorter.conflictIdCount=10,
ConflictIdSorter.conflictIdCycleCount=0,
ConflictResolver.totalTime=4584323,
ConflictResolver.conflictItemCount=10,
DefaultDependencyCollector.collectTime=31459895,
DefaultDependencyCollector.transformTime=10101662}
[DEBUG] 1:p0:jar:0.0.1
[DEBUG]    lib:solrj:jar:1.0:compile
[DEBUG]    lib:httpclient:jar:1.0:compile
[DEBUG]    lib:httpcore:jar:1.0:compile
[DEBUG]    lib:codec:jar:1.0:compile
[DEBUG]    lib:logging:jar:1.0:compile
[DEBUG]    lib:httpclient-beta:jar:1.0:compile
[DEBUG]    lib:apache-httpmime:jar:1.0:compile
[DEBUG]    lib:slf4j:jar:1.0:compile
[DEBUG]    lib:logback-classic:jar:1.0:compile
[DEBUG]    lib:logback-core:jar:1.0:compile
[INFO]
[INFO] --- exec-maven-plugin:3.0.0:java (default-cli) @ p0 ---
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=325150,
ConflictMarker.markTime=2163066, ConflictMarker.nodeCount=127,
ConflictIdSorter.graphTime=290464, ConflictIdSorter.topsortTime=26735,
ConflictIdSorter.conflictIdCount=30,
ConflictIdSorter.conflictIdCycleCount=0,
ConflictResolver.totalTime=2861730,
ConflictResolver.conflictItemCount=74,
DefaultDependencyCollector.collectTime=164187130,
DefaultDependencyCollector.transformTime=5725131}
[DEBUG] org.codehaus.mojo:exec-maven-plugin:jar:3.0.0
[DEBUG]    org.apache.maven:maven-model:jar:3.0:compile
[DEBUG]    org.apache.maven:maven-artifact:jar:3.0:compile
[DEBUG]    org.apache.maven:maven-core:jar:3.0:compile
[DEBUG]       org.apache.maven:maven-settings:jar:3.0:compile
[DEBUG] org.apache.maven:maven-settings-builder:jar:3.0:compile
[DEBUG] org.apache.maven:maven-repository-metadata:jar:3.0:compile
[DEBUG]       org.apache.maven:maven-model-builder:jar:3.0:compile
[DEBUG] org.apache.maven:maven-aether-provider:jar:3.0:runtime
[DEBUG]       org.sonatype.aether:aether-impl:jar:1.7:compile
[DEBUG]          org.sonatype.aether:aether-spi:jar:1.7:compile
[DEBUG]       org.sonatype.aether:aether-api:jar:1.7:compile
[DEBUG]       org.sonatype.aether:aether-util:jar:1.7:compile
[DEBUG] org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2:compile
[DEBUG] org.sonatype.sisu:sisu-inject-bean:jar:1.4.2:compile
[DEBUG] org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7:compile
[DEBUG] org.codehaus.plexus:plexus-interpolation:jar:1.14:compile
[DEBUG] org.codehaus.plexus:plexus-classworlds:jar:2.2.3:compile
[DEBUG] org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile
[DEBUG]          org.sonatype.plexus:plexus-cipher:jar:1.4:compile
[DEBUG]    org.apache.maven:maven-plugin-api:jar:3.0:compile
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:3.0.20:compile
[DEBUG] org.codehaus.plexus:plexus-component-annotations:jar:1.6:compile
(optional)
[DEBUG]    org.apache.commons:commons-exec:jar:1.3:compile
[DEBUG] org.apache.maven.shared:maven-artifact-transfer:jar:0.10.1:compile
[DEBUG]
org.apache.maven.shared:maven-common-artifact-filters:jar:3.0.1:compile
[DEBUG] org.apache.maven.shared:maven-shared-utils:jar:3.1.0:compile
[DEBUG]             commons-io:commons-io:jar:2.5:compile
[DEBUG]       commons-codec:commons-codec:jar:1.11:compile
[DEBUG]       org.slf4j:slf4j-api:jar:1.7.5:compile
[DEBUG] Created new class realm
plugin>org.codehaus.mojo:exec-maven-plugin:3.0.0
[DEBUG] Importing foreign packages into class realm
plugin>org.codehaus.mojo:exec-maven-plugin:3.0.0
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm
plugin>org.codehaus.mojo:exec-maven-plugin:3.0.0
[DEBUG]   Included: org.codehaus.mojo:exec-maven-plugin:jar:3.0.0
[DEBUG]   Included: org.sonatype.aether:aether-util:jar:1.7
[DEBUG]   Included: org.sonatype.sisu:sisu-inject-bean:jar:1.4.2
[DEBUG]   Included: org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7
[DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.14
[DEBUG]   Included: org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3
[DEBUG]   Included: org.sonatype.plexus:plexus-cipher:jar:1.4
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.0.20
[DEBUG]   Included: org.codehaus.plexus:plexus-component-annotations:jar:1.6
[DEBUG]   Included: org.apache.commons:commons-exec:jar:1.3
[DEBUG]   Included:
org.apache.maven.shared:maven-artifact-transfer:jar:0.10.1
[DEBUG]   Included:
org.apache.maven.shared:maven-common-artifact-filters:jar:3.0.1
[DEBUG]   Included: org.apache.maven.shared:maven-shared-utils:jar:3.1.0
[DEBUG]   Included: commons-io:commons-io:jar:2.5
[DEBUG]   Included: commons-codec:commons-codec:jar:1.11
[DEBUG] Configuring mojo org.codehaus.mojo:exec-maven-plugin:3.0.0:java
from plugin realm
ClassRealm[plugin>org.codehaus.mojo:exec-maven-plugin:3.0.0, parent:
jdk.internal.loader.ClassLoaders$AppClassLoader@55054057]
[DEBUG] Configuring mojo
'org.codehaus.mojo:exec-maven-plugin:3.0.0:java' with basic configurator -->
[DEBUG]   (f) addOutputToClasspath = true
[DEBUG]   (f) addResourcesToClasspath = false
[DEBUG]   (f) arguments = []
[DEBUG]   (f) classpathScope = runtime
[DEBUG]   (f) cleanupDaemonThreads = true
[DEBUG]   (f) daemonThreadJoinTimeout = 15000
[DEBUG]   (f) includePluginDependencies = false
[DEBUG]   (f) includeProjectDependencies = true
[DEBUG]   (f) keepAlive = false
[DEBUG]   (f) killAfter = -1
[DEBUG]   (f) mainClass = SolrJExample
[DEBUG]   (f) plugin = Component Descriptor: role:
'org.apache.maven.plugin.Mojo', implementation:
'org.codehaus.mojo.exec.ExecMojo', role hint:
'org.codehaus.mojo:exec-maven-plugin:3.0.0:exec'
role: 'org.apache.maven.plugin.Mojo', implementation:
'org.codehaus.mojo.exec.HelpMojo', role hint:
'org.codehaus.mojo:exec-maven-plugin:3.0.0:help'
role: 'org.apache.maven.plugin.Mojo', implementation:
'org.codehaus.mojo.exec.ExecJavaMojo', role hint:
'org.codehaus.mojo:exec-maven-plugin:3.0.0:java'
---
[DEBUG]   (f) pluginDependencies =
[org.codehaus.mojo:exec-maven-plugin:maven-plugin:3.0.0:,
org.apache.maven:maven-model:jar:3.0:compile,
org.apache.maven:maven-artifact:jar:3.0:compile,
org.apache.maven:maven-core:jar:3.0:compile,
org.apache.maven:maven-settings:jar:3.0:compile,
org.apache.maven:maven-settings-builder:jar:3.0:compile,
org.apache.maven:maven-repository-metadata:jar:3.0:compile,
org.apache.maven:maven-model-builder:jar:3.0:compile,
org.apache.maven:maven-aether-provider:jar:3.0:runtime,
org.sonatype.aether:aether-impl:jar:1.7:compile,
org.sonatype.aether:aether-spi:jar:1.7:compile,
org.sonatype.aether:aether-api:jar:1.7:compile,
org.sonatype.aether:aether-util:jar:1.7:compile,
org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2:compile,
org.sonatype.sisu:sisu-inject-bean:jar:1.4.2:compile,
org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7:compile,
org.codehaus.plexus:plexus-interpolation:jar:1.14:compile,
org.codehaus.plexus:plexus-classworlds:jar:2.2.3:compile,
org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile,
org.sonatype.plexus:plexus-cipher:jar:1.4:compile,
org.apache.maven:maven-plugin-api:jar:3.0:compile,
org.codehaus.plexus:plexus-utils:jar:3.0.20:compile,
org.codehaus.plexus:plexus-component-annotations:jar:1.6:compile,
org.apache.commons:commons-exec:jar:1.3:compile,
org.apache.maven.shared:maven-artifact-transfer:jar:0.10.1:compile,
org.apache.maven.shared:maven-common-artifact-filters:jar:3.0.1:compile,
org.apache.maven.shared:maven-shared-utils:jar:3.1.0:compile,
commons-io:commons-io:jar:2.5:compile,
commons-codec:commons-codec:jar:1.11:compile,
org.slf4j:slf4j-api:jar:1.7.5:compile]
[DEBUG]   (f) project = MavenProject: 1:p0:0.0.1 @
/home/hydra/workspace1/p0/pom.xml
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@2add4d24
[DEBUG]   (f) skip = false
[DEBUG]   (f) stopUnresponsiveDaemonThreads = false
[DEBUG] -- end configuration --
[DEBUG] Invoking : SolrJExample.main()
[DEBUG] Plugin Dependencies will be excluded.
[DEBUG] Project Dependencies will be included.
[DEBUG] Collected project artifacts [lib:solrj:jar:1.0:compile,
lib:httpclient:jar:1.0:compile, lib:httpcore:jar:1.0:compile,
lib:codec:jar:1.0:compile, lib:logging:jar:1.0:compile,
lib:httpclient-beta:jar:1.0:compile,
lib:apache-httpmime:jar:1.0:compile, lib:slf4j:jar:1.0:compile,
lib:logback-classic:jar:1.0:compile, lib:logback-core:jar:1.0:compile]
[DEBUG] Collected project classpath
[/home/hydra/workspace1/p0/target/classes]
[DEBUG] Adding to classpath : /home/hydra/workspace1/p0/target/classes
[DEBUG] Adding project dependency artifact: solrj to classpath
[DEBUG] Adding project dependency artifact: httpclient to classpath
[DEBUG] Adding project dependency artifact: httpcore to classpath
[DEBUG] Adding project dependency artifact: codec to classpath
[DEBUG] Adding project dependency artifact: logging to classpath
[DEBUG] Adding project dependency artifact: httpclient-beta to classpath
[DEBUG] Adding project dependency artifact: apache-httpmime to classpath
[DEBUG] Adding project dependency artifact: slf4j to classpath
[DEBUG] Adding project dependency artifact: logback-classic to classpath
[DEBUG] Adding project dependency artifact: logback-core to classpath
[DEBUG] joining on thread Thread[SolrJExample.main(),5,SolrJExample]
[WARNING]
java.lang.NoClassDefFoundError:
org/apache/http/conn/HttpClientConnectionManager
     at org.apache.solr.client.solrj.impl.HttpSolrClient.<init>
(HttpSolrClient.java:204)
     at org.apache.solr.client.solrj.impl.HttpSolrClient$Builder.build
(HttpSolrClient.java:968)
     at SolrJExample.getSolrClient (SolrJExample.java:189)
     at SolrJExample.<clinit> (SolrJExample.java:33)
     at jdk.internal.misc.Unsafe.ensureClassInitialized0 (Native Method)
     at jdk.internal.misc.Unsafe.ensureClassInitialized (Unsafe.java:1042)
     at
java.lang.invoke.DirectMethodHandle$EnsureInitialized.computeValue
(DirectMethodHandle.java:357)
     at
java.lang.invoke.DirectMethodHandle$EnsureInitialized.computeValue
(DirectMethodHandle.java:354)
     at java.lang.ClassValue.getFromHashMap (ClassValue.java:226)
     at java.lang.ClassValue.getFromBackup (ClassValue.java:208)
     at java.lang.ClassValue.get (ClassValue.java:114)
     at java.lang.invoke.DirectMethodHandle.checkInitialized
(DirectMethodHandle.java:378)
     at java.lang.invoke.DirectMethodHandle.ensureInitialized
(DirectMethodHandle.java:368)
     at java.lang.invoke.DirectMethodHandle.internalMemberNameEnsureInit
(DirectMethodHandle.java:318)
     at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
     at java.lang.Thread.run (Thread.java:834)
Caused by: java.lang.ClassNotFoundException:
org.apache.http.conn.HttpClientConnectionManager
     at java.net.URLClassLoader.findClass (URLClassLoader.java:471)
     at java.lang.ClassLoader.loadClass (ClassLoader.java:589)
     at java.lang.ClassLoader.loadClass (ClassLoader.java:522)
     at org.apache.solr.client.solrj.impl.HttpSolrClient.<init>
(HttpSolrClient.java:204)
     at org.apache.solr.client.solrj.impl.HttpSolrClient$Builder.build
(HttpSolrClient.java:968)
     at SolrJExample.getSolrClient (SolrJExample.java:189)
     at SolrJExample.<clinit> (SolrJExample.java:33)
     at jdk.internal.misc.Unsafe.ensureClassInitialized0 (Native Method)
     at jdk.internal.misc.Unsafe.ensureClassInitialized (Unsafe.java:1042)
     at
java.lang.invoke.DirectMethodHandle$EnsureInitialized.computeValue
(DirectMethodHandle.java:357)
     at
java.lang.invoke.DirectMethodHandle$EnsureInitialized.computeValue
(DirectMethodHandle.java:354)
     at java.lang.ClassValue.getFromHashMap (ClassValue.java:226)
     at java.lang.ClassValue.getFromBackup (ClassValue.java:208)
     at java.lang.ClassValue.get (ClassValue.java:114)
     at java.lang.invoke.DirectMethodHandle.checkInitialized
(DirectMethodHandle.java:378)
     at java.lang.invoke.DirectMethodHandle.ensureInitialized
(DirectMethodHandle.java:368)
     at java.lang.invoke.DirectMethodHandle.internalMemberNameEnsureInit
(DirectMethodHandle.java:318)
     at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
     at java.lang.Thread.run (Thread.java:834)

Looking forward

Raivo


On 31.10.20 14:02, Tomo Suzuki wrote:

> Hi Raivo,
>
> Interesting problem. Would you share the entire error message and minimum
> reproducible pom.xml?
>
> Tomo
>
> On Sat, Oct 31, 2020 at 07:17 Raivo Rebane <[hidden email]> wrote:
>
>> Hello
>>
>> If I use single httpclient.jar it doesn't find HttpClient.class
>>
>> if I duplicate dependencies wuidth addisional httpclient-beta.jar it
>> finds HttpClient.class
>>
>> Then it didn't find HttpClientConnectionManager.class witch exist in
>> both jars :
>>
>> org/apache/http/conn/OperatedClientConnection.class
>> org/apache/http/conn/ManagedClientConnection.class
>> org/apache/http/conn/ConnectionRequest.class
>> org/apache/http/conn/EofSensorInputStream.class
>> org/apache/http/conn/ClientConnectionOperator.class
>> org/apache/http/conn/HttpClientConnectionOperator.class
>> org/apache/http/conn/BasicManagedEntity.class
>> org/apache/http/conn/ConnectionKeepAliveStrategy.class
>> org/apache/http/conn/ManagedHttpClientConnection.class
>> org/apache/http/conn/BasicEofSensorWatcher.class
>> org/apache/http/conn/HttpClientConnectionManager.class
>> org/apache/http/conn/HttpRoutedConnection.class
>> org/apache/http/conn/EofSensorWatcher.class
>> org/apache/http/conn/SchemePortResolver.class
>> org/apache/http/conn/ClientConnectionManager.class
>>
>> What to do ?
>>
>> Regrds
>>
>> Raivo
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>> --
> Regards,
> Tomo
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: exec:java doesn't find classes from jar files

Tomo Suzuki
Given the error message below, would you verify the dependency tree (mvn
dependency:tree) to ensure the JAR file containing
HttpClientConnectionManager is selected.

[WARNING]
java.lang.NoClassDefFoundError:
org/apache/http/conn/HttpClientConnectionManager
     at org.apache.solr.client.solrj.impl.HttpSolrClient.<init>
(HttpSolrClient.java:204)
     at org.apache.solr.client.solrj.impl.HttpSolrClient$Builder.build
(HttpSolrClient.java:968)
     at SolrJExample.getSolrClient (SolrJExample.java:189)
     at SolrJExample.<clinit> (SolrJExample.java:33)
     at jdk.internal.misc.Unsafe.ensureClassInitialized0 (Native Method)


Depending on other dependencies, it's possible that different version of
the libraries are unexpectedly selected.

BTW, my team develops a tool to analyze the dependency conflicts:
https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/Linkage-Checker-Enforcer-Rule
(This might not work if your project relies on your own local repository,
not Maven central)


On Sat, Oct 31, 2020 at 1:52 PM Bernd Eckenfels <[hidden email]>
wrote:

> Hello,
>
> I don't think it is a good idea to repackage or relocate common external
> libraries. It looks like you moved everything to groupid=lib, this is a not
> very common Maven usage. I am not saying you can't get it to work, but it
> needs some advanced skills and it is unlikely we can easily help you.
>
> This might also be the reason why your transitive dependencies are no
> longer detected automatically, because you don't have the upstream POMs.
>
> Your particular error seems to be an effect of that,  maybe mixing
> different library versions.
>
> You can try to debug it by looking at "mvn dependency:tree"
>
> Gruss
> Bernd
>
>
> --
> http://bernd.eckenfels.net
> ________________________________
> Von: Raivo Rebane <[hidden email]>
> Gesendet: Saturday, October 31, 2020 2:20:21 PM
> An: [hidden email] <[hidden email]>
> Betreff: Re: exec:java doesn't find classes from jar files
>
> Hello
>
> My pom is as follows:
>
> <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>
>
>      <groupId>1</groupId>
>      <artifactId>p0</artifactId>
>      <version>0.0.1</version>
>
>      <name>A Solr project</name>
>      <url>http://www.devonlinux.net</url>
>
>      <properties>
>          <solr.version>3.r4.0</solr.version>
>          <solr.port>8983</solr.port>
>      </properties>
>
> <repositories>
>    <repository>
>      <id>project.local</id>
>      <name>project</name>
>      <url>file:${project.basedir}/repo</url>
>    </repository>
> </repositories>
>
>      <dependencies>
>
>          <dependency>
>            <groupId>lib</groupId>
>            <artifactId>solrj</artifactId>
>            <version>1.0</version>
>          </dependency>
>
>
>          <dependency>
>            <groupId>lib</groupId>
>            <artifactId>httpclient</artifactId>
>            <version>1.0</version>
>          </dependency>
>
>          <dependency>
>            <groupId>lib</groupId>
>            <artifactId>httpcore</artifactId>
>            <version>1.0</version>
>          </dependency>
>
>
>          <dependency>
>            <groupId>lib</groupId>
>            <artifactId>codec</artifactId>
>            <version>1.0</version>
>          </dependency>
>
>          <dependency>
>            <groupId>lib</groupId>
>            <artifactId>logging</artifactId>
>            <version>1.0</version>
>          </dependency>
>
>          <dependency>
>            <groupId>lib</groupId>
>            <artifactId>httpclient-beta</artifactId>
>            <version>1.0</version>
>          </dependency>
>
>          <dependency>
>            <groupId>lib</groupId>
>            <artifactId>apache-httpmime</artifactId>
>            <version>1.0</version>
>          </dependency>
>
>          <dependency>
>            <groupId>lib</groupId>
>            <artifactId>slf4j</artifactId>
>            <version>1.0</version>
>          </dependency>
>
>          <dependency>
>            <groupId>lib</groupId>
>            <artifactId>logback-classic</artifactId>
>            <version>1.0</version>
>          </dependency>
>
>          <dependency>
>            <groupId>lib</groupId>
>            <artifactId>logback-core</artifactId>
>            <version>1.0</version>
>          </dependency>
>
>      </dependencies>
>
>      <build>
>
>          <resources>
>              <resource>
> <directory>src/main/resources</directory>
>                  <filtering>true</filtering>
>              </resource>
>          </resources>
>
>          <plugins>
>
>
>      <plugin>
>          <groupId>org.apache.maven.plugins</groupId>
>          <artifactId>maven-compiler-plugin</artifactId>
>          <configuration>
>              <source>1.7</source>
>              <target>1.7</target>
>          </configuration>
>      </plugin>
>
>              <plugin>
>                  <groupId>org.mortbay.jetty</groupId>
> <artifactId>maven-jetty-plugin</artifactId>
>                  <version>6.1.25</version>
>                  <configuration>
> <scanIntervalSeconds>10</scanIntervalSeconds>
>                      <stopKey>foo</stopKey>
>                      <stopPort>9999</stopPort>
>                      <contextPath>/solr</contextPath>
>                      <connectors>
>                          <connector
> implementation="org.mortbay.jetty.nio.SelectChannelConnector">
>                              <port>${solr.port}</port>
> <maxIdleTime>60000</maxIdleTime>
>                          </connector>
>                      </connectors>
>                      <systemProperties>
>                          <systemProperty>
>                              <name>solr.data.dir</name>
>                              <value>target/data</value>
>                          </systemProperty>
>                      </systemProperties>
>                  </configuration>
>                  <executions>
>                      <execution>
>                          <id>start-jetty</id>
> <phase>pre-integration-test</phase>
>                          <goals>
>                              <goal>run</goal>
>                          </goals>
>                          <configuration>
>                              <daemon>true</daemon>
>                          </configuration>
>                      </execution>
>                      <execution>
>                          <id>stop-jetty</id>
> <phase>post-integration-test</phase>
>                          <goals>
>                              <goal>stop</goal>
>                          </goals>
>                      </execution>
>                  </executions>
>              </plugin>
>
>
>              <plugin>
>                  <groupId>org.owasp</groupId>
> <artifactId>dependency-check-maven</artifactId>
>                  <version>6.0.2</version>
>                  <configuration>
> <skipProvidedScope>true</skipProvidedScope>
> <skipRuntimeScope>true</skipRuntimeScope>
>                  </configuration>
>                  <executions>
>                      <execution>
>                          <goals>
>                              <goal>check</goal>
>                          </goals>
>                      </execution>
>                  </executions>
>              </plugin>
>
>              <plugin>
>                  <groupId>org.easyb</groupId>
> <artifactId>maven-easyb-plugin</artifactId>
>                  <version>1.3</version>
>                  <executions>
>                      <execution>
> <phase>integration-test</phase>
>                          <goals>
>                              <goal>test</goal>
>                          </goals>
>                      </execution>
>                  </executions>
>                  <configuration>
> <easybTestDirectory>${basedir}/src/test/stories</easybTestDirectory>
> <storyReport>${project.build.directory}/easyb-stories.txt</storyReport>
> <xmlReport>${project.build.directory}/easyb-report.xml</xmlReport>
>                      <storyType>html</storyType>
>
> <storyReport>${project.build.directory}/acceptance/stories.html</storyReport>
>                  </configuration>
>              </plugin>
>
>          </plugins>
>
>      </build>
> </project>
>
> And error message is as follows:
>
> Apache Maven 3.6.3
> Maven home: /usr/share/maven
> Java version: 11.0.9, vendor: Ubuntu, runtime:
> /usr/lib/jvm/java-11-openjdk-amd64
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "5.4.0-52-generic", arch: "amd64", family:
> "unix"
> WARNING: An illegal reflective access operation has occurred
> WARNING: Illegal reflective access by
> com.google.inject.internal.cglib.core.$ReflectUtils$1
> (file:/usr/share/maven/lib/guice.jar) to method
>
> java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
> WARNING: Please consider reporting this to the maintainers of
> com.google.inject.internal.cglib.core.$ReflectUtils$1
> WARNING: Use --illegal-access=warn to enable warnings of further illegal
> reflective access operations
> WARNING: All illegal access operations will be denied in a future release
> [DEBUG] Created new class realm maven.api
> [DEBUG] Importing foreign packages into class realm maven.api
> [DEBUG]   Imported: javax.annotation.* < plexus.core
> [DEBUG]   Imported: javax.annotation.security.* < plexus.core
> [DEBUG]   Imported: javax.enterprise.inject.* < plexus.core
> [DEBUG]   Imported: javax.enterprise.util.* < plexus.core
> [DEBUG]   Imported: javax.inject.* < plexus.core
> [DEBUG]   Imported: org.apache.maven.* < plexus.core
> [DEBUG]   Imported: org.apache.maven.artifact < plexus.core
> [DEBUG]   Imported: org.apache.maven.classrealm < plexus.core
> [DEBUG]   Imported: org.apache.maven.cli < plexus.core
> [DEBUG]   Imported: org.apache.maven.configuration < plexus.core
> [DEBUG]   Imported: org.apache.maven.exception < plexus.core
> [DEBUG]   Imported: org.apache.maven.execution < plexus.core
> [DEBUG]   Imported: org.apache.maven.execution.scope < plexus.core
> [DEBUG]   Imported: org.apache.maven.lifecycle < plexus.core
> [DEBUG]   Imported: org.apache.maven.model < plexus.core
> [DEBUG]   Imported: org.apache.maven.monitor < plexus.core
> [DEBUG]   Imported: org.apache.maven.plugin < plexus.core
> [DEBUG]   Imported: org.apache.maven.profiles < plexus.core
> [DEBUG]   Imported: org.apache.maven.project < plexus.core
> [DEBUG]   Imported: org.apache.maven.reporting < plexus.core
> [DEBUG]   Imported: org.apache.maven.repository < plexus.core
> [DEBUG]   Imported: org.apache.maven.rtinfo < plexus.core
> [DEBUG]   Imported: org.apache.maven.settings < plexus.core
> [DEBUG]   Imported: org.apache.maven.toolchain < plexus.core
> [DEBUG]   Imported: org.apache.maven.usability < plexus.core
> [DEBUG]   Imported: org.apache.maven.wagon.* < plexus.core
> [DEBUG]   Imported: org.apache.maven.wagon.authentication < plexus.core
> [DEBUG]   Imported: org.apache.maven.wagon.authorization < plexus.core
> [DEBUG]   Imported: org.apache.maven.wagon.events < plexus.core
> [DEBUG]   Imported: org.apache.maven.wagon.observers < plexus.core
> [DEBUG]   Imported: org.apache.maven.wagon.proxy < plexus.core
> [DEBUG]   Imported: org.apache.maven.wagon.repository < plexus.core
> [DEBUG]   Imported: org.apache.maven.wagon.resource < plexus.core
> [DEBUG]   Imported: org.codehaus.classworlds < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.* < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.classworlds < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.component < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.configuration < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.container < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.context < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.lifecycle < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.logging < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.personality < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser <
> plexus.core
> [DEBUG]   Imported:
> org.codehaus.plexus.util.xml.pull.XmlPullParserException < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer <
> plexus.core
> [DEBUG]   Imported: org.eclipse.aether.* < plexus.core
> [DEBUG]   Imported: org.eclipse.aether.artifact < plexus.core
> [DEBUG]   Imported: org.eclipse.aether.collection < plexus.core
> [DEBUG]   Imported: org.eclipse.aether.deployment < plexus.core
> [DEBUG]   Imported: org.eclipse.aether.graph < plexus.core
> [DEBUG]   Imported: org.eclipse.aether.impl < plexus.core
> [DEBUG]   Imported: org.eclipse.aether.installation < plexus.core
> [DEBUG]   Imported: org.eclipse.aether.internal.impl < plexus.core
> [DEBUG]   Imported: org.eclipse.aether.metadata < plexus.core
> [DEBUG]   Imported: org.eclipse.aether.repository < plexus.core
> [DEBUG]   Imported: org.eclipse.aether.resolution < plexus.core
> [DEBUG]   Imported: org.eclipse.aether.spi < plexus.core
> [DEBUG]   Imported: org.eclipse.aether.transfer < plexus.core
> [DEBUG]   Imported: org.eclipse.aether.version < plexus.core
> [DEBUG]   Imported: org.fusesource.jansi.* < plexus.core
> [DEBUG]   Imported: org.slf4j.* < plexus.core
> [DEBUG]   Imported: org.slf4j.event.* < plexus.core
> [DEBUG]   Imported: org.slf4j.helpers.* < plexus.core
> [DEBUG]   Imported: org.slf4j.spi.* < plexus.core
> [DEBUG] Populating class realm maven.api
> [INFO] Error stacktraces are turned on.
> [DEBUG] Message scheme: color
> [DEBUG] Message styles: debug info warning error success failure strong
> mojo project
> [DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml
> [DEBUG] Reading user settings from /home/hydra/.m2/settings.xml
> [DEBUG] Reading global toolchains from /usr/share/maven/conf/toolchains.xml
> [DEBUG] Reading user toolchains from /home/hydra/.m2/toolchains.xml
> [DEBUG] Using local repository at /home/hydra/.m2/repository
> [DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0
> for /home/hydra/.m2/repository
> [INFO] Scanning for projects...
> [DEBUG] Extension realms for project 1:p0:jar:0.0.1: (none)
> [DEBUG] Looking up lifecycle mappings for packaging jar from
> ClassRealm[plexus.core, parent: null]
> [WARNING]
> [WARNING] Some problems were encountered while building the effective
> model for 1:p0:jar:0.0.1
> [WARNING] 'build.plugins.plugin.version' for
> org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 171,
> column 13
> [WARNING]
> [WARNING] It is highly recommended to fix these problems because they
> threaten the stability of your build.
> [WARNING]
> [WARNING] For this reason, future Maven versions might no longer support
> building such malformed projects.
> [WARNING]
> [DEBUG] Resolving plugin prefix exec from [org.apache.maven.plugins,
> org.codehaus.mojo]
> [DEBUG] Could not find metadata
> org.apache.maven.plugins/maven-metadata.xml in local
> (/home/hydra/.m2/repository)
> [DEBUG] Skipped remote request for
> org.apache.maven.plugins/maven-metadata.xml, locally cached metadata
> up-to-date.
> [DEBUG] Could not find metadata org.codehaus.mojo/maven-metadata.xml in
> local (/home/hydra/.m2/repository)
> [DEBUG] Skipped remote request for org.codehaus.mojo/maven-metadata.xml,
> locally cached metadata up-to-date.
> [DEBUG] Resolved plugin prefix exec to
> org.codehaus.mojo:exec-maven-plugin from repository central
> [DEBUG] Could not find metadata
> org.codehaus.mojo:exec-maven-plugin/maven-metadata.xml in local
> (/home/hydra/.m2/repository)
> [DEBUG] Skipped remote request for
> org.codehaus.mojo:exec-maven-plugin/maven-metadata.xml, locally cached
> metadata up-to-date.
> [DEBUG] Resolved plugin version for org.codehaus.mojo:exec-maven-plugin
> to 3.0.0 from repository central (https://repo.maven.apache.org/maven2,
> default, releases)
> [DEBUG] === REACTOR BUILD PLAN
> ================================================
> [DEBUG] Project: 1:p0:jar:0.0.1
> [DEBUG] Tasks:   [exec:java]
> [DEBUG] Style:   Regular
> [DEBUG]
> =======================================================================
> [INFO]
> [INFO] --------------------------------< 1:p0
>  >--------------------------------
> [INFO] Building A Solr project 0.0.1
> [INFO] --------------------------------[ jar
> ]---------------------------------
> [DEBUG] Resolving plugin prefix exec from [org.apache.maven.plugins,
> org.codehaus.mojo]
> [DEBUG] Could not find metadata
> org.apache.maven.plugins/maven-metadata.xml in local
> (/home/hydra/.m2/repository)
> [DEBUG] Skipped remote request for
> org.apache.maven.plugins/maven-metadata.xml, locally cached metadata
> up-to-date.
> [DEBUG] Could not find metadata org.codehaus.mojo/maven-metadata.xml in
> local (/home/hydra/.m2/repository)
> [DEBUG] Skipped remote request for org.codehaus.mojo/maven-metadata.xml,
> locally cached metadata up-to-date.
> [DEBUG] Resolved plugin prefix exec to
> org.codehaus.mojo:exec-maven-plugin from repository central
> [DEBUG] Could not find metadata
> org.codehaus.mojo:exec-maven-plugin/maven-metadata.xml in local
> (/home/hydra/.m2/repository)
> [DEBUG] Skipped remote request for
> org.codehaus.mojo:exec-maven-plugin/maven-metadata.xml, locally cached
> metadata up-to-date.
> [DEBUG] Resolved plugin version for org.codehaus.mojo:exec-maven-plugin
> to 3.0.0 from repository central (https://repo.maven.apache.org/maven2,
> default, releases)
> [DEBUG] Lifecycle default -> [validate, initialize, generate-sources,
> process-sources, generate-resources, process-resources, compile,
> process-classes, generate-test-sources, process-test-sources,
> generate-test-resources, process-test-resources, test-compile,
> process-test-classes, test, prepare-package, package,
> pre-integration-test, integration-test, post-integration-test, verify,
> install, deploy]
> [DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
> [DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
> [DEBUG] === PROJECT BUILD PLAN
> ================================================
> [DEBUG] Project:       1:p0:0.0.1
> [DEBUG] Dependencies (collect): []
> [DEBUG] Dependencies (resolve): [test]
> [DEBUG] Repositories (dependencies): [project.local
> (file:/home/hydra/workspace1/p0/repo, default, releases+snapshots),
> central (https://repo.maven.apache.org/maven2, default, releases)]
> [DEBUG] Repositories (plugins)     : [central
> (https://repo.maven.apache.org/maven2, default, releases)]
> [DEBUG]
> -----------------------------------------------------------------------
> [DEBUG] Goal: org.codehaus.mojo:exec-maven-plugin:3.0.0:java (default-cli)
> [DEBUG] Style:         Regular
> [DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
> <configuration>
>    <addOutputToClasspath
> default-value="true">${addOutputToClasspath}</addOutputToClasspath>
>    <addResourcesToClasspath
> default-value="false">${addResourcesToClasspath}</addResourcesToClasspath>
>    <arguments>${exec.arguments}</arguments>
>    <classpathScope
> default-value="runtime">${exec.classpathScope}</classpathScope>
>    <cleanupDaemonThreads
> default-value="true">${exec.cleanupDaemonThreads}</cleanupDaemonThreads>
>    <commandlineArgs>${exec.args}</commandlineArgs>
>    <daemonThreadJoinTimeout
>
> default-value="15000">${exec.daemonThreadJoinTimeout}</daemonThreadJoinTimeout>
>    <includePluginDependencies
>
> default-value="false">${exec.includePluginsDependencies}</includePluginDependencies>
>    <includeProjectDependencies
>
> default-value="true">${exec.includeProjectDependencies}</includeProjectDependencies>
>    <keepAlive default-value="false">${exec.keepAlive}</keepAlive>
>    <killAfter default-value="-1">${exec.killAfter}</killAfter>
>    <mainClass>${exec.mainClass}</mainClass>
>    <plugin default-value="${plugin}"/>
>    <pluginDependencies default-value="${plugin.artifacts}"/>
>    <project default-value="${project}"/>
>    <session default-value="${session}"/>
>    <skip default-value="false">${exec.skip}</skip>
>    <sourceRoot>${sourceRoot}</sourceRoot>
>    <stopUnresponsiveDaemonThreads
>
> default-value="false">${exec.stopUnresponsiveDaemonThreads}</stopUnresponsiveDaemonThreads>
>    <testSourceRoot>${testSourceRoot}</testSourceRoot>
> </configuration>
> [DEBUG]
> =======================================================================
> [DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=516192,
> ConflictMarker.markTime=332042, ConflictMarker.nodeCount=11,
> ConflictIdSorter.graphTime=294827, ConflictIdSorter.topsortTime=2838477,
> ConflictIdSorter.conflictIdCount=10,
> ConflictIdSorter.conflictIdCycleCount=0,
> ConflictResolver.totalTime=4584323,
> ConflictResolver.conflictItemCount=10,
> DefaultDependencyCollector.collectTime=31459895,
> DefaultDependencyCollector.transformTime=10101662}
> [DEBUG] 1:p0:jar:0.0.1
> [DEBUG]    lib:solrj:jar:1.0:compile
> [DEBUG]    lib:httpclient:jar:1.0:compile
> [DEBUG]    lib:httpcore:jar:1.0:compile
> [DEBUG]    lib:codec:jar:1.0:compile
> [DEBUG]    lib:logging:jar:1.0:compile
> [DEBUG]    lib:httpclient-beta:jar:1.0:compile
> [DEBUG]    lib:apache-httpmime:jar:1.0:compile
> [DEBUG]    lib:slf4j:jar:1.0:compile
> [DEBUG]    lib:logback-classic:jar:1.0:compile
> [DEBUG]    lib:logback-core:jar:1.0:compile
> [INFO]
> [INFO] --- exec-maven-plugin:3.0.0:java (default-cli) @ p0 ---
> [DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=325150,
> ConflictMarker.markTime=2163066, ConflictMarker.nodeCount=127,
> ConflictIdSorter.graphTime=290464, ConflictIdSorter.topsortTime=26735,
> ConflictIdSorter.conflictIdCount=30,
> ConflictIdSorter.conflictIdCycleCount=0,
> ConflictResolver.totalTime=2861730,
> ConflictResolver.conflictItemCount=74,
> DefaultDependencyCollector.collectTime=164187130,
> DefaultDependencyCollector.transformTime=5725131}
> [DEBUG] org.codehaus.mojo:exec-maven-plugin:jar:3.0.0
> [DEBUG]    org.apache.maven:maven-model:jar:3.0:compile
> [DEBUG]    org.apache.maven:maven-artifact:jar:3.0:compile
> [DEBUG]    org.apache.maven:maven-core:jar:3.0:compile
> [DEBUG]       org.apache.maven:maven-settings:jar:3.0:compile
> [DEBUG] org.apache.maven:maven-settings-builder:jar:3.0:compile
> [DEBUG] org.apache.maven:maven-repository-metadata:jar:3.0:compile
> [DEBUG]       org.apache.maven:maven-model-builder:jar:3.0:compile
> [DEBUG] org.apache.maven:maven-aether-provider:jar:3.0:runtime
> [DEBUG]       org.sonatype.aether:aether-impl:jar:1.7:compile
> [DEBUG]          org.sonatype.aether:aether-spi:jar:1.7:compile
> [DEBUG]       org.sonatype.aether:aether-api:jar:1.7:compile
> [DEBUG]       org.sonatype.aether:aether-util:jar:1.7:compile
> [DEBUG] org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2:compile
> [DEBUG] org.sonatype.sisu:sisu-inject-bean:jar:1.4.2:compile
> [DEBUG] org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7:compile
> [DEBUG] org.codehaus.plexus:plexus-interpolation:jar:1.14:compile
> [DEBUG] org.codehaus.plexus:plexus-classworlds:jar:2.2.3:compile
> [DEBUG] org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile
> [DEBUG]          org.sonatype.plexus:plexus-cipher:jar:1.4:compile
> [DEBUG]    org.apache.maven:maven-plugin-api:jar:3.0:compile
> [DEBUG]    org.codehaus.plexus:plexus-utils:jar:3.0.20:compile
> [DEBUG] org.codehaus.plexus:plexus-component-annotations:jar:1.6:compile
> (optional)
> [DEBUG]    org.apache.commons:commons-exec:jar:1.3:compile
> [DEBUG] org.apache.maven.shared:maven-artifact-transfer:jar:0.10.1:compile
> [DEBUG]
> org.apache.maven.shared:maven-common-artifact-filters:jar:3.0.1:compile
> [DEBUG] org.apache.maven.shared:maven-shared-utils:jar:3.1.0:compile
> [DEBUG]             commons-io:commons-io:jar:2.5:compile
> [DEBUG]       commons-codec:commons-codec:jar:1.11:compile
> [DEBUG]       org.slf4j:slf4j-api:jar:1.7.5:compile
> [DEBUG] Created new class realm
> plugin>org.codehaus.mojo:exec-maven-plugin:3.0.0
> [DEBUG] Importing foreign packages into class realm
> plugin>org.codehaus.mojo:exec-maven-plugin:3.0.0
> [DEBUG]   Imported:  < maven.api
> [DEBUG] Populating class realm
> plugin>org.codehaus.mojo:exec-maven-plugin:3.0.0
> [DEBUG]   Included: org.codehaus.mojo:exec-maven-plugin:jar:3.0.0
> [DEBUG]   Included: org.sonatype.aether:aether-util:jar:1.7
> [DEBUG]   Included: org.sonatype.sisu:sisu-inject-bean:jar:1.4.2
> [DEBUG]   Included: org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7
> [DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.14
> [DEBUG]   Included: org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3
> [DEBUG]   Included: org.sonatype.plexus:plexus-cipher:jar:1.4
> [DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.0.20
> [DEBUG]   Included:
> org.codehaus.plexus:plexus-component-annotations:jar:1.6
> [DEBUG]   Included: org.apache.commons:commons-exec:jar:1.3
> [DEBUG]   Included:
> org.apache.maven.shared:maven-artifact-transfer:jar:0.10.1
> [DEBUG]   Included:
> org.apache.maven.shared:maven-common-artifact-filters:jar:3.0.1
> [DEBUG]   Included: org.apache.maven.shared:maven-shared-utils:jar:3.1.0
> [DEBUG]   Included: commons-io:commons-io:jar:2.5
> [DEBUG]   Included: commons-codec:commons-codec:jar:1.11
> [DEBUG] Configuring mojo org.codehaus.mojo:exec-maven-plugin:3.0.0:java
> from plugin realm
> ClassRealm[plugin>org.codehaus.mojo:exec-maven-plugin:3.0.0, parent:
> jdk.internal.loader.ClassLoaders$AppClassLoader@55054057]
> [DEBUG] Configuring mojo
> 'org.codehaus.mojo:exec-maven-plugin:3.0.0:java' with basic configurator
> -->
> [DEBUG]   (f) addOutputToClasspath = true
> [DEBUG]   (f) addResourcesToClasspath = false
> [DEBUG]   (f) arguments = []
> [DEBUG]   (f) classpathScope = runtime
> [DEBUG]   (f) cleanupDaemonThreads = true
> [DEBUG]   (f) daemonThreadJoinTimeout = 15000
> [DEBUG]   (f) includePluginDependencies = false
> [DEBUG]   (f) includeProjectDependencies = true
> [DEBUG]   (f) keepAlive = false
> [DEBUG]   (f) killAfter = -1
> [DEBUG]   (f) mainClass = SolrJExample
> [DEBUG]   (f) plugin = Component Descriptor: role:
> 'org.apache.maven.plugin.Mojo', implementation:
> 'org.codehaus.mojo.exec.ExecMojo', role hint:
> 'org.codehaus.mojo:exec-maven-plugin:3.0.0:exec'
> role: 'org.apache.maven.plugin.Mojo', implementation:
> 'org.codehaus.mojo.exec.HelpMojo', role hint:
> 'org.codehaus.mojo:exec-maven-plugin:3.0.0:help'
> role: 'org.apache.maven.plugin.Mojo', implementation:
> 'org.codehaus.mojo.exec.ExecJavaMojo', role hint:
> 'org.codehaus.mojo:exec-maven-plugin:3.0.0:java'
> ---
> [DEBUG]   (f) pluginDependencies =
> [org.codehaus.mojo:exec-maven-plugin:maven-plugin:3.0.0:,
> org.apache.maven:maven-model:jar:3.0:compile,
> org.apache.maven:maven-artifact:jar:3.0:compile,
> org.apache.maven:maven-core:jar:3.0:compile,
> org.apache.maven:maven-settings:jar:3.0:compile,
> org.apache.maven:maven-settings-builder:jar:3.0:compile,
> org.apache.maven:maven-repository-metadata:jar:3.0:compile,
> org.apache.maven:maven-model-builder:jar:3.0:compile,
> org.apache.maven:maven-aether-provider:jar:3.0:runtime,
> org.sonatype.aether:aether-impl:jar:1.7:compile,
> org.sonatype.aether:aether-spi:jar:1.7:compile,
> org.sonatype.aether:aether-api:jar:1.7:compile,
> org.sonatype.aether:aether-util:jar:1.7:compile,
> org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2:compile,
> org.sonatype.sisu:sisu-inject-bean:jar:1.4.2:compile,
> org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7:compile,
> org.codehaus.plexus:plexus-interpolation:jar:1.14:compile,
> org.codehaus.plexus:plexus-classworlds:jar:2.2.3:compile,
> org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile,
> org.sonatype.plexus:plexus-cipher:jar:1.4:compile,
> org.apache.maven:maven-plugin-api:jar:3.0:compile,
> org.codehaus.plexus:plexus-utils:jar:3.0.20:compile,
> org.codehaus.plexus:plexus-component-annotations:jar:1.6:compile,
> org.apache.commons:commons-exec:jar:1.3:compile,
> org.apache.maven.shared:maven-artifact-transfer:jar:0.10.1:compile,
> org.apache.maven.shared:maven-common-artifact-filters:jar:3.0.1:compile,
> org.apache.maven.shared:maven-shared-utils:jar:3.1.0:compile,
> commons-io:commons-io:jar:2.5:compile,
> commons-codec:commons-codec:jar:1.11:compile,
> org.slf4j:slf4j-api:jar:1.7.5:compile]
> [DEBUG]   (f) project = MavenProject: 1:p0:0.0.1 @
> /home/hydra/workspace1/p0/pom.xml
> [DEBUG]   (f) session = org.apache.maven.execution.MavenSession@2add4d24
> [DEBUG]   (f) skip = false
> [DEBUG]   (f) stopUnresponsiveDaemonThreads = false
> [DEBUG] -- end configuration --
> [DEBUG] Invoking : SolrJExample.main()
> [DEBUG] Plugin Dependencies will be excluded.
> [DEBUG] Project Dependencies will be included.
> [DEBUG] Collected project artifacts [lib:solrj:jar:1.0:compile,
> lib:httpclient:jar:1.0:compile, lib:httpcore:jar:1.0:compile,
> lib:codec:jar:1.0:compile, lib:logging:jar:1.0:compile,
> lib:httpclient-beta:jar:1.0:compile,
> lib:apache-httpmime:jar:1.0:compile, lib:slf4j:jar:1.0:compile,
> lib:logback-classic:jar:1.0:compile, lib:logback-core:jar:1.0:compile]
> [DEBUG] Collected project classpath
> [/home/hydra/workspace1/p0/target/classes]
> [DEBUG] Adding to classpath : /home/hydra/workspace1/p0/target/classes
> [DEBUG] Adding project dependency artifact: solrj to classpath
> [DEBUG] Adding project dependency artifact: httpclient to classpath
> [DEBUG] Adding project dependency artifact: httpcore to classpath
> [DEBUG] Adding project dependency artifact: codec to classpath
> [DEBUG] Adding project dependency artifact: logging to classpath
> [DEBUG] Adding project dependency artifact: httpclient-beta to classpath
> [DEBUG] Adding project dependency artifact: apache-httpmime to classpath
> [DEBUG] Adding project dependency artifact: slf4j to classpath
> [DEBUG] Adding project dependency artifact: logback-classic to classpath
> [DEBUG] Adding project dependency artifact: logback-core to classpath
> [DEBUG] joining on thread Thread[SolrJExample.main(),5,SolrJExample]
> [WARNING]
> java.lang.NoClassDefFoundError:
> org/apache/http/conn/HttpClientConnectionManager
>      at org.apache.solr.client.solrj.impl.HttpSolrClient.<init>
> (HttpSolrClient.java:204)
>      at org.apache.solr.client.solrj.impl.HttpSolrClient$Builder.build
> (HttpSolrClient.java:968)
>      at SolrJExample.getSolrClient (SolrJExample.java:189)
>      at SolrJExample.<clinit> (SolrJExample.java:33)
>      at jdk.internal.misc.Unsafe.ensureClassInitialized0 (Native Method)
>      at jdk.internal.misc.Unsafe.ensureClassInitialized (Unsafe.java:1042)
>      at
> java.lang.invoke.DirectMethodHandle$EnsureInitialized.computeValue
> (DirectMethodHandle.java:357)
>      at
> java.lang.invoke.DirectMethodHandle$EnsureInitialized.computeValue
> (DirectMethodHandle.java:354)
>      at java.lang.ClassValue.getFromHashMap (ClassValue.java:226)
>      at java.lang.ClassValue.getFromBackup (ClassValue.java:208)
>      at java.lang.ClassValue.get (ClassValue.java:114)
>      at java.lang.invoke.DirectMethodHandle.checkInitialized
> (DirectMethodHandle.java:378)
>      at java.lang.invoke.DirectMethodHandle.ensureInitialized
> (DirectMethodHandle.java:368)
>      at java.lang.invoke.DirectMethodHandle.internalMemberNameEnsureInit
> (DirectMethodHandle.java:318)
>      at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
>      at java.lang.Thread.run (Thread.java:834)
> Caused by: java.lang.ClassNotFoundException:
> org.apache.http.conn.HttpClientConnectionManager
>      at java.net.URLClassLoader.findClass (URLClassLoader.java:471)
>      at java.lang.ClassLoader.loadClass (ClassLoader.java:589)
>      at java.lang.ClassLoader.loadClass (ClassLoader.java:522)
>      at org.apache.solr.client.solrj.impl.HttpSolrClient.<init>
> (HttpSolrClient.java:204)
>      at org.apache.solr.client.solrj.impl.HttpSolrClient$Builder.build
> (HttpSolrClient.java:968)
>      at SolrJExample.getSolrClient (SolrJExample.java:189)
>      at SolrJExample.<clinit> (SolrJExample.java:33)
>      at jdk.internal.misc.Unsafe.ensureClassInitialized0 (Native Method)
>      at jdk.internal.misc.Unsafe.ensureClassInitialized (Unsafe.java:1042)
>      at
> java.lang.invoke.DirectMethodHandle$EnsureInitialized.computeValue
> (DirectMethodHandle.java:357)
>      at
> java.lang.invoke.DirectMethodHandle$EnsureInitialized.computeValue
> (DirectMethodHandle.java:354)
>      at java.lang.ClassValue.getFromHashMap (ClassValue.java:226)
>      at java.lang.ClassValue.getFromBackup (ClassValue.java:208)
>      at java.lang.ClassValue.get (ClassValue.java:114)
>      at java.lang.invoke.DirectMethodHandle.checkInitialized
> (DirectMethodHandle.java:378)
>      at java.lang.invoke.DirectMethodHandle.ensureInitialized
> (DirectMethodHandle.java:368)
>      at java.lang.invoke.DirectMethodHandle.internalMemberNameEnsureInit
> (DirectMethodHandle.java:318)
>      at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
>      at java.lang.Thread.run (Thread.java:834)
>
> Looking forward
>
> Raivo
>
>
> On 31.10.20 14:02, Tomo Suzuki wrote:
>
> > Hi Raivo,
> >
> > Interesting problem. Would you share the entire error message and minimum
> > reproducible pom.xml?
> >
> > Tomo
> >
> > On Sat, Oct 31, 2020 at 07:17 Raivo Rebane <[hidden email]> wrote:
> >
> >> Hello
> >>
> >> If I use single httpclient.jar it doesn't find HttpClient.class
> >>
> >> if I duplicate dependencies wuidth addisional httpclient-beta.jar it
> >> finds HttpClient.class
> >>
> >> Then it didn't find HttpClientConnectionManager.class witch exist in
> >> both jars :
> >>
> >> org/apache/http/conn/OperatedClientConnection.class
> >> org/apache/http/conn/ManagedClientConnection.class
> >> org/apache/http/conn/ConnectionRequest.class
> >> org/apache/http/conn/EofSensorInputStream.class
> >> org/apache/http/conn/ClientConnectionOperator.class
> >> org/apache/http/conn/HttpClientConnectionOperator.class
> >> org/apache/http/conn/BasicManagedEntity.class
> >> org/apache/http/conn/ConnectionKeepAliveStrategy.class
> >> org/apache/http/conn/ManagedHttpClientConnection.class
> >> org/apache/http/conn/BasicEofSensorWatcher.class
> >> org/apache/http/conn/HttpClientConnectionManager.class
> >> org/apache/http/conn/HttpRoutedConnection.class
> >> org/apache/http/conn/EofSensorWatcher.class
> >> org/apache/http/conn/SchemePortResolver.class
> >> org/apache/http/conn/ClientConnectionManager.class
> >>
> >> What to do ?
> >>
> >> Regrds
> >>
> >> Raivo
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >> --
> > Regards,
> > Tomo
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

--
Regards,
Tomo