'frame' used in key specification without a key length

Post Reply
JD12
Posts: 11
Joined: 16 Oct 2009, 11:54

Good Day,

No matter which project file I try to load into MySQL from Protege (including the sample data files) I get the following errors:

Save Project Errors Popup Window:

Errors found performing operation.

1. Errors at copying knowledgebase jdbc:mysql://localhost/......
Exception class java.sql.SQLException. Message: BLOB/TEXT column 'frame' used in key specification without a key length

See console and log for more details.

From Console:

Creating database indicies:
WARNING: Failed to create table on database MySQL with command 'CREATE TABLE Met
aProject (frame VARBINARY(500) NOT NULL, frame_type SMALLINT NOT NULL, slot VARB
INARY(500) NOT NULL, facet VARBINARY(500) NOT NULL, is_template BIT NOT NULL, va
lue_index INT NOT NULL, value_type SMALLINT NOT NULL, short_value VARCHAR(500) C
OLLATE utf8_general_ci, long_value MEDIUMTEXT)' :BLOB/TEXT column 'frame' used i
n key specification without a key length -- DefaultDatabaseFrameDb.createTable()

WARNING: Errors at copying knowledgebase jdbc:mysql://localhost/... -- com.
mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: BLOB/TEXT column 'frame'
used in key specification without a key length

If I copy and paste the above query into a manual MySQL query it executes without the error. I have tried changing the driver.jar file to an older version and have tried many different project files. Some columns are getting created in the table but the process does not complete due to this error.

I am stuck at step 9 of your installation guide and can move no further. I posted a message to the Protege mailing list last week, but received no reply. Does anyone have any suggestions?
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Thanks for your post.

Can you confirm which version of MySQL, the JDBC driver, Protege and OS that you are using? We've not had any problems reported with MySQL on Windows, Mac and Linux, and I'm pretty sure that MySQL is the main DB that the Protege team test with.

However, this seems to be similar to yesterday's posting about DB2 from Magnus. Interestingly, MySQL seemed to work OK.

I'm going to have another go with Protege 3.4.1 and MySQL 5.0.1 and see if I can replicate the problem.

A work-around might be to install Protege 3.3.1, open the project and then Convert it to the Database format, as per our instructions. This should create the database correctly. Then you can close Protege 3.3.1, open up 3.4.1, open your database project and continue using it as normal.

I'll post back with how I get on creating the database again in MySQL

Jonathan
Essential Project Team
JD12
Posts: 11
Joined: 16 Oct 2009, 11:54

Hi Jonathan,

Thanks for your help. The versions are as follows:

-Windows 2000 Server SP4 (I know it's out of date, but that's the production server I have to work with at the moment).

-MySQL 4.1 - Again, out of date, but I didn't see any mention in any documentation that 5 was required.

-Protege 3.4.1 Build 537

-JDBC - Mysql Java Connector 5.1.10 (I also tried 3.1.14).

-Java 6 Update 15

I will try your workaround on Monday if I don't receive any different guidance. Perhaps updating MySQL will do the trick? I think I have access to a server with MySQL 5 running on it that I can try as a test.

Thanks again for your help.
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

I think you're right, there could be an inconsistency between using the v5 JDBC driver against the v4 MySQL. Is there a v4 JDBC driver? I see you've tried v3 and v5.

You're right, we haven't specified a MySQL version. We've been using v5 for the last 2+ years and haven't tried older versions. If it turns out that v3 is a problem, we will make that clear.

Thanks again for posting this and I'm sure we'll get to the bottom of it.

Jonathan
Essential Project Team
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

OK, I've just tested it successfully with Protege 3.4.1 and MySQL 5.

I've just converted the ECP-4 file-based repository (which I will publish later on in that ECP) to use a database backend and all went smoothly.

Interestingly, it seems that the new database persistence in Protege uses different types for some of the columns. e.g. frame used to be INTEGER on MySQL and now are VARBINARY(500) and this is on the same version of MySQL.

I'm not sure my workaround will work, though, as I remember the Protege team stating that a Protege 3.4 client couldn't work with a Protege 3.3 database project and that such projects must be migrated via a conversion to a file project. As described in this news article we published when Protege 3.4 was released. Apologies for misleading you about the work-around.

My suspicions are now on the JDBC driver. Protege itself is old enough to have been used with earlier versions of MySQL but the latest persistence code that they use in Protege 3.4 queries the database (via the driver) for things like the correct types and lengths when creating the table and columns. It could be that a mis-matched driver isn't handling this properly.

Do let me know how you get on.

