Multi User Installation

Post Reply
aixsurfer
Posts: 13
Joined: 28 Jun 2011, 10:09

Hi Ess-Team, I set up a server installation on Ubuntu server with MySQL DB. I had no problems with the installation - except some customizations in the run_protoge_server.sh - but the client connect to the server won't work. Finest logging for the rmi.client and rmi.server and rmi.transport.tcp brings following messages:

2012.02.27 10:21:13.538 CET FINE: RMI TCP Connection(1)-10.10.126.92: terminated with exception: -- java.io.IOException: Packet header out of alignment between reader and writer (Thread = RMI TCP Connection(1)-10.10.126.92)
at edu.stanford.smi.protege.server.socket.deflate.PacketHeader.read(Unknown Source)
at edu.stanford.smi.protege.server.socket.deflate.CompressingInputStream.fillBuffer(Unknown Source)
at edu.stanford.smi.protege.server.socket.deflate.CompressingInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
at java.io.DataInputStream.readInt(DataInputStream.java:387)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:704)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)

Can you give me a hint for the reason - packets lost, firewalling???
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Let me know if you do have a firewall between the client and the server as some further tuning of the run_protege_server.sh will be required.

However, this looks a bit like perhaps the Protege client and Protege server are running different versions of Protege. The recent updates to Protege have changed the way in which the client and server interact (version 3.4.8 compresses the project to send it to the client) and this means that you need to have the same version of Protege on the clients and the server.

Let me know if the versions are all the same and we'll take it from there

Jonathan
Essential Project Team
aixsurfer
Posts: 13
Joined: 28 Jun 2011, 10:09

Hi Jonathan, indeed you're right. I'm dealing with different versions (client 3.4.6, server 3.4.7). Now all on 3.4.7 it works fine.

Thanks, regards, Sigi.
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Thanks for the update. Great to hear that you've resolved it!

The last few minor release versions of Protege have done quite a bit of work on the client/server communication which unfortunately means that we need to ensure that the client and server need to be at the same version. This will also be the case when you move to Protege 3.4.8 - which I would recommend (sorry - another install).

Protege 3.4.8 includes a fix that we requested around the initial connection to the selected project (e.g. Essential Repository) from the client. With Protege 3.4.5 / 3.4.6 / 3.4.7, the initial load of the project takes a very long time (sometimes more than a minute!). 3.4.8 resolves this, so if you are experiencing a very long initial client connection, please upgrade to Protege 3.4.8

Jonathan
Essential Project Team
aixsurfer
Posts: 13
Joined: 28 Jun 2011, 10:09

Hi Jonathan, thanks for this important information. I've been wondering all the time that the startup takes more than 2 minutes for my repository, 10 times longer than in the stand alone version. I will asap move to version 3.4.8.

I've migrated my repository to mysql also the annotation project. Where do I have to configure the link for the database that the server connects to the database at startup - protege.properties, in the meta project (jdbc-url), somewhere else? There is no hint in the tutorials (may be I haven't seen it?).
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Hi,

The connection to the database is managed in the project file (.PPRJ). When you convert to a database, the PINS and PONT files are no longer used but the PPRJ file is still used to manage the connection details to the repository and for things like the forms layout.

This is all managed for you by Protege when you use the File->Convert Project To Format... option. This article describes the process for converting to use a database backend. The annotations project has changed recently but uses the same concept, where the PPRJ file of the changes ontology (annotations project) manages the connection details to the database.

You might also be interested in this article which describes how to set up the collaborative Protege (which uses the annotations) in a multi-user setup.

Does this answer your question? Or are you having trouble converting the annotations project to use the database?

Jonathan
Essential Project Team
aixsurfer
Posts: 13
Joined: 28 Jun 2011, 10:09

Hi Jonathan, thank you for your informations. The mentioned articles guided me once more in checking my installation but didn't answer my question. Following situation: I've converted my repository and I can connect to the server and update the repository established on the MySQL-Table. Starting the client with the local repository file (.pprj on client disk) from which I converted to the database allows also updates on the mysql database. How can I forbid this - delete the local .pprj?

