Using OpenAi's Gym Java Client - java

I'm trying to utilise the Java port of OpenAi's gym - as I've been using Java instead of Python.
I've cloned the gym's repo which is a submodule of the "mono-repo".
Within my project, in IntelliJ, I setup a dependency on the gym project (source code) but nothing's getting picked up.
After opening the gym project itself, within IntelliJ, none of the dependencies are being resolved, and the maven pom.xml file has a multitude of errors.
The first error is to the with the unrecognised parent module (the mono-repo).
<parent>
<groupId>org.deeplearning4j</groupId>
<artifactId>deeplearning4j</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
I tried setting up / building the mono-repo to no avail. I also was trying to figure out whether building the entire mono-repo was necessary - and not simply just including a load of redundant dependencies / modules.
Has anyone actually made use of this Java Client?
The repo has extremely brief documentation, and I've not seen any example usages online
EDIT
Since posting this question the gym stuff has been removed from the deeplearning4j repository.
There still seems to be an implementation in the rl4j repository, which I've managed to pull as a maven dependency into my project.
When trying to run a basic cartpole example I get the error:
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" java.util.concurrent.ExecutionException: java.lang.RuntimeException: Connection error
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at dentai.main.main(main.java:111)
Caused by: java.lang.RuntimeException: Connection error
at org.deeplearning4j.gym.ClientUtils.unirestCrash(ClientUtils.java:71)
at org.deeplearning4j.gym.ClientUtils.post(ClientUtils.java:39)
at org.deeplearning4j.gym.ClientFactory.build(ClientFactory.java:40)
at org.deeplearning4j.gym.ClientFactory.build(ClientFactory.java:58)
at org.deeplearning4j.rl4j.mdp.gym.GymEnv.<init>(GymEnv.java:46)
at dentai.problems.CartPole.test(CartPole.java:18)
at dentai.main.lambda$main$0(main.java:107)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:830)
Caused by: com.mashape.unirest.http.exceptions.UnirestException: org.apache.http.conn.HttpHostConnectException: Connect to 127.0.0.1:5000 [/127.0.0.1] failed: Connection refused: no further information
at com.mashape.unirest.http.HttpClientHelper.request(HttpClientHelper.java:143)
at com.mashape.unirest.request.BaseRequest.asJson(BaseRequest.java:68)
at org.deeplearning4j.gym.ClientUtils.post(ClientUtils.java:37)
... 9 more
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to 127.0.0.1:5000 [/127.0.0.1] failed: Connection refused: no further information
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:159)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
at com.mashape.unirest.http.HttpClientHelper.request(HttpClientHelper.java:138)
... 11 more

Related

Maven NoSuchAlgorithmException when resolving dependencies