Jonathan
Essential Project Team
JD12
Posts: 11
Joined: 16 Oct 2009, 11:54

I've determined that the problem was with the version of MySQL itself. When I tried the server that had version 5.0 I got past the error I was getting before, but received a different error. Then I upgraded my original server from 4.1 to 5.1 and it worked fine. Same JDBC driver was used throughout (version 5.1). It may be that Protege V3.4.1 does not work on any version older than MySQL 5.1, but this would have to be determined in testing. In any event, it solved my problem and now I'm on to the next problem, which is that when I try to start Protege server after converting the projec to the DB it can't start with an error that says "Connection refused to host X.X.X.X". I will start with this forum and work from there.

Thanks for your help.
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Glad to hear that you have got your project converted to the database. It may well be that Protege 3.4.1 hasn't been fully tested with older versions of MySQL or that using the v5.1 driver with the v5.0 and v4 database is causing trouble. I'm using MySQL 5.0.5 and driver 5.0.4 just for reference.

OK, so the Connection refused error. Can I just confirm, are you getting this error on the command line when you start the Protege Server (using run_protege_server.bat)? Or is this the error you are getting from Protege client when you try to connect to the server?

If it's the server reporting the error, then it cannot connect to the RMIRegistry. Check that this is running (rmiregistry.exe) - it should have been started by run_protege_server.bat

If it's the client that is reporting this, then the client is not able to connect to the server - likely to be either a firewall problem (is the server behind a firewall?) or possibly a username / password problem.

It's worth having a look at this page from the Protege Wiki but there are quite a lot of technical explanations in there. Feel free to post back to discuss! A full read out of the exception would really help but feel free to obfuscate the IP address of your server.

Thanks

Jonathan
Essential Project Team
JD12
Posts: 11
Joined: 16 Oct 2009, 11:54

Thanks again for your great replies. I am trying to startup the server using the run_protege_server.bat batch file. It's probably easiest to just paste both the batch file and the output here. There's also a second command prompt window that opens up that says C:\Program Files\Java\jre6\bin\rmiregistry at the top, but it just sits at the command prompt cursor with no output.

First the batch file. I have tried it with and without the optional lines rem'd out and with different addresses in the hostname line.

set JDKBIN="C:\Program Files\Java\jre6\bin"

rem Note that a space character in the following path must be replaced with '%%20' in
rem a batch file. If you are typing directly on the command line, a space must be
rem replaced with '%20'.

set CODEBASE_URL=file:/c:/program%%20files/protege_3.4.1/protege.jar

start /min %JDKBIN%\rmiregistry

set CLASSPATH=protege.jar;looks-2.1.3.jar;unicode_panel.jar;driver.jar;driver0.jar;driver1.jar
set MAINCLASS=edu.stanford.smi.protege.server.Server
set METAPROJECT=EssentialAM\Repository\metaproject.pprj

set MAX_MEMORY=-Xmx500M
set HEADLESS=-Djava.awt.headless=true
set CODEBASE=-Djava.rmi.server.codebase=%CODEBASE_URL%
set LOG4J_OPT=-Dlog4j.configuration=file:log4j.xml

rem --- Optional arguments; uncomment if necessary ---
set HOSTNAME=-Djava.rmi.server.hostname=127.0.0.1
set "PORTOPTS=-Dprotege.rmi.server.port=5200 -Dprotege.rmi.registry.port=5100"
TX=-Dtransaction.level=READ_COMMITTED
"DEBUG_OPT=-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"

set OPTIONS=%MAX_MEMORY% %CODEBASE% %HEADLESS% %LOG4J_OPT% %HOSTNAME% %PORTOPTS% %TX% %DEBUG_OPT%

rem ------------------- Cmd Options -------------------
rem If you want automatic saving of the project,
rem setup the number of seconds in SAVE_INTERVAL_VALUE
rem set SAVE_INTERVAL=-saveIntervalSec=120
rem ------------------- Cmd Options -------------------


%JDKBIN%\java %OPTIONS% -cp %CLASSPATH% %MAINCLASS% %SAVE_INTERVAL% %METAPROJECT%


Now here is the output of the batch file. We use a 10.x.x.x namespace and the IP it tries to connect to is the correct one for the server I am trying to get working:


C:\Program Files\Protege_3.4.1>set JDKBIN="C:\Program Files\Java\jre6\bin"

C:\Program Files\Protege_3.4.1>rem Note that a space character in the following
path must be replaced with '%20' in

C:\Program Files\Protege_3.4.1>rem a batch file. If you are typing directly on
the command line, a space must be

