exex:java problems with finding class

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

exex:java problems with finding class

Raivo Rebane
Hello

Hello

I run following command:

mvn exec:java -Dexec.mainClass="SolrJExample" -X

and get following error :

java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient

I use projct repo and dependencies is:

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

         <dependency>
           <groupId>lib</groupId>
           <artifactId>solrj</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>

Command seems uses them:

[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

httpclient contains jar what contains following classes screenshot attached

Why java don't find them ?

Regars

Raivo




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: exex:java problems with finding class

Raivo Rebane
The screenshot is not delivered

I add class list got by command jar tf
repo/lib/httpclient/1.0/httpclient-1.0.jar here:

org/apache/http/client/version.properties
org/apache/http/client/AuthenticationStrategy.class
org/apache/http/client/HttpClient.class
org/apache/http/client/methods/HttpOptions.class
org/apache/http/client/methods/AbortableHttpRequest.class
org/apache/http/client/methods/HttpRequestBase.class
org/apache/http/client/methods/AbstractExecutionAwareRequest$2.class
org/apache/http/client/methods/RequestBuilder.class
org/apache/http/client/methods/HttpGet.class
org/apache/http/client/methods/HttpPatch.class
org/apache/http/client/methods/HttpDelete.class
org/apache/http/client/methods/HttpUriRequest.class
org/apache/http/client/methods/CloseableHttpResponse.class
org/apache/http/client/methods/HttpRequestWrapper$1.class
org/apache/http/client/methods/RequestBuilder$InternalEntityEclosingRequest.class
org/apache/http/client/methods/HttpRequestWrapper$HttpEntityEnclosingRequestWrapper.class
org/apache/http/client/methods/RequestBuilder$InternalRequest.class
org/apache/http/client/methods/HttpRequestWrapper.class
org/apache/http/client/methods/HttpHead.class
org/apache/http/client/methods/HttpExecutionAware.class
org/apache/http/client/methods/AbstractExecutionAwareRequest.class
org/apache/http/client/methods/Configurable.class
org/apache/http/client/methods/AbstractExecutionAwareRequest$1.class
org/apache/http/client/methods/HttpPost.class
org/apache/http/client/methods/HttpEntityEnclosingRequestBase.class
org/apache/http/client/methods/HttpTrace.class
org/apache/http/client/methods/HttpPut.class
org/apache/http/client/CredentialsProvider.class
org/apache/http/client/UserTokenHandler.class
org/apache/http/client/CookieStore.class
org/apache/http/client/HttpResponseException.class
org/apache/http/client/ClientProtocolException.class
org/apache/http/client/AuthenticationHandler.class
org/apache/http/client/params/HttpClientParams.class
org/apache/http/client/params/ClientPNames.class
org/apache/http/client/params/ClientParamBean.class
org/apache/http/client/params/CookiePolicy.class
org/apache/http/client/params/AuthPolicy.class
org/apache/http/client/params/HttpClientParamConfig.class
org/apache/http/client/params/AllClientPNames.class
org/apache/http/client/CircularRedirectException.class
org/apache/http/client/utils/Punycode.class
org/apache/http/client/utils/Idn.class
org/apache/http/client/utils/HttpClientUtils.class
org/apache/http/client/utils/URIBuilder.class
org/apache/http/client/utils/URIUtils.class
org/apache/http/client/utils/DateUtils$DateFormatHolder.class
org/apache/http/client/utils/URLEncodedUtils.class
org/apache/http/client/utils/JdkIdn.class
org/apache/http/client/utils/CloneUtils.class
org/apache/http/client/utils/DateUtils.class
org/apache/http/client/utils/Rfc3492Idn.class
org/apache/http/client/protocol/RequestAcceptEncoding.class
org/apache/http/client/protocol/ResponseProcessCookies.class
org/apache/http/client/protocol/RequestDefaultHeaders.class
org/apache/http/client/protocol/ResponseContentEncoding$2.class
org/apache/http/client/protocol/ClientContext.class
org/apache/http/client/protocol/ResponseAuthCache.class
org/apache/http/client/protocol/RequestAuthenticationBase$1.class
org/apache/http/client/protocol/RequestTargetAuthentication.class
org/apache/http/client/protocol/RequestProxyAuthentication.class
org/apache/http/client/protocol/RequestClientConnControl.class
org/apache/http/client/protocol/ResponseAuthCache$1.class
org/apache/http/client/protocol/RequestAddCookies.class
org/apache/http/client/protocol/RequestAuthCache.class
org/apache/http/client/protocol/ClientContextConfigurer.class
org/apache/http/client/protocol/ResponseContentEncoding$1.class
org/apache/http/client/protocol/RequestExpectContinue.class
org/apache/http/client/protocol/ResponseContentEncoding.class
org/apache/http/client/protocol/RequestAuthenticationBase.class
org/apache/http/client/protocol/HttpClientContext.class
org/apache/http/client/BackoffManager.class
org/apache/http/client/config/RequestConfig$Builder.class
org/apache/http/client/config/RequestConfig.class
org/apache/http/client/config/CookieSpecs.class
org/apache/http/client/config/AuthSchemes.class
org/apache/http/client/AuthCache.class
org/apache/http/client/ResponseHandler.class
org/apache/http/client/RedirectException.class
org/apache/http/client/RedirectHandler.class
org/apache/http/client/NonRepeatableRequestException.class
org/apache/http/client/entity/DeflateInputStream.class
org/apache/http/client/entity/InputStreamFactory.class
org/apache/http/client/entity/UrlEncodedFormEntity.class
org/apache/http/client/entity/DeflateInputStream$DeflateStream.class
org/apache/http/client/entity/GzipCompressingEntity.class
org/apache/http/client/entity/EntityBuilder.class
org/apache/http/client/entity/LazyDecompressingInputStream.class
org/apache/http/client/entity/DecompressingEntity.class
org/apache/http/client/entity/GzipDecompressingEntity$1.class
org/apache/http/client/entity/DeflateDecompressingEntity$1.class
org/apache/http/client/entity/GzipDecompressingEntity.class
org/apache/http/client/entity/DeflateDecompressingEntity.class
org/apache/http/client/HttpRequestRetryHandler.class
org/apache/http/client/RequestDirector.class
org/apache/http/client/ServiceUnavailableRetryStrategy.class

Raivo

On 31.10.20 11:43, Raivo Rebane wrote:

> Hello
>
> Hello
>
> I run following command:
>
> mvn exec:java -Dexec.mainClass="SolrJExample" -X
>
> and get following error :
>
> java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient
>
> I use projct repo and dependencies is:
>
>         <dependency>
>           <groupId>lib</groupId>
>           <artifactId>httpclient</artifactId>
>           <version>1.0</version>
>         </dependency>
>
>         <dependency>
>           <groupId>lib</groupId>
>           <artifactId>solrj</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>
>
> Command seems uses them:
>
> [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
>
> httpclient contains jar what contains following classes screenshot
> attached
>
> Why java don't find them ?
>
> Regars
>
> Raivo
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

exex:java problems with finding class

Raivo Rebane
Hello again

is the order of dependencies plays mattter ?

Raivo

On 31.10.20 12:07, Raivo Rebane wrote:

>
> The screenshot is not delivered
>
> I add class list got by command jar tf
> repo/lib/httpclient/1.0/httpclient-1.0.jar here:
>
> org/apache/http/client/version.properties
> org/apache/http/client/AuthenticationStrategy.class
> org/apache/http/client/HttpClient.class
> org/apache/http/client/CredentialsProvider.class
> org/apache/http/client/UserTokenHandler.class
> org/apache/http/client/CookieStore.class
> org/apache/http/client/HttpResponseException.class
> org/apache/http/client/ClientProtocolException.class
> org/apache/http/client/AuthenticationHandler.class
> org/apache/http/client/params/HttpClientParams.class
> org/apache/http/client/params/ClientPNames.class
> org/apache/http/client/params/ClientParamBean.class
> org/apache/http/client/params/CookiePolicy.class
> org/apache/http/client/params/AuthPolicy.class
> org/apache/http/client/params/HttpClientParamConfig.class
> org/apache/http/client/params/AllClientPNames.class
> org/apache/http/client/CircularRedirectException.class
> org/apache/http/client/HttpRequestRetryHandler.class
> org/apache/http/client/RequestDirector.class
> org/apache/http/client/ServiceUnavailableRetryStrategy.class
>
> Raivo
>
> On 31.10.20 11:43, Raivo Rebane wrote:
>> Hello
>>
>> Hello
>>
>> I run following command:
>>
>> mvn exec:java -Dexec.mainClass="SolrJExample" -X
>>
>> and get following error :
>>
>> java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient
>>
>> I use projct repo and dependencies is:
>>
>>         <dependency>
>>           <groupId>lib</groupId>
>>           <artifactId>httpclient</artifactId>
>>           <version>1.0</version>
>>         </dependency>
>>
>>         <dependency>
>>           <groupId>lib</groupId>
>>           <artifactId>solrj</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>
>>
>> Command seems uses them:
>>
>> [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
>>
>> httpclient contains jar what contains following classes screenshot
>> attached
>>
>> Why java don't find them ?
>>
>> Regars
>>
>> Raivo
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:[hidden email]
>> For additional commands, e-mail:[hidden email]