my maven installation recently started throwing a NoSuchAlgorithmException when trying to download plugins and/or dependencies. (See stacktrace below). I'm using Intellij Idea community edition, but have tried running mvn clean install from the CLI as well. Same issue.
I've tried a lot of options on SO and other websites but no success. What I've tried thus far are a few variations of the following (I'm on a Windows 10 system):
Upgrade to maven 3.5, was on 3.0
Upgrade and downgrade my java installation to Zulu 19.30.11-jdk19.0.1 and Microsoft jdk17.0.2. This included changing my JAVA_HOME and path variables.
Installed the https://repo.maven.apache.org/maven2/ SSL certificate (repo.maven.apache.org.crt) downloaded via chrome to java folder lib/security/cacerts using the KeyTool.
Add command line args: -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
Turn the computer off and on again :D
I have no idea why this is happening, but I hope someone can assist. If you need any further information, please let me know.
Stacktrace from CLI after running mvn clean install -X when trying to build this JavaFX project from Github source:
[ERROR] Failed to execute goal on project module1: Could not resolve dependencies for project com.dlsc.jpackagefx:module1:jar:1.0-SNAPSHOT: Failed to collect dependencies at org.openjfx:javafx-controls:jar:17.0.0.1: Failed to read artifact descriptor for org.openjfx:javafx-controls:jar:17.0.0.1: Could not transfer artifact org.openjfx:javafx-controls:pom:17.0.0.1 from/to central (https://repo.maven.apache.org/maven2): java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext): problem accessing trust store -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project module1: Could not resolve dependencies for project com.dlsc.jpackagefx:module1:jar:1.0-SNAPSHOT: Failed to collect dependencies at org.openjfx:javafx-controls:jar:17.0.0.1
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:221)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:127)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:246)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:200)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project com.dlsc.jpackagefx:module1:jar:1.0-SNAPSHOT: Failed to collect dependencies at org.openjfx:javafx-controls:jar:17.0.0.1
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:177)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:195)
... 23 more
Caused by: org.eclipse.aether.collection.DependencyCollectionException: Failed to collect dependencies at org.openjfx:javafx-controls:jar:17.0.0.1
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:300)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:325)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:169)
... 24 more
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.openjfx:javafx-controls:jar:17.0.0.1
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:283)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:199)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.resolveCachedArtifactDescriptor(DefaultDependencyCollector.java:544)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.getArtifactDescriptorResult(DefaultDependencyCollector.java:528)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:418)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:372)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:360)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:263)
... 26 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.openjfx:javafx-controls:pom:17.0.0.1 from/to central (https://repo.maven.apache.org/maven2): java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:453)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:255)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:232)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:268)
... 33 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.openjfx:javafx-controls:pom:17.0.0.1 from/to central (https://repo.maven.apache.org/maven2): java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:52)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:364)
at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:76)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:590)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:258)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:529)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:430)
... 36 more
Caused by: org.apache.maven.wagon.TransferFailedException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:1068)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:962)
at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:126)
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
at org.eclipse.aether.transport.wagon.WagonTransporter$GetTaskRunner.run(WagonTransporter.java:569)
at org.eclipse.aether.transport.wagon.WagonTransporter.execute(WagonTransporter.java:436)
at org.eclipse.aether.transport.wagon.WagonTransporter.get(WagonTransporter.java:413)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:456)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:359)
... 41 more
Caused by: java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
at java.base/javax.net.ssl.DefaultSSLSocketFactory.throwException(SSLSocketFactory.java:267)
at java.base/javax.net.ssl.DefaultSSLSocketFactory.createSocket(SSLSocketFactory.java:289)
at org.apache.maven.wagon.providers.http.httpclient.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:363)
at org.apache.maven.wagon.providers.http.httpclient.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353)
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:141)
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.execute(AbstractHttpClientWagon.java:834)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:985)
... 50 more
Caused by: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
at java.base/java.security.Provider$Service.newInstance(Provider.java:1868)
at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:236)
at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:164)
at java.base/javax.net.ssl.SSLContext.getInstance(SSLContext.java:185)
at java.base/javax.net.ssl.SSLContext.getDefault(SSLContext.java:110)
at java.base/javax.net.ssl.SSLSocketFactory.getDefault(SSLSocketFactory.java:83)
at java.base/javax.net.ssl.HttpsURLConnection.getDefaultSSLSocketFactory(HttpsURLConnection.java:336)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.createConnManager(AbstractHttpClientWagon.java:348)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.<clinit>(AbstractHttpClientWagon.java:274)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:86)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105)
at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32)
at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:89)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:87)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:53)
at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:65)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:63)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
at org.eclipse.sisu.inject.Guice4$1.get(Guice4.java:162)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
at org.eclipse.aether.internal.transport.wagon.PlexusWagonProvider.lookup(PlexusWagonProvider.java:67)
at org.eclipse.aether.transport.wagon.WagonTransporter.lookupWagon(WagonTransporter.java:280)
at org.eclipse.aether.transport.wagon.WagonTransporter.<init>(WagonTransporter.java:124)
at org.eclipse.aether.transport.wagon.WagonTransporterFactory.newInstance(WagonTransporterFactory.java:136)
at org.eclipse.aether.internal.impl.DefaultTransporterProvider.newTransporter(DefaultTransporterProvider.java:119)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector.<init>(BasicRepositoryConnector.java:124)
at org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory.newInstance(BasicRepositoryConnectorFactory.java:189)
at org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider.newRepositoryConnector(DefaultRepositoryConnectorProvider.java:122)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:525)
... 37 more
Caused by: java.security.KeyManagementException: problem accessing trust store
at java.base/sun.security.ssl.SSLContextImpl$DefaultManagersHolder.<clinit>(SSLContextImpl.java:942)
at java.base/sun.security.ssl.SSLContextImpl$DefaultSSLContext.<init>(SSLContextImpl.java:1111)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at java.base/java.security.Provider$Service.newInstanceOf(Provider.java:1879)
at java.base/java.security.Provider$Service.newInstanceUtil(Provider.java:1886)
at java.base/java.security.Provider$Service.newInstance(Provider.java:1861)
... 89 more
After searching a bit further when updating to maven 3.8.7, I inspected my Path variables and noted the following System Variable:
MAVEN_OPTS
-Xmx512m -Djavax.net.ssl.trustStore=/Library/Java/JavaVirtualMachines/jdk-11.0.8.jdk/Contents/Home/lib/security/cacerts -Djavax.net.ssl.trustStorePassword=xxxxxxxx
This pointed to a specific certificate - leading all my maven versions to use an outdated or possibly deleted certificate. I deleted this variable and the maven build worked.
I checked all the other java and maven variables and made sure they make sense.