Which .pprj file is used at client startup when I connect to the server - the local one or the .pprj on the server?

Setting up collaborative protege: how can I change the chao project from rdf to database - same convert process like for the repository? I've generated an annotation entry in the server's metaproject but this annotation project is never used. Instead the client uses the local annotation rdf-files whether the client is connected to the server project.

Thanks in advance for your response.

Kind regards.
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

If you want to prevent / forbid clients from accessing the repository directly (bypassing the server), you should make sure that the PPRJ file for the repository is not available on the client machines. As you suggest, deleting it from any clients.

A potential solution for preventing this in the future would be to have the database and Protege server co-located on the same server and use the hostname 'localhost' in the convert to database dialog. Then if any client has a copy of the PPRJ file, they will not be able to connect to the database for the repository.

I appreciate that if you are using some kind of database farm / hosting service then you may not be able to co-locate the database and Protege servers. However, in general, clients should not be able to directly access the server's PPRJ file.

In terms of the ChAO repository, once it has been created by Protege (e.g. using RDF files) you should be able to open it in Protege (as per any other Protege project) and convert it to use the database.

There are two steps to setting up the Protege server to use the changes ontology /annotation project.
1. Define the project to the server by creating a Project instance in the metaproject.pprj, in the same way as you have done for the Essential repository.
2. In the Essential Repository project instance, select the annotations project that you have just defined in the Annotations Project slot.

Check that the Changes Ontology / Annotations project is deployed to the server host, that Protege server can see the project and that the full path to this PPRJ file is correct in the metaproject.

It is best to make any updates to the Essential Repository and Changes Ontology projects (in terms of the configurations such as 'Track Changes') on the server host itself, running Protege in standalone mode. Taking a copy of these to a client, making the changes and then putting everything back on to the server may not be reliable and this might be why your server project is looking for a local changes ontology project.

One option at this stage would be to disable the Collaborative Protege from the project on the server and then working directly on the server (in stand alone mode) re-enable the change tracking and collaborative Protege.

If none of this helps, let me know. It may be that we need to 'tweak' the PPRJ file manually.

Jonathan
Essential Project Team
aixsurfer
Posts: 13
Joined: 28 Jun 2011, 10:09

Hi Jonathan, thank you for your offer. Now it's the moment that I must tweak the .pprj but not for the chao but for a damaged multi user installation. I don't know how this could happen. I'm dealing with a local repository, converting it to the server for the update by our architecture community. Since the last convert the Protege Client requests a .pins and a .pont file on the server when I try to open my repository through the metaproject - why the database is running and the table contents looks ok? By opening from my local repository I always get the screen for specifying the connect strings for the database. It looks like I'm directly jumping at opening into the convert menu.

I need detailed information for the database connect and the state save of the protege client and so on. Can you provide me this? Search on your documentation and on protege.standford.edu (also in the wiki) was not successfull.

Thanks in advance.
User avatar
neil.walsh
Posts: 444
Joined: 16 Feb 2009, 13:45
Contact:

Hi Sigi,

We were discussing the issue your having here and we were having a bit of trouble understanding the issues and state of your current installation.

Do you have a backup of the project prior to converting to multi-user?
Is it possible you didn't save the project file after converting to multi-user (In Protege > File > Save Project)?

Converting the project will write to the Database but the "File > Save" action updates the Project file to know to use the database (instead of the Pins and Pont files) at next open.

Let me know how you're getting on

Neil
aixsurfer
Posts: 13
Joined: 28 Jun 2011, 10:09

Hi Neil, thanks for you informations. Where is the information "to know to use the database" in the .pprj stored? Is this the instance definition for the jdbc connection (name=driver.....)? This definition is always contained even if I use no database.

I use a database. Concerning you information I have to store the .pprj always even if I use a database!