C:\Program Files\Protege_3.4.1>rem replaced with '0'.

C:\Program Files\Protege_3.4.1>set CODEBASE_URL=file:/c:/program%20files/protege
_3.4.1/protege.jar

C:\Program Files\Protege_3.4.1>start /min "C:\Program Files\Java\jre6\bin"\rmire
gistry

C:\Program Files\Protege_3.4.1>set CLASSPATH=protege.jar;looks-2.1.3.jar;unicode
_panel.jar;driver.jar;driver0.jar;driver1.jar

C:\Program Files\Protege_3.4.1>set MAINCLASS=edu.stanford.smi.protege.server.Ser
ver

C:\Program Files\Protege_3.4.1>set METAPROJECT=EssentialAM\Repository\metaprojec
t.pprj

C:\Program Files\Protege_3.4.1>set MAX_MEMORY=-Xmx500M

C:\Program Files\Protege_3.4.1>set HEADLESS=-Djava.awt.headless=true

C:\Program Files\Protege_3.4.1>set CODEBASE=-Djava.rmi.server.codebase=file:/c:/
program%20files/protege_3.4.1/protege.jar

C:\Program Files\Protege_3.4.1>set LOG4J_OPT=-Dlog4j.configuration=file:log4j.xm
l

C:\Program Files\Protege_3.4.1>rem --- Optional arguments; uncomment if necessar
y ---

C:\Program Files\Protege_3.4.1>rem set HOSTNAME=-Djava.rmi.server.hostname=127.0
.0.1

C:\Program Files\Protege_3.4.1>rem set "PORTOPTS=-Dprotege.rmi.server.port=5200
-Dprotege.rmi.registry.port=5100"

C:\Program Files\Protege_3.4.1>rem TX=-Dtransaction.level=READ_COMMITTED

C:\Program Files\Protege_3.4.1>rem "DEBUG_OPT=-Xdebug -Xrunjdwp:transport=dt_soc
ket,address=8000,server=y,suspend=n"

C:\Program Files\Protege_3.4.1>set OPTIONS=-Xmx500M -Djava.rmi.server.codebase=
file:/c:/program%20files/protege_3.4.1/protege.jar -Djava.awt.headless=true -Dlo
g4j.configuration=file:log4j.xml

C:\Program Files\Protege_3.4.1>rem ------------------- Cmd Options -------------
------

C:\Program Files\Protege_3.4.1>rem If you want automatic saving of the project,


C:\Program Files\Protege_3.4.1>rem setup the number of seconds in SAVE_INTERVAL_
VALUE

C:\Program Files\Protege_3.4.1>rem set SAVE_INTERVAL=-saveIntervalSec=120

C:\Program Files\Protege_3.4.1>rem ------------------- Cmd Options -------------
------

C:\Program Files\Protege_3.4.1>"C:\Program Files\Java\jre6\bin"\java -Xmx500M -
Djava.rmi.server.codebase=file:/c:/program%20files/protege_3.4.1/protege.jar -Dj
ava.awt.headless=true -Dlog4j.configuration=file:log4j.xml -cp protege.jar;l
ooks-2.1.3.jar;unicode_panel.jar;driver.jar;driver0.jar;driver1.jar edu.stanford
.smi.protege.server.Server EssentialAM\Repository\metaproject.pprj
Protege server is starting...
Protege 3.4.1 Build 537, JVM 1.6.0_15-b03, memory=520M, Windows 2000, encoding=U
TF-8, language=en, country=CA
Server port = 0, registry port = 1099, compressed stream
Using metaproject from: file:/C:/Program%20Files/Protege_3.4.1/EssentialAM/Repos
itory/metaproject.pprj
SEVERE: java.rmi.ConnectException: Connection refused to host: 10.X.X.X; nest
ed exception is:
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at edu.stanford.smi.protege.server.Server.bindName(Unknown Source)
at edu.stanford.smi.protege.server.Server.initialize(Unknown Source)
at edu.stanford.smi.protege.server.Server.<init>(Unknown Source)
at edu.stanford.smi.protege.server.Server.startServer(Unknown Source)
at edu.stanford.smi.protege.server.Server.main(Unknown Source)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
ource)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
ource)
... 10 more
-- Server.bindName()
SEVERE: server startup failed -- java.rmi.ConnectException: Connection refused t
o host: 10.X.X.X; nested exception is:
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at edu.stanford.smi.protege.server.Server.bindName(Unknown Source)
at edu.stanford.smi.protege.server.Server.initialize(Unknown Source)
at edu.stanford.smi.protege.server.Server.<init>(Unknown Source)
at edu.stanford.smi.protege.server.Server.startServer(Unknown Source)
at edu.stanford.smi.protege.server.Server.main(Unknown Source)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
ource)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
ource)
... 10 more