ArtifactDescriptorException when running a clojure hello world in a docker container

I'm getting ArtifactDescriptorException: Failed to read artifact descriptor for org.clojure:clojure:jar when running a literal hello world program using the command clojure -M file.clj in a docker container. No issue doing it locally. Some googling suggests it might be a maven issue but there're no dependencies so I don't see why it's trying to get anything from a maven repo.
Full error output:
org.clojure:clojure:jar:1.10.2
org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.clojure:clojure:jar:1.10.2
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:255)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:171)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:255)
at clojure.tools.deps.alpha.extensions.maven$eval1068$fn__1070.invoke(maven.clj:107)
at clojure.lang.MultiFn.invoke(MultiFn.java:244)
at clojure.tools.deps.alpha$expand_deps$children_task__785$fn__787$fn__788.invoke(alpha.clj:403)
at clojure.tools.deps.alpha.util.concurrent$submit_task$task__502.invoke(concurrent.clj:34)
at clojure.lang.AFn.call(AFn.java:18)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.clojure:clojure:pom:1.10.2 from/to central (https://repo1.maven.org/maven2/): repo1.maven.org: Temporary failure in name resolution
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:424)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:229)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:207)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:240)
... 11 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.clojure:clojure:pom:1.10.2 from/to central (https://repo1.maven.org/maven2/): repo1.maven.org: Temporary failure in name resolution
at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:52)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:369)
at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:75)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:628)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:262)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:499)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:401)
... 14 more
Caused by: java.net.UnknownHostException: repo1.maven.org: Temporary failure in name resolution
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.base/java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:929)
at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1529)
at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:848)
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1519)
at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1378)
at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1306)
at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:263)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:162)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:326)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:605)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:440)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
at org.apache.http.impl.client.DecompressingHttpClient.execute(DecompressingHttpClient.java:164)
at org.eclipse.aether.transport.http.HttpTransporter.execute(HttpTransporter.java:290)
at org.eclipse.aether.transport.http.HttpTransporter.implGet(HttpTransporter.java:246)
at org.eclipse.aether.spi.connector.transport.AbstractTransporter.get(AbstractTransporter.java:67)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:457)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:364)
... 19 more

Spring boot : Unable to load cache item: javax/servlet/Filter

I have a spring boot project and getting some error related to javax servlet filter.
Is it some kind of version compatibility or I am missing something in pom file.
Following is the log from the console and the pom file.
I have been searching all over, couldn't find anything.
Exception in thread "main" java.lang.IllegalStateException: Cannot load configuration class: org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerSecurityConfiguration
at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:403)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:249)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:281)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:125)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:687)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:525)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
at com.abc.application.Application.main(Application.java:15)
Caused by: java.lang.IllegalStateException: Unable to load cache item
at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:79)
at org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34)
at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:116)
at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:291)
at org.springframework.cglib.proxy.Enhancer.createHelper(Enhancer.java:480)
at org.springframework.cglib.proxy.Enhancer.createClass(Enhancer.java:337)
at org.springframework.context.annotation.ConfigurationClassEnhancer.createClass(ConfigurationClassEnhancer.java:138)
at org.springframework.context.annotation.ConfigurationClassEnhancer.enhance(ConfigurationClassEnhancer.java:110)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:393)
... 11 more
Caused by: java.lang.NoClassDefFoundError: javax/servlet/Filter
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
at java.lang.Class.getDeclaredConstructors(Class.java:2020)
at org.springframework.cglib.proxy.Enhancer.generateClass(Enhancer.java:566)
at org.springframework.cglib.transform.TransformingClassGenerator.generateClass(TransformingClassGenerator.java:33)
at org.springframework.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanFactoryAwareGeneratorStrategy.generate(ConfigurationClassEnhancer.java:252)
at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:329)
at org.springframework.cglib.proxy.Enhancer.generate(Enhancer.java:492)
at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:93)
at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:91)
at org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61)
... 19 more
Caused by: java.lang.ClassNotFoundException: javax.servlet.Filter
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 33 more
For me problem were in pom file (in spring boot 2 project),
when I used a parent spring boot in version 2.1.9 which under the hood uses spring-core in version 5.1.10.RELEASE
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.9.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
I had dependency:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.2.0.RELEASE</version>
</dependency>
removing it resolved problem
I was getting the similar error in my Gradle project(might be a problem with Maven too) when I was trying to upgrade my Spring Boot version to latest one.
A quick gradle clean solved that problem for me.
Usually, this Filter class can be found in embedded tomcat jar.
So please make sure that your application (jar) contains this file:
Open up the Jar file of the compiled spring boot application and check whether the jar named like tomcat-embed-core resides in the BOOT-INF\lib folder.
This answer is valid as long as you're running tomcat of course + use JAR artifact for spring boot application (for WAR the folder is different, probably WEB-INF/lib although I've never worked with WARs of Spring Boot application so I might be wrong here)