Kr.
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

The database connection details are held in the .PPRJ (the project file), which also holds all the forms layout information along with the details about where the ontology is stored (either in the PINS and PONT or database, or XML etc.)

This means that even when using a database backend, the PPRJ file is still required. If you open the .PPRJ file in a text editor, you can search for 'jdbc' and find the database connection details. e.g.

Code: Select all


([essential_prj_CC_v1.4.2_ProjectKB_Instance_80001] of  String

	(name "url")
	(string_value "jdbc:mysql://localhost/essentialdb"))

([essential_prj_CC_v1.4.2_ProjectKB_Instance_80002] of  String

	(name "table")
	(string_value "essentialbaseline304"))
It may be that if you convert back to use the Protege Files format for managing your repository that these details are maintained (and I think it is). This means that if you subsequently want to convert back to the Protege Database, these details will appear in the database convert dialog with these details as a starting point.

However, note that you need to use the File->Convert Project Format... option to make Protege use a different format (e.g. Files, Database) for the repository.

By the way, if your database connection details have changed, e.g. new hostname, you can edit the above details in the PPRJ file, save it and restart Protege and it should pick up the database at the revised location (assuming that you have copied the database table across, separately!)

Hope this helps. I'm not 100% sure what issues you are experiencing. Please feel free to post back with more details if you are still having problems opening the Protege project (the Essential repository).

Jonathan
Essential Project Team
aixsurfer
Posts: 13
Joined: 28 Jun 2011, 10:09

Hi Jonathan, great that's the answer I expected. This means when I delete these entries from the local .pprj I can work with a local repository which has the same informations like the server database after the convert - right? I tried this but the Protege-Client didn't open the project - following error messages

Set type on 22000 instances: essential_prj_CC_v1.4.2_ProjectKB_Instance_190630
Loaded 25000 instances: essential_prj_EE_v0.1_ProjectKB_Instance_20081
Set type on 23000 instances: essential_prj_EE_v0.1_ProjectKB_Instance_41518
SEVERE: Undefined instance: essential_prj_CC_v1.4.2_ProjectKB_Instance_80001 --
Parser.recordError()
SEVERE: Undefined instance: essential_prj_CC_v1.4.2_ProjectKB_Instance_80000 --
Parser.recordError()
SEVERE: Undefined instance: essential_prj_CC_v1.4.2_ProjectKB_Instance_80004 --
Parser.recordError()
SEVERE: Undefined instance: essential_prj_CC_v1.4.2_ProjectKB_Instance_80003 --
Parser.recordError()
SEVERE: Undefined instance: essential_prj_CC_v1.4.2_ProjectKB_Instance_80002 --
Parser.recordError()
SEVERE: Error loading project -- java.lang.NullPointerException
at edu.stanford.smi.protege.storage.database.pool.DatabaseParam.hashCode
(Unknown Source)
at java.util.HashMap.get(Unknown Source)
at edu.stanford.smi.protege.storage.database.pool.ConnectionPool.getConn
ectionPool(Unknown Source)
at edu.stanford.smi.protege.storage.database.RobustConnection.<init>(Unk
nown Source)
at edu.stanford.smi.protege.storage.database.AbstractDatabaseFrameDb.cre
ateConnection(Unknown Source)
at edu.stanford.smi.protege.storage.database.AbstractDatabaseFrameDb.get
CurrentConnection(Unknown Source)
at edu.stanford.smi.protege.storage.database.IdleConnectionNarrowFrameSt
ore.setIdle(Unknown Source)
at edu.stanford.smi.protege.storage.database.IdleConnectionNarrowFrameSt
ore.getTransactionStatusMonitor(Unknown Source)
at edu.stanford.smi.protege.model.framestore.MergingNarrowFrameStore.get
TransactionStatusMonitor(Unknown Source)
at edu.stanford.smi.protege.model.framestore.ClosureCachingBasicFrameSto
re.getTransactionStatusMonitor(Unknown Source)
at edu.stanford.smi.protege.model.framestore.ImmutableNamesNarrowFrameSt
ore.getTransactionStatusMonitor(Unknown Source)
at edu.stanford.smi.protege.model.framestore.SimpleFrameStore.getTransac
tionStatusMonitor(Unknown Source)
at edu.stanford.smi.protege.model.framestore.EventGeneratorFrameStore.se
tDelegate(Unknown Source)
at edu.stanford.smi.protege.model.framestore.FrameStoreManager.connect(U
nknown Source)
at edu.stanford.smi.protege.model.framestore.FrameStoreManager.enable(Un
known Source)
at edu.stanford.smi.protege.model.framestore.FrameStoreManager.setEnable
d(Unknown Source)
at edu.stanford.smi.protege.model.framestore.FrameStoreManager.setGenera
teEventsEnabled(Unknown Source)
at edu.stanford.smi.protege.model.DefaultKnowledgeBase.setGenerateEvents
Enabled(Unknown Source)
at edu.stanford.smi.protege.model.Project.loadDomainKB(Unknown Source)
at edu.stanford.smi.protege.model.Project.createDomainKnowledgeBase(Unkn
own Source)
at edu.stanford.smi.protege.model.Project.<init>(Unknown Source)
at edu.stanford.smi.protege.model.Project.<init>(Unknown Source)
at edu.stanford.smi.protege.model.Project.loadProjectFromURI(Unknown Sou
rce)
at edu.stanford.smi.protege.util.ProjectChooser.loadProject(Unknown Sour
ce)
at edu.stanford.smi.protege.util.ProjectChooser.getProjectFromFile(Unkno
wn Source)
at edu.stanford.smi.protege.util.ProjectChooser.getProject(Unknown Sourc
e)
at edu.stanford.smi.protege.ui.ProjectManager.getRequestedProject(Unknow
n Source).........

