I have used 2.2.5 version of [https://github.com/fge/json-schema-validator] using maven dependency
<dependency>
<groupId>com.github.fge</groupId>
<artifactId>json-schema-validator</artifactId>
<version>2.2.5</version>
</dependency>
I am trying to validate a simple json against schema given in code samples. When I load the page, I get a runTimeException as:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.github.fge.jsonschema.cfg.ValidationConfigurationBuilder
at com.github.fge.jsonschema.cfg.ValidationConfiguration.newBuilder(ValidationConfiguration.java:92)
at com.github.fge.jsonschema.cfg.ValidationConfiguration.byDefault(ValidationConfiguration.java:102)
at com.github.fge.jsonschema.main.JsonSchemaFactoryBuilder.(JsonSchemaFactoryBuilder.java:68)
at com.github.fge.jsonschema.main.JsonSchemaFactory.newBuilder(JsonSchemaFactory.java:123)
at com.github.fge.jsonschema.main.JsonSchemaFactory.byDefault(JsonSchemaFactory.java:113)
Do I need a version upgrade for any of the jars or is it because of some other issue?
Related
I tried to list the ECS clusters using the code as follow:
AmazonECS = amazonECS AmazonECSClientBuilder.standard().withRegion(region).withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).build():
amazonECS.listClusters();
However, it gave the error
java.lang.NoSuchFieldError: CLIENT_ENDPOINT
The error stack is something like this:
com.amazonaws.services.ecs.AmazonECSClient in executeListClusters at
line 2220 com.amazonaws.services.ecs.AmazonECSClient in listClusters
at line 2202 com.amazonaws.services.ecs.AmazonECSClient in
listClusters at line 2245
I am not too sure why this error occurred as the other Amazon services did not give me any similar error whatsoever and I have set the region previously based on the client's preference. Any ideas?
Thanks to Nagaraj Trantri the error is caused by the version mismatched of the AWS SDK that I have according to https://github.com/aws/aws-sdk-java/issues/2509#issuecomment-779370672
I had different version for SQS and S3 in pom.xml. After I updated those to same versions, it worked.
It depends on where to look for these versions mismatch.
I am using spark to connect to secrets manager and thus we have 2 places to look at.
My Application dependencies (build.gradle)
spark.yarn.jars
The versions in the above 2 places should match and then it started working
Use this in the pom.xml file. Error is caused due to mismatch in the 'com.amazonaws' dependency versions declared in the pom.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-bom</artifactId>
<version>1.11.739</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-sts</artifactId>
</dependency>
</dependencies>
I get the following error when I try to create a ChronicleMap:
Exception in thread "main" net.openhft.chronicle.hash.ChronicleHashRecoveryFailedException: java.lang.UnsatisfiedLinkError: C:\Users\sando\AppData\Local\Temp\jna-109203563\jna13551597900255569913.dll: Can't find dependent libraries
at net.openhft.chronicle.map.ChronicleMapBuilder.openWithExistingFile(ChronicleMapBuilder.java:1877)
at net.openhft.chronicle.map.ChronicleMapBuilder.createWithFile(ChronicleMapBuilder.java:1701)
at net.openhft.chronicle.map.ChronicleMapBuilder.recoverPersistedTo(ChronicleMapBuilder.java:1655)
at net.openhft.chronicle.map.ChronicleMapBuilder.createOrRecoverPersistedTo(ChronicleMapBuilder.java:1638)
at net.openhft.chronicle.map.ChronicleMapBuilder.createOrRecoverPersistedTo(ChronicleMapBuilder.java:1629)
at com.mycompany.app.App.createIndexOneFile(App.java:54)
at com.mycompany.app.App.createIndexOne(App.java:31)
at com.mycompany.app.App.main(App.java:23)
Caused by: java.lang.UnsatisfiedLinkError: C:\Users\sando\AppData\Local\Temp\jna-109203563\jna13551597900255569913.dll: Can't find dependent libraries
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2430)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2487)
at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2684)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2617)
at java.base/java.lang.Runtime.load0(Runtime.java:765)
at java.base/java.lang.System.load(System.java:1834)
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:851)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:826)
at com.sun.jna.Native.<clinit>(Native.java:140)
at net.openhft.chronicle.hash.impl.util.jna.WindowsMsync.<clinit>(WindowsMsync.java:34)
at net.openhft.chronicle.hash.impl.VanillaChronicleHash.msync(VanillaChronicleHash.java:853)
at net.openhft.chronicle.hash.impl.VanillaChronicleHash.msync(VanillaChronicleHash.java:841)
at net.openhft.chronicle.map.ChronicleMapBuilder.commitChronicleMapReady(ChronicleMapBuilder.java:464)
at net.openhft.chronicle.map.ChronicleMapBuilder.openWithExistingFile(ChronicleMapBuilder.java:1871)
... 7 more
Using this code:
String indexOnePath = "D:\\trabajo\\dbpedia\\dbpedia_files\\indexOne.bin";
File indexOneFile = new File(indexOnePath);
indexOne = ChronicleMap
.of(String.class, String.class)
.name("indexOne")
.entries(27191196)
.averageValue("<http://dbpedia.org/resource/Robert_Koch>")
.averageKey("Battle of Ardrianople")
.createOrRecoverPersistedTo(indexOneFile, true);
My pom.xml dependency looks like this:
<dependency>
<groupId>net.openhft</groupId>
<artifactId>chronicle-map</artifactId>
<version>3.19.4</version>
</dependency>
I am using the Java SDK 11.0.6 on Windows 10.
It seems to create the file, but then the exception appears. If I use create insteaad of createOrRecoverPersistedTo, there seems to be no problem.
Latest released version of Chronicle-Map depends on fairly old jna version (4.2.1) which doesn't work well with recent Windows. You can try last snapshot version (3.19.5-SNAPSHOT) as we haven't released it yet, or try overriding jna version in maven, e.g. add this to your dependency-management section:
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.5.0</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna-platform</artifactId>
<version>5.5.0</version>
</dependency>
Below is my stack trace.
Caused by: java.lang.NoClassDefFoundError: org/apache/axiom/om/util/StAXParserConfiguration
at org.apache.axis2.builder.SOAPBuilder.processDocument(SOAPBuilder.java:64)
at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:197)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:145)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:108)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:67)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:354)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
After a bit searching found that, the dependencies in my project for org.apache.axis2 were been upgraded from 1.5.1 to 1.5.3.
After 1.5.1 version had a transitive dependency on the library having the StAXParserConfiguration class.
But the later(newer) one does not have it. As such, I have to add the artifact explicitly in my pom.
You probably need to bundle the missing library with your deployed artifact,
<dependency>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-api</artifactId>
<version>1.2.14</version>
</dependency>
I am getting the below error when I am trying to create amazon S3 client. It worked earlier and after I have done few code changed from then on I am seeing this error. I feel it could be of some dependency conflict but unable to find it out. Try many things but nothing could help.
java.lang.NoSuchMethodError: org.apache.http.conn.ssl.SSLConnectionSocketFactory.<init>(Ljavax/net/ssl/SSLContext;Ljavax/net/ssl/HostnameVerifier;)V
at com.amazonaws.http.conn.ssl.SdkTLSSocketFactory.<init>(SdkTLSSocketFactory.java:56)
at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.getPreferredSocketFactory(ApacheConnectionManagerFactory.java:91)
at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.create(ApacheConnectionManagerFactory.java:65)
at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.create(ApacheConnectionManagerFactory.java:58)
at com.amazonaws.http.apache.client.impl.ApacheHttpClientFactory.create(ApacheHttpClientFactory.java:51)
at com.amazonaws.http.apache.client.impl.ApacheHttpClientFactory.create(ApacheHttpClientFactory.java:39)
at com.amazonaws.http.AmazonHttpClient.<init>(AmazonHttpClient.java:301)
at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:164)
at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:523)
at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:503)
at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:485)
at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:457)
at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:439)
at com.ge.hc.cloud.e2e.workflows.steps.BasicWorkflowSteps.<clinit>(BasicWorkflowSteps.java:72)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:386)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219)
at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:285)
at net.thucydides.core.steps.StepFactory.webEnabledStepLibrary(StepFactory.java:201)
at net.thucydides.core.steps.StepFactory.createProxyStepLibrary(StepFactory.java:164)
at net.thucydides.core.steps.StepFactory.instantiateNewStepLibraryFor(StepFactory.java:117)
at net.thucydides.core.steps.StepFactory.instantiateNewStepLibraryFor(StepFactory.java:109)
at net.thucydides.core.steps.StepFactory.getNewStepLibraryFor(StepFactory.java:77)
at net.thucydides.core.steps.StepFactory.getStepLibraryFor(StepFactory.java:72)
at net.thucydides.core.steps.StepAnnotations.instantiateAnyUnitiaializedSteps(StepAnnotations.java:52)
at net.thucydides.core.steps.StepAnnotations.instanciateScenarioStepFields(StepAnnotations.java:41)
at net.thucydides.core.steps.StepAnnotations.injectScenarioStepsInto(StepAnnotations.java:23)
at net.serenitybdd.jbehave.SerenityStepFactory.createInstanceOfType(SerenityStepFactory.java:80)
at org.jbehave.core.steps.StepCreator.stepsInstance(StepCreator.java:83)
at org.jbehave.core.steps.StepCreator$ParametrisedStep.perform(StepCreator.java:595)
at org.jbehave.core.embedder.StoryRunner$FineSoFar.run(StoryRunner.java:566)
Appreciate any kind of help.
I faced the similar issue. I was using AWS JavaV2 SDK software.amazon.awssdk with version 2.19.14.
The Amazon Java SDK jar that I had imported had a dependency on org.apache.httpcomponents. Once I imported the dependency and built the project again, I was able to create the client.
My pom.xml looked something like this.
<dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>ssm</artifactId>
</dependency>
</dependencies>
i am using apache-tomee-jaxrs-1.5.2 server and created the restful client in java using this bellow line
Response response = WebClient.create("localhost:8080/test).path("/change/event").post(userdata);
i included following dependency in pom.xml
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-client</artifactId>
<version>3.0.0-milestone1</version>
</dependency>
now compilation is success but when i deploy using mvn tomee:deploy then i am getting the foollowing exception
localhost log file: http://www.docdroid.net/6snb/localhost-log.txt.html
catalina log file:http://www.docdroid.net/6sne/cataline-log.txt.html
i do not know which dependency has problem and here my pom.xml file
http://www.docdroid.net/6soc/mypom.txt.html
the catalina log file.
Caused by: java.lang.ExceptionInInitializerError
at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.setupFactory(AbstractJAXRSFactoryBean.java:320)
at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:163)
at org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deploy(CxfRsHttpListener.java:164)
at org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployPojo(CxfRsHttpListener.java:110)
at org.apache.openejb.server.rest.RESTService.deployPojo(RESTService.java:436)
at org.apache.openejb.server.rest.RESTService.afterApplicationCreated(RESTService.java:248)
at org.apache.tomee.webservices.TomeeJaxRsService.afterApplicationCreated(TomeeJaxRsService.java:51)
... 78 more
Caused by: java.lang.IllegalArgumentException: interface org.apache.cxf.jaxrs.impl.tl.ThreadLocalProxy is not visible from class loader
at java.lang.reflect.Proxy.getProxyClass0(Proxy.java:484)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:713)
at org.apache.cxf.jaxrs.utils.InjectionUtils.createThreadLocalProxy(InjectionUtils.java:875)
at org.apache.cxf.jaxrs.model.AbstractResourceInfo.addContextMethod(AbstractResourceInfo.java:163)
at org.apache.cxf.jaxrs.model.AbstractResourceInfo.checkContextMethod(AbstractResourceInfo.java:146)
at org.apache.cxf.jaxrs.model.AbstractResourceInfo.findContextSetterMethods(AbstractResourceInfo.java:132)
at org.apache.cxf.jaxrs.model.AbstractResourceInfo.(AbstractResourceInfo.java:65)
at org.apache.cxf.jaxrs.model.ProviderInfo.(ProviderInfo.java:29)
at org.apache.cxf.jaxrs.provider.ProviderFactory.initJaxbProviders(ProviderFactory.java:127)
at org.apache.cxf.jaxrs.provider.ProviderFactory.(ProviderFactory.java:117)
at org.apache.cxf.jaxrs.provider.ProviderFactory.getInstance(ProviderFactory.java:157)
at org.apache.cxf.jaxrs.provider.ProviderFactory.(ProviderFactory.java:71)
... 85 more
you can use provided scope as a dependency in pom.xml. then it will work.e.g
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>2.6.4</version>
<scope>provided</scope>
</dependency>
use scope provided.