Maven latest version update failed with mvn install command

I have using latest version of MAVEN. I have to projects which I want to build using MAVEN.
My first project is a module based project which has two modules. Parent POM for this project consists 2 child POMS. I am going to Pass version as variable through command prompt to make this build independent of static version.
My parent POM looks like :
<modelVersion>4.0.0</modelVersion>
<groupId>A.B.C</groupId>
<artifactId>D</artifactId>
<version>${major.version}.${build.version}</version>
<packaging>pom</packaging>
<!-- Some further code-->
One Module have POM like :
<parent>
<groupId>A.B.C</groupId>
<artifactId>D</artifactId>
<version>${major.version}.${build.version}</version>
</parent>
**<groupId>A.B.C</groupId>
<artifactId>E</artifactId>**
<version>${major.version}.${build.version}</version>
<!-- Some further code-->
Second Module have POM like :
<parent>
<groupId>A.B.C</groupId>
<artifactId>F</artifactId>
<version>${major.version}.${build.version}</version>
</parent>
**<groupId>A.B.C</groupId>
<artifactId>G</artifactId>**
<version>${major.version}.${build.version}</version>
<!-- Some further code-->
My Second project uses above dependency in its POM like :
<modelVersion>4.0.0</modelVersion>
<groupId>A.B.C</groupId>
<artifactId>T</artifactId>
<version>0.0.1</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
**<groupId>A.B.C</groupId>
<artifactId>E</artifactId>
<version>LATEST</version>**
</dependency>
<dependency>
**<groupId>A.B.C</groupId>
<artifactId>G</artifactId>
<version>LATEST</version>**
</dependency>
But while using mvn clean install, it gives error for
[ERROR] Failed to execute goal on project T: Could not resolve dependencies for project
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact A.B.C:D:pom:${major.version}.${build.version} from/to nexus-all-repos : IllegalArgumentException
But if I use command mvn versions:use-latest-versions, it works fine. I want to use mvn install as I want to use latest version for some dependencies only.
What might be the issue?
Adding complete error stack
[ERROR] Failed to execute goal on project T: Could not resolve dependencies for project A.B.C:T:jar:5.6.0.15: Failed to collect dependencies at A.B.C:E:jar:LATEST: Failed to read artifact descriptor for A.B.C:E:jar:LATEST: Could not tran
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project T: Could not resolve dependencies for project A.B.C:T:jar:5.6.0.15: Failed to collect dependencies at A.B.C:E:jar:LATEST
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:220)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:127)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:257)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:200)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project A.B.C:T:jar:5.6.0.15: Failed to collect dependencies at A.B.C:E:jar:LATEST
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:167)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:195)
... 22 more
Caused by: org.eclipse.aether.collection.DependencyCollectionException: Failed to collect dependencies at A.B.C:E:jar:LATEST
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:292)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:317)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:159)
... 23 more
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for A.B.C:E:jar:LATEST
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:384)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:231)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:461)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:261)
... 25 more
Caused by: org.apache.maven.model.resolution.UnresolvableModelException: Could not transfer artifact A.B.C:D:pom:${major.version}.${build.version} from/to nexus-all-repos (http://eqmavenrepo.technologic.com/nexus/content/groups/allrepo/): IllegalArgumentException
at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:170)
at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:219)
at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:898)
at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:750)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:309)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:375)
... 28 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact A.B.C:D:pom:${major.version}.${build.version} from/to nexus-all-repos (http://eqmavenrepo.technologic.com/nexus/content/groups/allrepo/): IllegalArgumentException
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:459)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:262)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:239)
at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:166)
... 33 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact A.B.C:D:pom:${major.version}.${build.version} from/to nexus-all-repos (http://eqmavenrepo.technologic.com/nexus/content/groups/allrepo/): IllegalArgumentException
at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$6.wrap(WagonRepositoryConnector.java:1016)
at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$6.wrap(WagonRepositoryConnector.java:1004)
at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:725)
at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalArgumentException
at java.net.URI.create(URI.java:842)
at org.apache.maven.wagon.providers.http.httpclient.client.methods.HttpGet.<init>(HttpGet.java:69)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:841)
at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:660)
... 4 more
Caused by: java.net.URISyntaxException: Illegal character in path at index 119: http://eqmavenrepo.technologic.com/nexus/content/groups/allrepo/A/B/C/D/${major.version}.${build.version}/D-${major.version}.${build.version}.pom
at java.net.URI$Parser.fail(URI.java:2809)
at java.net.URI$Parser.checkChars(URI.java:2982)
at java.net.URI$Parser.parseHierarchical(URI.java:3066)
at java.net.URI$Parser.parse(URI.java:3014)
at java.net.URI.<init>(URI.java:578)
at java.net.URI.create(URI.java:840)
... 10 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
Still getting error after removing illegal characters
This is not the way Maven works. Don't look at the POM as a mere build script, but more as a delivery slip shipped together with your artifact that explains how it is connected to the rest of the world, e.g. in terms of dependencies and how it was built (note the past tense), not how to build it, like Ant.
The problem is that if Maven would allow you to parameterize ${major.version}.${build.version} and use them as coordinates, when it installs/deploys it might be able to do right thing and deploy your artifact to http://.../E/X.Y/E-X.Y.pom (if you used mvn -Dmajor.version=X -Dbuild.version=Y ...).
But then the problem comes later. Another user might download your artifact correctly, but when Maven tries to parse the POM, it will encounter ${major.version}.${build.version} and wouldn't know what to do because the actual values were provided by you when you deployed and are lost in the process.
This is the reason why Maven coordinates need to be fixed and are not extrapolated with properties; it gives you (and perhaps more importantly, any other dependant) control and traceability. Of course, other non-coordinate properties may be parameterized to your heart's content, it's just coordinates that are more sensitive to this.
Maven coordinates uses five values, three of them more common than the other: groupId, artifactId and version. The other two are packaging and classifier, but are used for more exotic use-cases.
I would advise you to rethink your building approach if you are going to use Maven. It has a steep learning curve, but the view is magnificent from the top. Releasing artifacts using Maven is better done through, for instance, the Maven Release plugin.
i think problem related to wrong symbols in path to repo cuz this is in stacktrace. try check all paths related to nexus repo.
Caused by: java.net.URISyntaxException: Illegal character in path at index 119: ~^~content/groups/allrepo/~^~/E/${major.version}.${build.version}/E-${major.version}.${build.version}.pom