Thanks for any leads you can give me. I've tried to follow the directions closely but I must have missed something.
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

This looks tricky but what we're seeing is the Protege server being refused a connection to the RMIRegistry. As a bit of background, the RMIRegistry acts as a naming service to enable clients to connect to the server. However, before they can do that, the server must register itself with the RMIRegistry as it starts up. The RMIRegistry is running in the command window that is there but has no prompt or anything. It must be running before the Server starts and must remain running until after you've shut the server down.

If you haven't already, it's worth shutting it all down (the Protege Server window and the RMIRegistry windows) and re-running run_protege_server.bat.

Note that if RMIRegistry is running in 'silent' mode, you won't see an empty command prompt for it but rather will see the rmiregistry.exe process running in task manager. If this is the case, terminate this process to stop the RMIRegistry before re-running run_protege_server.bat

Just to make sure we haven't got any typos in the batch file, I see from this line
set METAPROJECT=EssentialAM\Repository\metaproject.pprj
that you have the metaproject stored with the repository file (rather than in the default Protege location). This makes a lot of sense - but I want to check that you really do have the file located in
C:\Program Files\Protege_3.4.1\EssentialAM\Repository\metaproject.pprj
I see that you have the server hostname line REM-ed out. The Protege client-server troubleshooting guide suggests that if the host platform (your Windows 2000 environment) isn't returning the correct name for the hostname that this could be confusing things. Try changing that line so that it reads
set HOSTNAME=-Djava.rmi.server.hostname=10.X.X.X
Ideally, this would be the actual network hostname but if you're just using IPs, then use the above. It may be that it's trying to make a connection to the RMIRegistry on an incorrect host. The idea is that the RMIRegistry and the Protege Server run on the same physical server.

Leave the line about the PORTOPTS REM-ed out, those are set for dealing with connecting through a firewall.

I've just done a test on my old Windows XP machine and have managed to replicate your exception by preventing the RMIRegistry from running.
So, I think the problem is that the RMIRegistry is not running by the time the Protege Server attempts to connect to it. There is a time-lag between the start of the RMIRegistry and the start of the Server, as the server loads itself and all its plugins before attempting to connect to the registry. It is very important that the RMIRegistry is running all the time.

I think there really can only be 2 reasons why the server cannot connect to the RMIRegistry:

- The RMIRegistry is not running when the server attempts to register itself during startup
- The server is attempting to connect to the RMIRegistry at a bad IP address/hostname.

If setting the hostname parameter to your IP address doesn't work, try setting it to:
set HOSTNAME=-Djava.rmi.server.hostname=YOUR SERVER HOSTNAME
Hope this helps move us forward - keep me posted

Jonathan
Essential Project Team
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Just Googled RMIRegistry and Windows 2000.

One more thing to try. It could be that somehow a process has got hold of port 1099 (reserved for RMIRegistry). We can check for this by stopping the Protege Server and the RMIRegistry and then from a command line, trying to run the RMIRegistry by hand and look for any errors.

If there is something there, it's worth rebooting the server to clear the network ports down. Might be worth doing a restart anyway...

Jonathan
Essential Project Team
JD12
Posts: 11
Joined: 16 Oct 2009, 11:54

OK, I got past this problem. The problem was as your said, the rmiregistry was not started. It was not getting invoked properly, probably due to the fact that I had to use quotes around the JDKBIN variable due to there being a space in the path (which is where Java installs by default these days). I changed the START command to specify the path separate from the command, using the /D switch and it loads properly now. I'm getting a few errors in the rmiregistry console that I don't know if I should be concerned about, but I guess time will tell as I move to the next steps. Here are the errors, followed by the first part of my batch file that works, in case anyone else runs into the same problem in the future due to having Java installed in the Program Files directory.

rmiregistry console errors:


Could not set up class specific logging
Exception configuring logger
Could not set logger level
Warning: IO exception getting logger. access denied (java.util.PropertyPermissio
n protege.properties.in.user.home read)



Working batch file (first part):


set JDKBIN="C:\Program Files\Java\jre6\bin"

rem Note that a space character in the following path must be replaced with '%%20' in
rem a batch file. If you are typing directly on the command line, a space must be
rem replaced with '%20'.