It seems that protege needs this entries as a placeholder. But when I put in any informations protege couldn't connect to the database?! Errors:

Errors found performing operation.

1. Unable to load knowledgebase jdbc:mysql://localhost/essentialDB
Exception class java.lang.RuntimeException. Message: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

2. Exception class java.lang.RuntimeException. Message: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

When I put in the real db connection informations it works! Any answer? It works as designed?

Kr.
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

To convert a project with a database backend to a file-based backend you do not need to make this edit on the PPRJ file.

All that is required is to open the database-backed project in Protege and use the File->Convert Project to Format… menu option and then select Protege Files.

Protege will take care of the migration back to the 3 files (PPRJ, PINS, PONT).

The error messages that you've described there show that Protege is still trying to connect to the database. When you have the correct values in there, it can connect to the database but if you remove those connection parameters from the PPRJ file or change them to other details that are not valid, then Protege will not open the project correctly.

I just recently moved a Protege project database between two different databases and updated the PPRJ file to point it to the new database. This worked just fine but the new database was an exact copy of the old one - just on a different server.

I'm not clear whether this is the main project database that you cannot connect to or the annotations project. NOTE that these are two separate, but related projects and each has its own PPRJ file - and if you've moved both databases, then you will need to update the connection details in both PPRJ projects.

The simplest way to move from a stand-alone project to multi-user may actually be to convert the standalone back to Protege Files, copy these to the server and then on the server, convert the project to use the database and Protege will take care of all the database details. The Annotations project is probably not as simple because we want to use a database backend for that from the start but in this case the 'tweaking the PPRJ' might be easiest to point the Annotation project to the new database.

I think it's important to remember that tweaking these settings directly in the PPRJ is not the recommended or normal way to set up the database connectivity but is merely a shortcut if we need to do something like change the hostname of the database server. The most reliable way to do connect a project to the database is to convert a File-based project to the Protege Database format.

I hope this is helping but I'm not really clear on what you are trying to do - beyond trying to get Protege to connect to the database.

Jonathan
Essential Project Team
Post Reply