Using a local Repository in Maven for ElasticSearch

When I am using Elastic Search, my module compiles and runs properly.
In my pom.xml, I have included the following dependency,
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>1.4.5</version>
</dependency>
But I needed to do some changes(implement a timer in one of the methods of ES), so I forked the code, made a jar and saved it in my local repository:-
mvn install:install-file -Dfile=/Users/Mike/Desktop/MyElastic/elasticsearch/target/elasticsearch-1.4.6-SNAPSHOT.jar -DgroupId=org.elasticsearch -DartifactId=elasticsearch -Dversion=1.4.6-SNAPSHOT -Dpackaging=jar -DgeneratePom=true
Now I am trying to use this locally saved repository instead of the remote repository.
So I made the following changes to my pom.xml
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>1.4.6-SNAPSHOT</version>
</dependency>
But now when I compile my module, some strange error is being thrown :-
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J:
See http://www.slf4j.org/codes.html#StaticLoggerBinder for further
details. Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/lucene/util/Version at
org.elasticsearch.Version.(Version.java:44) at
org.elasticsearch.node.internal.InternalNode.(InternalNode.java:137)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159) at
org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166) at
mike.practice.ES.PracticeES3.(PracticeES3.java:55) at
mike.practice.ES.PracticeES3.main(PracticeES3.java:177) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497) at
com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: java.lang.ClassNotFoundException:
org.apache.lucene.util.Version at
java.net.URLClassLoader.findClass(URLClassLoader.java:381) at
java.lang.ClassLoader.loadClass(ClassLoader.java:424) at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at
java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 11 more
Process finished with exit code 1
What could have been the possible error? Is it that my local repository is not being properly mapped. Or probably some issue with the version ?( was using 1.4.5 earlier but when I forked and reverted to 1.4, automatically 1.4.6 was selected)
It would be really helpful if somebody could help me find out what the real issue is and how to correct it.

Categories

Resources