set CODEBASE_URL=file:/c:/program%%20files/protege_3.4.1/protege.jar
start /min /D%JDKBIN% rmiregistry
set CLASSPATH=protege.jar;looks-2.1.3.jar;unicode_panel.jar;driver.jar;driver0.jar;driver1.jar
set MAINCLASS=edu.stanford.smi.protege.server.Server
set METAPROJECT=EssentialAM\Repository\metaproject.pprj

set MAX_MEMORY=-Xmx500M
set HEADLESS=-Djava.awt.headless=true
set CODEBASE=-Djava.rmi.server.codebase=%CODEBASE_URL%
set LOG4J_OPT=-Dlog4j.configuration=file:log4j.xml

rem --- Optional arguments; uncomment if necessary ---
rem set HOSTNAME=-Djava.rmi.server.hostname=127.0.0.1
rem set "PORTOPTS=-Dprotege.rmi.server.port=5200 -Dprotege.rmi.registry.port=5100"
rem TX=-Dtransaction.level=READ_COMMITTED
rem "DEBUG_OPT=-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Great to hear that you've solved that one. I think you'll be OK with those error messages - the RMIRegistry just won't be able to log. I have to say I haven't seen that before.

Thanks for posting the resolution - as you say, it will be of great help to others who might encounter this.

Keep me posted as to how you get on with Essential.

Jonathan
Essential Project Team
JD12
Posts: 11
Joined: 16 Oct 2009, 11:54

Sorry to bother you again, but I am in the final stages and experiencing another problem. Basically when I connect to the server from a client the window to select a server-based project does not appear after I authenticate. Instead the window to select a local file appears again. I'm not given the option to select any server-based projects. I know it is authenticating properly to the server because if I use a wrong username or password it tells me.

The server startup console says it is waiting for connectons to my projects. Here is the tail end of the server startup script output:

Loaded 16000 instances: essential_prj_AA_v1.2_graphArchTest_ProjectKB_Instance_4
461
Set type on 14000 instances: essential_prj_CC_v1.4.2_ProjectKB_Instance_130061
Loaded 17000 instances: essential_prj_CC_v1.4.2_ProjectKB_Instance_140014
Set type on 15000 instances: essential_prj_CC_v1.4.2_ProjectKB_Instance_190006
Loaded 18000 instances: essential_prj_CC_v1.4.2_ProjectKB_Instance_191600
Set type on 16000 instances: essential_prj_EE_v0.1_ProjectKB_Instance_10003
Loaded 19000 instances: RegulatoryActivitesInventory_ProjectKB_Class4283
Set type on 17000 instances: RegulatoryActivitesInventory_ProjectKB_Class4617
Set type on 18000 instances: RegulatoryActivitesInventory_ProjectKB_Class5617
Loading project Regulatory Activities Inventory Annotations from file:/C:/Progra
m%20Files/Protege_3.4.1/EssentialAM/Repository/annotation_RegulatoryActivitesInv
entory.pprj
Loading project plugins for project Essential AM Repository
Loading project plugins for project Essential AM Annotations
Loading project plugins for project Regulatory Activities Inventory Annotations
Loading project plugins for project Regulatory Activities Inventory
Protege server ready to accept connections...

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

Looks like the server is starting properly and that you have 2 projects defined in the metaproject, each with an annotations project.

If nothing is appearing when you log in, it sounds like your user has not been given access rights to any of your projects.

Check the set up of your metaproject and make sure that you have defined Allowed Group Operations for each project that you wish to access via the server and that your user is a member of at least one of the Groups that has operations defined.

See the Configure Protege Metaproject guide for some screenshots and a step-by-step walk through.

Hope this resolves - you're very nearly there, now!
Let me know how you get on

Jonathan
Essential Project Team
JD12
Posts: 11
Joined: 16 Oct 2009, 11:54

Hi again,

I just noticed that the Protege client log displays the following errors when I try to make the server connection. Are you able to determine anything from this? The groups are definitely setup properly in each project, with assigned permissions and memberships in each group.

I should also mention that if I select the "Administer Server" option the Protege client completely crashes and shuts down.

Thanks in advance for any analysis you can make on this output:

