cancel
Showing results for 
Search instead for 
Did you mean: 

Using -server to stop the 'hibernate' error

itauthor
Champ in-the-making
Champ in-the-making
The topic "Very Ugly Errors" (http://forums.alfresco.com/viewtopic.php?t=1355) from March this year describes an error and a workaround. I'm getting the same error, but I don't know how to implement the proposed workaround (starting java with the -server flag).

The intermittant error I'm getting is:

[b]exception[/b]

javax.servlet.ServletException: Filter execution threw an exception

[b]root cause[/b]

java.lang.NoSuchMethodError: java.lang.Object.getHibernateLazyInitializer()Lorg/hibernate/proxy/LazyInitializer;
   org.alfresco.repo.domain.Node$$EnhancerByCGLIB$$7b3dbba0.getHibernateLazyInitializer(<generated>)
   org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:274)
   org.hibernate.type.ManyToOneType.assemble(ManyToOneType.java:177)
   org.hibernate.type.TypeFactory.assemble(TypeFactory.java:398)
   …

The fix is to start java with the -server flag. See http://opensource.atlassian.com/projects/hibernate/browse/HHH-1293 for gory details about how the problem was debugged and the -server workaround discovered.

The workaround sounds fine, but what do I need to do to get java to start with the -server flag. I installed the JDK 5 and java starts automatically on restart of the Linux machine, so I have no idea what startup file makes this happen or what I need to change.

Can anyone help me out?

My setup is:

uname -a
Linux bookworm 2.6.15-1.2054_FC5 #1 Tue Mar 14 15:48:33 EST 2006 i686 i686 i386 GNU/Linux

java -version
java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode, sharing)

cat /usr/java/jdk1.5.0_07/jre/lib/i386/jvm.cfg
#
# @(#)jvm.cfg   1.8 04/02/02
#
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
# SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
#
#
#
#
# List of JVMs that can be used as an option to java, javac, etc.
# Order is important – first in this list is the default JVM.
# NOTE that this both this file and its format are UNSUPPORTED and
# WILL GO AWAY in a future release.
#
# You may also select a JVM in an arbitrary location with the
# "-XXaltjvm=<jvm_dir>" option, but that too is unsupported
# and may not be available in a future release.
#
-client IF_SERVER_CLASS -server
-server KNOWN
-hotspot ALIASED_TO -client
-classic WARN
-native ERROR
-green ERROR
4 REPLIES 4

kevinr
Star Contributor
Star Contributor
I'm guessing here, but you could try swapping the first two lines from the bottom section of the /usr/java/jdk1.5.0_07/jre/lib/i386/jvm.cfg config file thus:

# List of JVMs that can be used as an option to java, javac, etc.
# Order is important – first in this list is the default JVM.
# NOTE that this both this file and its format are UNSUPPORTED and
# WILL GO AWAY in a future release.
#
# You may also select a JVM in an arbitrary location with the
# "-XXaltjvm=<jvm_dir>" option, but that too is unsupported
# and may not be available in a future release.
#
-server KNOWN
-client IF_SERVER_CLASS -server
-hotspot ALIASED_TO -client
-classic WARN
-native ERROR
-green ERROR

So swapping round the order of the first 2 lines in that section. As I think that is selecting the client JVM, and if i'm reading it correctly "Order is important – first in this list is the default JVM".

Hope this helps,

Kevin

itauthor
Champ in-the-making
Champ in-the-making
Thanks Kevin.
I'll give that a try and see if the error reoccurs.

rgeimer
Champ in-the-making
Champ in-the-making
What Alfresco distribution are you using?

alfresco-1.3.0-linux-community.bin
alfresco-community-jboss-1.3.0.tar.gz
alfresco-community-tomcat-1.3.0.tar.gz
alfresco-community-war-1.3.0.tar.gz

Also, is Alfresco starting up when you reboot, or do you run it manually?

itauthor
Champ in-the-making
Champ in-the-making
The fix appears to work.
However, for the record:

alfresco-community-war-1.3.0.tar.gz

Alfresco restarts automatically.