HughP / simal

Automatically exported from code.google.com/p/simal
0 stars 0 forks source link

Import project via CLI doesn't work (but web interface ok) #406

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have not yet been able to get a project imported by the CLI to work. The 
output always reports success:
----
C:\ands\simal_ws\uk.ac.osswatch.simal.core>java -cp target\simal-core-0.2.5-SNAP
SHOT-jar-with-dependencies.jar uk.ac.osswatch.simal.Simal  addxml c:\ands\sim\im
port\samok.xml
 INFO [main] (Simal.java:169) - Setting database directory to null
 INFO [main] (Simal.java:171) - Initialising repository...
 INFO [main] (SimalProperties.java:110) - Generated default file location C:\Doc
uments and Settings\spbennet from system property user.home
 INFO [main] (SimalProperties.java:110) - Generated default file location C:\Doc
uments and Settings\spbennet from system property user.home
 INFO [main] (JenaSimalRepository.java:114) - Initialise: C:\Documents and Setti
ngs\spbennet
 INFO [main] (JenaSimalRepository.java:127) - DB type: TDB
 WARN [main] (SetupTDB.java:702) - No BGP optimizer
 INFO [main] (JenaSimalRepository.java:144) - Initialised reference data from fi
le softwarelicences.n3
 INFO [main] (Simal.java:173) - Executing commands...
 INFO [main] (Simal.java:451) - Adding XML from c:\ands\sim\import\samok.xml
 INFO [main] (AbstractSimalRepository.java:244) - Adding a project from file:/c:
/ands/sim/import/samok.xml
 INFO [main] (Simal.java:476) - DOAP data succesffuly added via the CLI.
DOAP data succesfully added.
----

But the result in the web interface is one of:
1) No errors, but project doesn't appear in list.
2) Internal error when viewing any page (had to delete the simal_tdb directory 
to recover)

I have carefully verified that adding this project file to a clean db works 
through the "doap form" screen (uploading it from file), but doesn't work from 
CLI.

Original issue reported on code.google.com by Stevage on 9 Mar 2011 at 2:33

Attachments:

GoogleCodeExporter commented 9 years ago
Ok, after a whole day of battling this, I've concluded something everyone 
probably already knew: don't use the CLI while Simal is running. Something 
about Jena or TDB or something means that changes made through the CLI don't 
get properly reflected in Simal's web view until shutdown/restart. For example, 
I had a sequence of events like this:

1) Import project A through CLI (doesn't show up). It reports ID prj175.
2) Import project B through web interface. ID prj176
3) Import project C through CLI (doesn't show up). ID prj176

In web interface, there is only one project, prj176 (B)

Shutdown, restart.

In web interface, there are two projects: prj175 (A) and prj176 (C).

Original comment by Stevage on 9 Mar 2011 at 5:14

GoogleCodeExporter commented 9 years ago
I'm not sure about the effect of using the CLI while running the web interface, 
so I can't say if that's the only issue here.

However, I noticed the XML you attached contains:
  <Project rdf:about="http://registry.oss-watch.ac.uk/">
You should always make sure the rdf:about contains a URI that uniquely 
identifies your project. And on a global scale, so in your case use the 
hostname that resolves to your Simal instance instead of using 
registry.oss-watch.ac.uk. 
Also, make sure you append the URI with an id that uniquely identifies your 
project on that running instance. This is done in the doapcreator javascript in 
the trunk.

Original comment by sander.v...@oucs.ox.ac.uk on 11 Mar 2011 at 1:50