Exception occurred during event dispatching:
java.lang.NullPointerException
at edu.stanford.smi.protege.server.metaproject.impl.OperationImpl.hashCo
de(Unknown Source)
at java.util.HashMap.put(Unknown Source)
at java.util.HashSet.add(Unknown Source)
at edu.stanford.smi.protege.server.metaproject.impl.MetaProjectImpl.getW
rappedInstances(Unknown Source)
at edu.stanford.smi.protege.server.metaproject.impl.MetaProjectImpl.getO
perations(Unknown Source)
at edu.stanford.smi.protege.server.metaproject.impl.PolicyImpl.getKnownO
perations(Unknown Source)
at edu.stanford.smi.protege.server.metaproject.impl.PolicyImpl.isOperati
onAuthorized(Unknown Source)
at edu.stanford.smi.protege.server.Server.getAvailableProjectNames(Unkno
wn Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Sou
rce)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Sour
ce)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknow
n Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at edu.stanford.smi.protege.server.Server_Stub.getAvailableProjectNames(
Unknown Source)
at edu.stanford.smi.protege.server.ServerProjectPanel.loadTable(Unknown
Source)
at edu.stanford.smi.protege.server.ServerProjectPanel.<init>(Unknown Sou
rce)
at edu.stanford.smi.protege.server.RemoteProjectManager.getServerProject
(Unknown Source)
at edu.stanford.smi.protege.util.ProjectChooser.getRemoteProject(Unknown
Source)
at edu.stanford.smi.protege.util.ProjectChooser.getProject(Unknown Sourc
e)
at edu.stanford.smi.protege.ui.ProjectManager.getRequestedProject(Unknow
n Source)
at edu.stanford.smi.protege.ui.ProjectManager.openProjectRequest(Unknown
Source)
at edu.stanford.smi.protege.ui.WelcomeDialog.openOtherButton_actionPerfo
rmed(Unknown Source)
at edu.stanford.smi.protege.ui.WelcomeDialog$3.actionPerformed(Unknown S
ource)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

I've gone through the Protege source code related to the stack trace you've posted.

Looks like there's an Operation in the metaproject that hasn't got it's name defined properly - possibly with no name.

