cancel
Showing results for 
Search instead for 
Did you mean: 

admin and hibernate problem

shay
Champ in-the-making
Champ in-the-making
Hi,

I tried to build a new tree in the alfresco using the java APIs, starting with a new root space and adding some new sub trees recursively. after about 50 cycles i got the following exception:

java.lang.NoSuchMethodError: java.lang.Object.getHibernateLazyInitializer()Lorg/hibernate/proxy/LazyInitializer;

i've found this link on the net:
http://forums.alfresco.com/viewtopic.php?t=3148
which suggest to replace the hibenate jar, so i replaced the hibenate jar in my application (not in the alfresco web client) from hibernate-3.2.1.jar to hibernate3.jar and the problem solved, BUT…

When i tried to delete my new root space (which i created, not the company home)  via the alfresco web application, i got an exception and i had to restart the alfresco again.
after the 3 attempt i could not log in as admin and i got the following message:

The Home Space node referenced by Id: c114aa26-0db9-11dc-aa80-2fede2568e21 cannot be found. It may have been deleted from the database. Please contact your system administrator.


we use alfresco 2.0.0 and sdk-2.0.0 on linux


can you advice about:
how can i fix the admin problem? (can i recreate it? i tried to rebuild the indexs with index.recovery.mode=FULL but no luck)
which hibernate jar should i use with my application and which hibernate jar should i use with the alfresco web client?

this subject is very crucial and urgent to us since all of our content is in the alfresco and we cant reach it.

Thanks in advance,
Shay.
4 REPLIES 4

frederick
Champ in-the-making
Champ in-the-making
I'm afraid I can't help you on the hibernate issue, but to restore your admin account you could try the following:

Assumptions:
- There is no other admin account available
- You have full access to the Alfresco db schema

1. Obtain the nodereference of a valid space (eg. company home)
You can do this by logging in with another user account that can access company home.

2. Look up your account's username row in the 'alf_node_properties' table. It should look something like this:

714, 'STRING', b'0', 'STRING', b'0', 0, 0, 0, 'myAccountName', '', '{http://www.alfresco.org/model/content/1.0}userName'

3. Use this id (714 in this example) to look up the row in the 'alf_node_properties' table that contains the homeFolder for your admin account. It looks something like this:

714, 'NODEREF', b'0', 'STRING', b'0', 0, 0, 0, 'workspace://SpacesStore/a9c268ee-0dc9-11dc-90f6-dd72221b1cb4', '', '{http://www.alfresco.org/model/content/1.0}homeFolder'

4. Execute an update statement on this row:

update 'alf_node_properties' set string_value = 'newHomeRef' where node_id = 714 and qname = '{http://www.alfresco.org/model/content/1.0}homeFolder'

Replacing newHomeRef with the reference of the valid space, and 714 with the id that corresponds to your node in the db.

5. Restart alfresco
Now your homefolder should have changed to the valid space (eg. company home).

Good luck!

shay
Champ in-the-making
Champ in-the-making
thank you Frederick, that was very helpful and solved the admin problem  Smiley Happy

i'm still looking for an answer about the hibernate issue  :?

about the delete issue…when i tries to delete a space (via the web client) i get the following error in the log file:

17:41:06,173 ERROR [org.alfresco.web.ui.common.Utils] Unable to delete Space due to system error:
java.lang.OutOfMemoryError: Java heap space

how can i change the heap size?… this space size is about 100MB and in the future we'll have even bigger spaces (above 1G) is there any other solution to this problem? (the user tries to delete a root space which is above 1G via the web client)

frederick
Champ in-the-making
Champ in-the-making
If you installed Alfresco out of the box, the heap config is in alfresco.bat (or alfresco.sh I assume):

set JAVA_OPTS=-Xms256m -Xmx512m -Xss2048k -server

Xms is initial heap size, Xmx is maximum heap size, Xss is stack size per thread.

If you do not use the alfresco batch or shell script, you must add these parameters to the place where java.exe is called (for tomcat in windows this is bin/catalina.bat).

Regards,

kevinr
Star Contributor
Star Contributor
The -server switch is a workaround for the hibernate issue - if you are setting the bigger heap size, set this switch also.

Thanks,

Kevin