jmvanel / semantic_forms

Form generators leveraging semantic web standards (RDF(S), OWL, SPARQL , ...
Other
75 stars 23 forks source link

Problem on a new install on windows #186

Closed moissinac closed 6 years ago

moissinac commented 6 years ago

I've just installed the last released on a windows 10 I run the application and go to localhost:9000 then I attemps to create an instance of http://schema.org/Museum or of a foaf:Person and it get always the same form (see joined image) semanticforms It seems similar to a old problem I had; it was something about a problem accessing a file necessary to generate the form or something about populating the base, I don't remember very well (note that some chars are badly rendered, without the good chars family)

jmvanel commented 6 years ago

Yes, this is a problem of running on a completely empty database (see below).

For the immediate problem, you can leverage on the auto-load capability of semantic_forms :

  1. click on the form specification ( forms#loginForm )
  2. click on the class appearing there (forms.owl.ttl#specification )
  3. go back to /login page ( link on top right )

Populating the base, see https://github.com/jmvanel/semantic_forms/blob/master/doc/en/install.md#database-manipulations

For the encoding problem in the web page , this seems related to running on windows. The I18N files are in UTF-8 . We will investigate this .

moissinac commented 6 years ago

leverage on the auto-load capability of semantic_forms :

click on the form specification ( forms#loginForm )

done

click on the class appearing there (forms.owl.ttl#specification )

... No triple for this URI! Click on subjects link above. Class (automatic form) class not clickable

jmvanel commented 6 years ago

Normally you should have this :

forms.owl.ttl#specification RDF Resource Description Framework Flyer Icon Triplets Turtle - Triplets JSON-LD - Triplets RDF/XML - RDF document: 126 triples, 42 subjects , 16 predicates, 82 objects, 0 objects from page URI, type(s)

forms.owl.ttl#specification, at URI http://raw.githubusercontent.com/jmvanel/semantic_forms/master/vocabulary/forms.owl.ttl#specification Class (automatic form) Propriétés du sujet Nombre de liens 18

Have you retried login ?

moissinac commented 6 years ago

After populating the base, it works better, but it doesn't work (I've created a .bat script to populate the base) I have Triplets Turtle - Triplets JSON-LD - Triplets RDF/XML - RDF document: 126 triples, 42 subjects , 16 predicates, 82 objects, 0 objects from page URI, type(s) but not Nombre de liens 18 And when I try anything like login or "create an account" or create an instance, I return to the same window for authentification or account creation

jmvanel commented 6 years ago

Sorry, I just tested with the release zip, and the most convenient is really to Populate the base, see https://github.com/jmvanel/semantic_forms/blob/master/doc/en/install.md#database-manipulations

FYI, the issue here was that this URI for form spec. is not downloabable : http://localhost:9000/display?displayuri=http%3A%2F%2Fraw.githubusercontent.com%2Fjmvanel%2Fsemantic_forms%2Fmaster%2Fvocabulary%2Fforms%23loginForm

So, after running scripts/populateRDFCache.sh on my empty database , everything is fine . Running populateRDFCache.sh takes 2 minutes.

And then , doing "Create an account" worked fine ( on Ubuntu ! ), and then I had a nice form for Museum like this one on the main instance : http://semantic-forms.cc:9112/create?uri=http%3A%2F%2Fschema.org%2FMuseum

However, there seems again to be a Windows specific issue :( . Could you send me the log when doing "create an account" ?

moissinac commented 6 years ago

Not very nice. I just discover that the password I give when creating an accound is clearly visible in the traces (and, I suppose, in the log!!!) It's a really, really bad feature!!!

moissinac commented 6 years ago

The end of the traces when creating an account and/or trying to log in list2 List() - List() 2017-12-20 18:12:12.505 chooseLanguage: IP 0:0:0:0:0:0:0:1, userId "", GET /lookup?QueryClass=http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23string&QueryString=moissinac, id 54, host localhost:9000 Lang(fr_FR) makeQueryString searchStrings WrappedArray(moissinac, http://www.w3.org/2001/XMLSchema#string) , searchStrings(1) = http://www.w3.org/2001/XMLSchema#string classCriterium: classe: "http://www.w3.org/2001/XMLSchema#string" searchStringOrClass(search="moissinac", clas http://www.w3.org/2001/XMLSchema#string, queryString " PREFIX text: http://jena.apache.org/text# PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema# PREFIX form: http://raw.githubusercontent.com/jmvanel/semantic_forms/master/vocabulary/forms.owl.ttl# SELECT DISTINCT ?thing ?COUNT WHERE { ?thing text:query ( 'moissinac' ) . graph ?g1 { ?thing a http://www.w3.org/2001/XMLSchema#string . } OPTIONAL { graph ?grCount { ?thing form:linksCount ?COUNT. } } } ORDER BY DESC(?COUNT) LIMIT 10 " lookup(search=moissinac, clas=http://www.w3.org/2001/XMLSchema#string => List() lookup: after searchStringOrClass, starting TRANSACTION for dataset org.apache.jena.sparql.core.DatasetImpl@39c79d32 lookup: leaved TRANSACTION for dataset org.apache.jena.sparql.core.DatasetImpl@39c79d32 list2 List() - List() decodeResponse: predicateToValueMap Map( -> None, http://raw.githubusercontent.com/jmvanel/semantic_forms/master/vocabulary/forms.owl.ttl#userid -> Some(moissinac), http://raw.githubusercontent.com/jmvanel/semantic_forms/master/vocabulary/forms.owl.ttl#password -> Some(xxxx), http://raw.githubusercontent.com/jmvanel/semantic_forms/master/vocabulary/forms.owl.ttl#confirmPassword -> Some(xxxx)) register = Action: : useridOption Some(moissinac), passwordOption Some(xxxx), confirmPasswordOption Some(xxxx) register = Action: BadRequest: Some(moissinac), Some(xxxx), Some(xxxx)

jmvanel commented 6 years ago

Of course , logging of password will be removed. By the way, on the dedicated database for passwords (TDB3) , only the MD5 is stored.

For the login failure, I checked the code, and couldn't find a possible cause. In theory , JVM code is platform independent, except for some differences in file system. And last time, we found issues related to Internet Explorer.

So, I added more login for everything that could possibly fail. Sébastien and I will test on Windows this morning.

Can you confirm that you get a 400 Bad Request ? https://developer.mozilla.org/fr/docs/Web/HTTP/Status/400

Many thanks for you report and patience.

moissinac commented 6 years ago

I have no log file. here is a opy of a trace when starting SF and then trying to authenticate as admin trace211220171116.txt

As you can see at the begining, we have WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$2 (file:/C:/outils/Semantic/semantic_forms_play-2.3-SNAPSHOT/lib/com.google.inject.guice-4.0.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)

and ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'log4j2.debug' to show Log4j2 internal initialization logging.

near the end we have request GET http://raw.githubusercontent.com/jmvanel/semantic_forms/master/vocabulary/forms#registerForm HTTP/1.1 , getAllHeaders () response HTTP/1.1 404 Not Found [Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; sandbox, Strict-Transport-Security: max-age=31536000, X-Content-Type-Options: nosniff, X-Frame-Options: deny, X-XSS-Protection: 1; mode=block, X-GitHub-Request-Id: 259E:89ED:4CF7D1:518552:5A3B89A6, Content-Length: 15, Accept-Ranges: bytes, Date: Thu, 21 Dec 2017 10:15:03 GMT, Via: 1.1 varnish, Connection: keep-alive, X-Served-By: cache-lhr6332-LHR, X-Cache: HIT, X-Cache-Hits: 1, X-Timer: S1513851303.229219,VS0,VE0, Vary: Authorization,Accept-Encoding, Access-Control-Allow-Origin: *, X-Fastly-Request-ID: 79a2f617e261841b985d8688839e1e7c6b945566, Expires: Thu, 21 Dec 2017 10:20:03 GMT, Source-Age: 0, Via: 1.1 localhost (Apache-HttpClient/4.5.3 (cache)), Age: 9] org.apache.http.impl.client.cache.CacheEntity@4513aaa3 readWithContentTypeNoJena: no Reader found for contentType ; trying Turtle readWithContentTypeNoJena: response 404: Not Found

jmvanel commented 6 years ago

"Illegal reflective access "

This is a recent report from october: https://github.com/google/guice/issues/1133

I guess you use Java 9 too ? I don't yet .

ERROR StatusLogger

ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.

This is a unpleasing message, but it's not a problem.

Message 404 HTTP

request GET http://raw.githubusercontent.com/jmvanel/semantic_forms/master/vocabulary/forms#registerForm ... readWithContentTypeNoJena: response 404: Not Found

Again, this is a unpleasing message, but it's not a problem. Because this non-dereferencable URI has already been loaded by populateRDFCache (but SF tries just in case a newer version exists on Internet).

moissinac commented 6 years ago

yes for Java 9: I use it

jmvanel commented 6 years ago

So we tested on Windows (with Java 8 update 151), on a fresh machine and a fresh semantic_forms. It was from sources, because we added more logging just in case.

We first ran populateRDFCache.sh , as indicated in the doc. Then created a new account , then created a new foaf:Person , all without trouble !

I think that the workaround that I gave whithout running populateRDFCache.sh may be problematic, so you can delete directory TDB , re-run populateRDFCache.sh , and everything should be OK !

P.S. I restructured the wiki today https://github.com/jmvanel/semantic_forms/wiki .

moissinac commented 6 years ago

Removing TDB, TDB2, TDB3 Running populateRDFCache Starting SF Always unable to log as admin or to create another account In the windows after clicking 'Sauver' in the "Create account" form, I get the message "Register NOT succeeded for user Some(testeur211220171725)" and at the end of the log Current relative path is: C:\outils\Semantic\semantic_forms_play-2.3-SNAPSHOT creating database directory: TDB3 as C:\outils\Semantic\semantic_forms_play-2.3-SNAPSHOT\TDB3 - current (.) : C:\outils\Semantic\semantic_forms_play-2.3-SNAPSHOT. RDFStoreLocalJena1Provider: dataset create: database_location "TDB3" in C:\outils\Semantic\semantic_forms_play-2.3-SNAPSHOT RDFStoreLocalJena1Provider TDB3, dataset created: org.apache.jena.sparql.core.DatasetImpl@2d35a708 configureLuceneIndex: useTextQuery false configureLuceneIndex DONE useTextQuery: false => org.apache.jena.sparql.core.DatasetImpl@2d35a708 register = Action: BadRequest: Some(testeur211220171725), Some(admin), Some(admin)

jmvanel commented 6 years ago

Black to initial problem !

The only way I see to reproduce the issue is to use also Java 9 on windows. What are your versions of these?

Tomorrow we will try also Java 9 on windows.

jmvanel commented 6 years ago

Black to initial problem !

The only way I see to reproduce the issue is to use also Java 9 on windows. What are your versions of these?

Tomorrow we will try also Java 9 on windows.

jmvanel commented 6 years ago

So, we tried with Java 9 from sources, with the build tool SBT. And , on Windows, it did not work.

Then I saw that Java 9 support for Scala itself is not effective yet !

_A summary page on "scala java 9 support": https://www.reddit.com/r/scala/comments/78u6xk/is_scala_ready_for_java_9/ Is Scala ready for Java 9? I've heard there are many issues. Anyone already moved to Java 9? How is it? Any issues? Any features you're already ...

The Scala issue is still open: https://github.com/scala/scala-dev/issues/139 JDK Support 9 · Issue # 139 · scala / scala-dev_

So SBT, Play, and SF can not work!

We know, according to Andy, that Jena is walking in pure Java 9. And we know that Java 9 is to be avoided for SF for the time being

I just have to remove the log of the passwords , document the Java 9 issue, and make the release 2.4 :) .

jmvanel commented 6 years ago

So Java 9 is an issue for Scala and SBT and PLay , not SF .