Coder Social home page Coder Social logo

jopa-examples's People

Contributors

dependabot[bot] avatar ledsoft avatar the-alchemist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

jopa-examples's Issues

Rest web service using spring boot and json-ld

I am new to json -ld . dont know how to use json -ld with spring boot . in Get ,post,delete and put method. can you please add one example to new learner. i searched much on the web but did not get any help.

JsonLdModule error

Hi,

I am working with json-ld in android and I want to transform a Java class to a json-dl file, I try to create the ObjectMapper with the JsonLdModule but I face a problem I do not understand problem, I know that there is not a problem with the definition of the class as the error comes from this code:

User u = new User("Paco");

ObjectMapper mapper = new ObjectMapper();

mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);

mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

JsonLdModule module = new JsonLdModule();         //ERROR in this 

linemodule.configure(ConfigParam.SCAN_PACKAGE, "cz.cvut.kbss.jopa.jsonld");  

mapper.registerModule(module);

I followed that: https://github.com/kbss-cvut/jopa-examples/blob/master/jsonld/src/main/java/cz/cvut/kbss/jopa/jsonld/config/RestConfig.java#L37
The code runs in a Thread inside to a Service.
This is the error:

E/AndroidRuntime: FATAL EXCEPTION: pool-1-thread-1
    Process: myprocess, PID: 6355
    java.lang.BootstrapMethodError: Exception from call site #177 bootstrap method
        at cz.cvut.kbss.jsonld.common.BeanAnnotationProcessor.<clinit>(BeanAnnotationProcessor.java:31)
        at cz.cvut.kbss.jsonld.common.BeanAnnotationProcessor.setPropertyAccessResolver(BeanAnnotationProcessor.java:45)
        at cz.cvut.kbss.jsonld.jackson.serialization.JsonLdSerializerModifier.<init>(JsonLdSerializerModifier.java:32)
        at cz.cvut.kbss.jsonld.jackson.JsonLdModule.init(JsonLdModule.java:38)
        at cz.cvut.kbss.jsonld.jackson.JsonLdModule.<init>(JsonLdModule.java:33)
        at com.client.Service.myService$2.run(myService.java:325)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)
     Caused by: java.lang.ClassCastException: Bootstrap method returned null
        at cz.cvut.kbss.jsonld.common.BeanAnnotationProcessor.<clinit>(BeanAnnotationProcessor.java:31) 
        at cz.cvut.kbss.jsonld.common.BeanAnnotationProcessor.setPropertyAccessResolver(BeanAnnotationProcessor.java:45) 
        at cz.cvut.kbss.jsonld.jackson.serialization.JsonLdSerializerModifier.<init>(JsonLdSerializerModifier.java:32) 
        at cz.cvut.kbss.jsonld.jackson.JsonLdModule.init(JsonLdModule.java:38) 
        at cz.cvut.kbss.jsonld.jackson.JsonLdModule.<init>(JsonLdModule.java:33) 
        at com.client.Service.myService$2.run(myService.java:325) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:764)

Any ideas of the problem? and any sugestions of my code?

I try to do something similar to this example: https://github.com/kbss-cvut/jopa-examples/tree/master/jsonld

ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder for `jsonld` example

Upon running mvn spring-boot:run as advised in the subproject's README.md, Spring-Boot appears to start, then we get the error:

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/slf4j/impl/StaticLoggerBinder
	at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLoggerContext(LogbackLoggingSystem.java:304)
	at org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:118)
	at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationStartingEvent(LoggingApplicationListener.java:238)
	at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:220)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:178)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:171)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133)
	at org.springframework.boot.context.event.EventPublishingRunListener.starting(EventPublishingRunListener.java:79)
	at org.springframework.boot.SpringApplicationRunListeners.lambda$starting$0(SpringApplicationRunListeners.java:56)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120)
	at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:56)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:299)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1289)
	at cz.cvut.kbss.jopa.jsonld.JsonLdDemo.main(JsonLdDemo.java:27)
Caused by: java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)

I have never had advice suggested in the the URL https://www.slf4j.org/codes.html#StaticLoggerBinder to help. i.e. to push forward to to slf4j-2.0.x - rather, slf4j-1.3.x still works.

TL;DR

Looking at the jsonld subproject's pom.xml, I see there are no explicit dependencies declared for either slf4j or logback, which means this project is at the mercy of whatever transitive versions of those that are brought in by the direct dependencies. The output of mvn -U -Dmaven.test.skip=true -Dverbose -DoutputFile=deps.txt dependency:tree shows a lot of conflicting versions for slf4j but the final "winner" is 1.7.36 even though most of the dependency's transitive slf4j dependencies are trying for 2.0.6 or 2.0.7, however after the resolution, version 1.7.36 wins.

I tried forcing slf4j-2.0.7 as suggested in https://www.slf4j.org/codes.html#StaticLoggerBinder but kept getting the same ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder - this was not new to me; I have run into this many times. My solution is to downgrade logback to 1.2.x from 1.3.x.

Summary - the Fix

Explicitly use versions for slf4j, using 1.7.32 and logback 1.2.11.

convert json-Ld to graphql schema

my requirement is to convert json-ld to graphql schema.if any body has a reference, please share with me. i will appreciate your help

Failed to run

I am trying to run example 2 using the command:
mvn exec:java

I got the following exception

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project example-02: An exception occured while executing the Java class. Illegal characte
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project example-02: An ex
ception occured while executing the Java class. Illegal character in authority at index 7: file://C:\Users\user\IdeaProjects\jopa-examples\example02-jopa-owlapi\repository.owl

Gradle example

It would be beneficial to also have a Gradle-based example. Currently, all the examples use Maven, but at least one should exist also with Gradle, so that users building with Gradle have a set-up sample to follow (especially w.r.t. AspectJ compilation).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.