If you have still got the default metaproject.pprj, metaproject.pins and metaproject.pont files that were installed with Protege (see <Protege_Install>/examples/server) try backing up your current metaproject (that you've got in <Protege Install>/EssentialAM...) and copying the default onto your configured one. Then try re-starting Protege Server and client. This should load and show several example projects to choose from. If that's the case, that will confirm that your metaproject is the source of the problem.

Alternatively, if you'd like to upload your metaproject (ZIP up the 3 PINS, PONT, PPRJ files) to the forum, I'll take a look.

Jonathan
Essential Project Team
JD12
Posts: 11
Joined: 16 Oct 2009, 11:54

Hi Jonathan,

Once again you've come through. I replaced the metaproject files with the originals and I received the project selection box as expected. So I followed all of the steps from the documentation again using this new file and everything is working as expected now. I must have made a mistake somewhere when following them the first time. Thanks again for all of your help and hopefully I won't have to bother you again on this topic.
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Great news. I'm really pleased to hear that you've got it all running.
No problem at all helping out, any time.

I'm working on some installers at the moment to make it much easier to get going with the Essential tools. However, the multi-user setup is always more complex - most of what we've been looking at in this thread is about setting up Protege and being open-source etc. there are so many options and variables such as the choice of database.

We're going to be providing things like an out-of-the-box starter metaproject for Essential and maybe it makes sense to have a "default" installer that assumes no existing Protege or Tomcat installations are already in place. That's the main thing that complicates the installation process - we don't want to break any existing Protege or Tomcat setups that people might have already.

I'd be really interested to hear your views on this

Thanks for your perseverance!

Jonathan
Essential Project Team
JD12
Posts: 11
Joined: 16 Oct 2009, 11:54

Hi Jonathan,

I just went to get the first real client (not from the server client) to connect to a repository on the server and his Protege through an exception after he selected the project from the list the server gave him and clicked to open it. The project never opened.

This installation was done by the client as he was the one originally evaluating the software before deciding to go with it and getting me to set it up on the server. I plan to remove and re-install on his computer, but I was wondering if maybe there's something from the console log that would indicate an easier fix. I'll give you both his Protege console log and the server's:

First his:

cwd: C:\Program Files\Protege_3.4\
cmd: "C:\WINDOWS\system32\java.exe" -Xms262144000 -Xmx524288000 -classpath "C:\P
rogram Files\Protege_3.4\protege.jar;C:\Program Files\Protege_3.4\looks-2.1.3.ja
r;C:\Program Files\Protege_3.4\unicode_panel.jar;C:\Program Files\Protege_3.4\dr
iver.jar;C:\Program Files\Protege_3.4\driver0.jar;C:\Program Files\Protege_3.4\d
river1.jar;C:\Program Files\Protege_3.4\driver2.jar$;C:\Program Files\Protege_3.
4\lax.jar;" com.zerog.lax.LAX "C:/Program Files/Protege_3.4/Protege.lax" "C:/Win
dows/Temp/lax15A.tmp"
Protege 3.4 Build 533, JVM 1.5.0_19-b02, memory=520M, Windows XP, encoding=UTF-8
, language=en, country=CA
Loaded plugin edu.stanford.smi.protegex.owl - OWL Plugin
Loaded plugin ca.uvic.cs.chisel.jambalaya - Jambalaya
Loaded plugin com.enterprise_architecture.essential.widgets - Essential Architec
ture Manager Report Tab
Loaded plugin dfki.protege.ontoviz
Loaded plugin edu.stanford.smi.protegex.rdf_backend - RDF Backend
Loaded plugin edu.stanford.smi.protegex.changes - Changes tab
Loaded plugin edu.stanford.smi.protegex.standard_extensions - Graph Widget, Tabl
e Widget
Loaded plugin edu.stanford.smi.protegex.chatPlugin - Chat
Loaded plugin edu.stanford.smi.protege.collab - Collaborative Protege
Loaded plugin edu.stanford.smi.protege.script - Script Plugin
Loaded plugin edu.stanford.smi.protege.stringsearch - String Search Tab
Loaded plugin edu.stanford.smi.protegex.datamaster - DataMaster Tab
Loaded plugin edu.stanford.smi.protegex.pal_tabs - PAL Tabs
Loaded plugin edu.stanford.smi.protegex.ezpal - EZPal Tab
Loaded plugin edu.stanford.smi.protegex.facets_tab
Loaded plugin edu.stanford.smi.protegex.instance_tree
Loaded plugin edu.stanford.smi.protegex.prompt - PROMPT Tab
Loaded plugin edu.stanford.smi.protegex.metaanalysis - MetaAnalysis Tab
Loaded plugin edu.stanford.smi.protegex.owl.inference.pellet - Protege Pellet Re
asoner
Loaded plugin edu.stanford.smi.protegex.umls_tab - UMLS Tab
Loaded plugin edu.stanford.smi.protegex.wordnet - WordNet Tab
Loaded plugin edu.stanford.smi.protegex.xml_tab - XML Tab
Loaded plugin org.algernon - Algernon
Loaded plugin se.liu.ida.JessTab - JessTab Plugin
Loaded plugin uk.ac.iam.soton.akt.tgviztab - TGVizTab
Loaded plugin uk.ac.man.cs.mig.coode.debugger
Loaded plugin uk.ac.man.cs.mig.coode.manchesterowlsyntaxeditor
Loaded plugin uk.ac.man.cs.mig.coode.owldoc
Loaded plugin uk.ac.man.cs.mig.coode.owlindividualstab
Loaded plugin uk.ac.man.cs.mig.coode.owlviz
Loaded plugin uk.ac.man.cs.mig.coode.protege.wizard - Basic Wizards
Loaded plugin uk.ac.man.cs.mig.coode.protege.wizard.owl - OWL Wizards
Preloading frame values: DefaultKnowledgeBase(KB_498933)
Preloading frame values: DefaultKnowledgeBase(KB_361961)
WARNING: Could not connect to remote project Regulatory Activities Inventory Rep
ository -- java.lang.RuntimeException: java.rmi.UnmarshalException: error unmars
halling return; nested exception is:
java.io.InvalidClassException: edu.stanford.smi.protege.server.update.Va
lueUpdate; local class incompatible: stream classdesc serialVersionUID = -775388
1900765528485, local class serialVersionUID = -4059275656078639103
at edu.stanford.smi.protege.server.framestore.RemoteClientFrameStore.con

vertException(Unknown Source)
at edu.stanford.smi.protege.server.framestore.RemoteClientFrameStore.get
Frame(Unknown Source)
at edu.stanford.smi.protege.model.framestore.ModificationFrameStore.getF
rame(Unknown Source)
at edu.stanford.smi.protege.model.framestore.ArgumentCheckingFrameStore.
getFrame(Unknown Source)
at edu.stanford.smi.protege.model.framestore.ModificationFrameStore.getF
rame(Unknown Source)
at edu.stanford.smi.protege.model.framestore.FrameStoreAdapter.getFrame(
Unknown Source)
at edu.stanford.smi.protege.model.framestore.FrameStoreAdapter.getFrame(
Unknown Source)
at edu.stanford.smi.protege.model.framestore.FrameStoreAdapter.getFrame(
Unknown Source)
at edu.stanford.smi.protege.model.DefaultKnowledgeBase.getFrame(Unknown
Source)
at edu.stanford.smi.protege.model.DefaultKnowledgeBase.getFrameOfType(Un
known Source)
at edu.stanford.smi.protege.model.DefaultKnowledgeBase.getCls(Unknown So
urce)
at edu.stanford.smi.protege.model.Project.getProjectInstance(Unknown Sou
rce)
at edu.stanford.smi.protege.server.RemoteClientProject.copyKb(Unknown So
urce)
at edu.stanford.smi.protege.server.RemoteClientProject.<init>(Unknown So
urce)
at edu.stanford.smi.protege.server.RemoteClientProject.createProject(Unk
nown Source)
at edu.stanford.smi.protege.server.RemoteProjectManager.connectToProject
(Unknown Source)
at edu.stanford.smi.protege.server.RemoteProjectManager.getServerProject
(Unknown Source)
at edu.stanford.smi.protege.util.ProjectChooser.getRemoteProject(Unknown
Source)
at edu.stanford.smi.protege.util.ProjectChooser.getProject(Unknown Sourc
e)
at edu.stanford.smi.protege.ui.ProjectManager.getRequestedProject(Unknow
n Source)
at edu.stanford.smi.protege.ui.ProjectManager.openProjectRequest(Unknown
Source)
at edu.stanford.smi.protege.ui.WelcomeDialog.openOtherButton_actionPerfo
rmed(Unknown Source)
at edu.stanford.smi.protege.ui.WelcomeDialog$3.actionPerformed(Unknown S
ource)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.rmi.UnmarshalException: error unmarshalling return; nested excep
tion is:
java.io.InvalidClassException: edu.stanford.smi.protege.server.update.Va
lueUpdate; local class incompatible: stream classdesc serialVersionUID = -775388
1900765528485, local class serialVersionUID = -4059275656078639103
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at edu.stanford.smi.protege.server.framestore.ServerFrameStore_Stub.getF
rame(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at edu.stanford.smi.protege.server.framestore.RemoteClientFrameStore$2.i
nvoke(Unknown Source)
at $Proxy1.getFrame(Unknown Source)
at edu.stanford.smi.protege.server.framestore.RemoteClientFrameStore.get
Frame(Unknown Source)
... 52 more
Caused by: java.io.InvalidClassException: edu.stanford.smi.protege.server.update
.ValueUpdate; local class incompatible: stream classdesc serialVersionUID = -775
3881900765528485, local class serialVersionUID = -4059275656078639103
at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.util.ArrayList.readObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at sun.rmi.server.UnicastRef.unmarshalValue(Unknown Source)
... 61 more


The server's log, which seems to indicate that all was fine and he connected as far as the server is concerned:

Set type on 18000 instances: RegulatoryActivitesInventory_ProjectKB_Class3615
Loading project plugins for project Regulatory Activities Inventory Repository
Loading project plugins for project Essential AM Repository
Loading project plugins for project Essential AM Annotations
Loading project plugins for project Regulatory Activities Inventory Annotations
Protege server ready to accept connections...
Server: Adding Session(id=100, user=Chad M) on Fri Oct 23 13:38:15 ADT 2
009
Server: Opened project Regulatory Activities Inventory Repository for Session(id
=100, user=Chad M) on Fri Oct 23 13:38:15 ADT 2009

Sorry for the false alarm on thinking I was out of the woods. It seems like I've made every possible misstep on this installation.

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

Looking at this warning:
WARNING: Could not connect to remote project Regulatory Activities Inventory Rep
ository -- java.lang.RuntimeException: java.rmi.UnmarshalException: error unmars
halling return; nested exception is:
java.io.InvalidClassException: edu.stanford.smi.protege.server.update.Va
lueUpdate; local class incompatible: stream classdesc serialVersionUID = -775388
1900765528485, local class serialVersionUID = -4059275656078639103
at edu.stanford.smi.protege.server.framestore.RemoteClientFrameStore.con
vertException(Unknown Source)
The first thing to check is that the Protege Client and the Protege Server are both at the same version. Make sure that they are both 3.4.1 (I think that's what you said your server is). Even in the last updates between version 3.4 RC1, RC2 and 3.4.1 there were some changes that could cause trouble.

Jonathan
Essential Project Team
JD12
Posts: 11
Joined: 16 Oct 2009, 11:54

Yet again you were right. He was running a slightly different build than what I installed on the server. I installed the same version on his PC and he can now open the projects from the server.

I do think it is a good idea to include a more automated way to install the server-side software if for no other reason than to cut down on the human error risk when following lengthy instructions. Particularly the part where the metaproject file has to be manipulated.

I am writing our own documentation now and have another question for a future event, but I will start another thread since it is really off-topic. Thanks a million for all your help.
Post Reply