Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 09/09/2006, à 14:46

misterdoki

Hattrick Organizer probleme avec java

bonjour ^^

voila mon probleme, jai telechargé Hattrick Organizer (pour le jeu http://www.hattrick.org/)
jai installé JAVA (qui marche sous firefox jai verifié)
mais quand je lance le fichier HO.sh j'ai ca qui saffiche et HO ne se lance pas :

---------------------------------------------------------------------------
Exception during event dispatch:
java.lang.ClassCastException: gnu.java.awt.peer.gtk.GdkGraphics cannot be cast to java.awt.Graphics2D
   at de.hattrickorganizer.gui.utils.InterruptionWindow.paint(Unknown Source)
   at gnu.java.awt.peer.gtk.GtkComponentPeer.handleEvent(lib-gnu-java-awt-peer-gtk.so.7)
   at java.awt.Component.dispatchEventImpl(libgcj.so.7)
   at java.awt.Container.dispatchEventImpl(libgcj.so.7)
   at java.awt.Window.dispatchEventImpl(libgcj.so.7)
   at java.awt.Component.dispatchEvent(libgcj.so.7)
   at java.awt.EventQueue.dispatchEvent(libgcj.so.7)
   at java.awt.EventDispatchThread.run(libgcj.so.7)
Exception during event dispatch:
java.lang.ClassCastException: gnu.java.awt.peer.gtk.GdkGraphics cannot be cast to java.awt.Graphics2D
   at de.hattrickorganizer.gui.utils.InterruptionWindow.paint(Unknown Source)
   at javax.swing.JWindow.update(libgcj.so.7)
   at gnu.java.awt.peer.gtk.GtkComponentPeer.handleEvent(lib-gnu-java-awt-peer-gtk.so.7)
   at java.awt.Component.dispatchEventImpl(libgcj.so.7)
   at java.awt.Container.dispatchEventImpl(libgcj.so.7)
   at java.awt.Window.dispatchEventImpl(libgcj.so.7)
   at java.awt.Component.dispatchEvent(libgcj.so.7)
   at java.awt.EventQueue.dispatchEvent(libgcj.so.7)
   at java.awt.EventDispatchThread.run(libgcj.so.7)
Exception during event dispatch:
java.lang.ClassCastException: gnu.java.awt.peer.gtk.GdkGraphics cannot be cast to java.awt.Graphics2D
   at de.hattrickorganizer.gui.utils.InterruptionWindow.paint(Unknown Source)
   at javax.swing.JWindow.update(libgcj.so.7)
   at gnu.java.awt.peer.gtk.GtkComponentPeer.handleEvent(lib-gnu-java-awt-peer-gtk.so.7)
   at java.awt.Component.dispatchEventImpl(libgcj.so.7)
   at java.awt.Container.dispatchEventImpl(libgcj.so.7)
   at java.awt.Window.dispatchEventImpl(libgcj.so.7)
   at java.awt.Component.dispatchEvent(libgcj.so.7)
   at java.awt.EventQueue.dispatchEvent(libgcj.so.7)
   at java.awt.EventDispatchThread.run(libgcj.so.7)
Exception in thread "main" Exception during event dispatch:
java.lang.ExceptionInInitializerError
   at java.lang.Class.initializeClass(libgcj.so.7)
   at de.hattrickorganizer.gui.model.PlayerSkillColumn.<init>(Unknown Source)
   at de.hattrickorganizer.gui.model.UserColumnFactory.createPlayerSkillArray(Unknown Source)
   at de.hattrickorganizer.gui.model.PlayerOverviewModel.initialize(Unknown Source)
   at de.hattrickorganizer.gui.model.PlayerOverviewModel.<init>(Unknown Source)
   at de.hattrickorganizer.gui.model.UserColumnController.getPlayerOverviewModel(Unknown Source)
   at de.hattrickorganizer.gui.model.UserColumnController.load(Unknown Source)
   at de.hattrickorganizer.gui.HOMainFrame.main(Unknown Source)
   at de.hattrickorganizer.HO.main(Unknown Source)
Caused by: java.lang.IllegalArgumentException: The currency code, F, is not supported.
   at java.util.Currency.getInstance(libgcj.so.7)
   at java.text.DecimalFormatSymbols.getCurrency(libgcj.so.7)
   at java.text.DecimalFormat.getCurrency(libgcj.so.7)
   at java.text.NumberFormat.getCurrencyInstance(libgcj.so.7)
   at java.text.NumberFormat.getCurrencyInstance(libgcj.so.7)
   at de.hattrickorganizer.gui.templates.ColorLabelEntry.<clinit>(Unknown Source)
   at java.lang.Class.initializeClass(libgcj.so.7)
   ...8 more
Database was not relased correctly!
Probably next time you will have problems starting HO...
... but you can restore a backup with switches -r or -rd. :-)
------------------------------------------------------------------------------------------

si quelqu'un a une idee? peut-etre un package manquant? pourtant java fonctionne sur mon pc


merci

Hors ligne

#2 Le 09/09/2006, à 15:02

nikko

Re : Hattrick Organizer probleme avec java

Tu utilises java de gnu (gcj-java) et non le java de sun (la preuve : java.lang.ClassCastException: gnu.java.awt.peer.gtk.GdkGraphics cannot be cast to java.awt.Graphics2D).

[aparté]
Différents programmes permettant de fournir les mêmes services (pager, editeur, navigateur web...) il existe un le système des alternatives, qui revient à faire toujours pointer certains programmes sur des liens pointant eux-mêmes sur l'un ou l'autre programme, tout en gardant la liste des associations en place). Exemple pour java:

~$ which java
/usr/bin/java
~$ ls -al /usr/bin/java
lrwxrwxrwx 1 root root 22 2006-08-29 23:40 /usr/bin/java -> /etc/alternatives/java
~$ ls -al /etc/alternatives/java
lrwxrwxrwx 1 root root 34 2006-08-30 22:27 /etc/alternatives/java -> /usr/lib/jvm/java-gcj/jre/bin/java

[/aparté]

Vérifie comment est configuré java dans les alternatives, et pour faire ça de façon agréable, tu peux utiliser galternatives:

sudo apt-get install galternatives
gksu galternatives

Nicolas

Hors ligne

#3 Le 10/09/2006, à 15:10

misterdoki

Re : Hattrick Organizer probleme avec java

merci pour ces precisions smile
je test ca on va voir

Hors ligne

#4 Le 10/09/2006, à 15:31

misterdoki

Re : Hattrick Organizer probleme avec java

bon ben ca marche, super pratik galternatives merci smile)

par contre jai un tit detail genant cest que une fois HO de lancé qd jouvre la page des preferences par ex, et que je a refermes, jai le cadre de la fenetre qui reste affiché. tu saurais d'ou ca vient?

ou si quelqu'un dautre a une idee smile

Hors ligne

#5 Le 10/09/2006, à 17:29

nikko

Re : Hattrick Organizer probleme avec java

Je l'ai installé pour voir. Mais je n'ai pas le problème. Je ne vois pas trop d'où ça peut venir. Si tu te sens de faire un post en anglais, je te conseille les forums du jeu.

Hors ligne

#6 Le 09/06/2007, à 08:03

juanito83

Re : Hattrick Organizer probleme avec java

Bonjour,quand je clique sur so moi j'ai ca qui s'affiche. Quelqu'un pourrait-il m'aider? Merci! #!/bin/sh
#
# Start script for Hattrick Organizer v0.31
# Originally created by patta, RAGtime and others
# Last Change (2005-08-07) by Lars Engels (lars@bsd-geek.de)
#
# List of changes:
#
#       0.32    - optional separate configuration file
#       0.31    - configurable java memory (-m or $MAX_MEMORY)
#     0.3    - Introduce the bourne shell as standard shell
#        - Make HO! multi-user capable
#        - Several layout changes to the script
#        - check database before doing backup
#        - quit if java version is not returned (NO Sun java?)   
#

########################################################################
#                                                                      #
#               User editable settings                                 #
#                                                                      #
#  To use HO! with multiple users on one system:                       #
#  - create a new directory, e.g. /usr/local/share/hattrickorganizer   #
#     or /opt/ho and unpack the HO archive there!                      #
#                                                                      #
#  - copy HO.sh to a directory in users $PATH, e.g.                    #
#     cp HO.sh /usr/local/bin/ho                                       #
#                                                                      #
#  - optionally you may create a HO.config file there and edit         #
#    this instead of HO.sh                                             #
#                                                                      #
#  - edit the HODIR variable to this new directory (without the ``)    #
#     and HOHOME to any user writable directory!                       #
#                                                                      #
#  - start HO! out of a terminal via e.g. 'ho'                       #
#                                                                      #
#  - manage your team smile                                               #
#                                                                      #
#                                                                      #
#  Alternatively, as single user just start HO! from the HO directory  #
#  via ./HO.sh without editing something!                              #
#                                                                      #
########################################################################
# OPTIONAL user configuration file which may overwrite some
# of the following variables later if it exists in HO.sh-directory.
HOCONF=HO.config

#
### BEGIN of default user configuration! ###
#

# Enter HO!'s directory. Default is the current directory.
# In multi user mode this can be any directory (full path!).
#
#HODIR=`pwd`

HODIR=`pwd`

# Next comes HO!'s directory to store its user data.
# This directory must be writable by the user,
# default is install directory (single user mode).
#
# SINGLE USER:
#
#HOHOME=$HODIR
#
# MULTI USER:
#
#HOHOME=~/.hattrickorganizer

HOHOME=$HODIR

# Where can I find java?
# Default is just looking at $PATH
# (remember option -j)
#JAVA=`which java`

JAVA=`which java`

# Enter the maximum amount of backups you do want to store.
# Default is 5
#
#MAX_BACKUPS=5

MAX_BACKUPS=5

# Enter the maximum amount of memory available to the java VM.
# Default is 256 MegaBytes!
#
#MAX_MEMORY=256m

MAX_MEMORY=256m

#
### END of default user configuration! ###
#

# Read additional user configuration variables from config file and
# overwrite the defaults above if it is found in HO.sh-directory !!!
HOSHDIR="$(dirname "$0")"
if [ -f "$HOSHDIR/$HOCONF" ]
then
# THIS FILE IS NOT PART OF HO PACKAGE AND WON'T BE OVERWRITTEN!
# SO YOU HAVE TO CREATE IT BY YOUR OWN BY COPYING THE LINES ABOVE
# BETWEEN "### BEGIN" AND "### END" THAT YOU WANT TO CHANGE!!!
   echo "Reading HO configuration from user file $HOSHDIR/$HOCONF!"
   source "$HOSHDIR/$HOCONF"
fi

########################################################################
#        DO NOT EDIT ANY MORE UNTIL YOU KNOW WHAT YOU'RE DOING!        #
########################################################################

# How do you call me?
#

HONAME=$0

# Enter the directory where the database is stored
#       
#DATABASEDIR=$HOHOME/db

DATABASEDIR=$HOHOME/db

# Enter the default backup-directory. It will be created
# in $HOHOME/db if it doesn't exist. Default is 'backup'.
#           
#BACKUPDIR=$HOHOME/db/backup

BACKUPDIR=$HOHOME/db/backup

# Enter the directory where the HO! plugins reside
#
#PLUGINSDIR=$HOHOME/hoplugins

PLUGINSDIR=$HOHOME/hoplugins

# Enter the directory where the language files are
#
#SPRACHDIR=$HOHOME/sprache

SPRACHDIR=$HOHOME/sprache

           
# required java version

JAVAVERREQ=1.4.1

# Which database files and name of backup file?

BACKUPLIST="database.data database.script database.backup database.properties"
PREFIX=database

# We need a date for the backup-file

DATE=`date "+%Y-%m-%d"`

# Check for javaversion by default?

CHECK=true

# Perform NO backup by default (because HO does this now internally!
# For old behavoir edit or start with option --backup/-b)

BACKUP=false

# Restore by default?
# IMPORTANT! This is just for initialisation!
# If you set this to 'true' strange things will occure!

RESTORE=false

# check at least top install directory

if [ ! -d $HODIR ]
then
  echo "INSTALL DIRECTORY NOT FOUND: $HODIR" >&2
  exit 4
fi

# Which version of HO! is this?

HOVERSION=`cat $HODIR/version.txt`

# Output the help

help(){
    cat <<-EOF >&2
        Usage: $HONAME [option]

    Options:
          -h  --help          This help text
          -v  --version       Show HO! version
          -f  --force         Start without checking java-version
          -j  --java <path>   Use this java
          -m  --memory <mem>  Max. size of memory allocation pool for java
          -b  --backup        Do a database backup before HO starts
          -nb --nobackup      Start without backup (by script)
          -r  --restore       Restore the last backup-file
          -rd --restoredate   <date>
                              Restore the backup-file from <date>
          -bd --backupdir     Use this as the backup directory
    EOF
    exit 1
}

# Start HO!

start(){
    cd $HOHOME
        echo "Starting HO from $HOHOME..." 
   
        $JAVA -classpath $HODIR HOLauncher 
      $JAVA -Xmx$MAX_MEMORY -jar $HODIR/ho.jar

        # check database and print warning
    if [ `grep modified $DATABASEDIR/database.properties | \
            cut -d= -f2` = "no" ]
    then
        echo "Database OK!"     
    else
        cat <<-EOF >&2
            Database was not relased correctly!
            Probably next time you will have problems starting HO...
            ... but you can restore a backup with switches -r or -rd. :-)
        EOF
    fi
}

# Backup

backup(){
    # Create the backupdir if there's none
      if [ ! -d $BACKUPDIR ]
    then
        echo "Creating $BACKUPDIR"
        mkdir -p $BACKUPDIR
      fi
      cd $BACKUPDIR
    # Delete too old backup files
      while [ "`ls -r | wc -l`" -gt $MAX_BACKUPS ]
    do
            rm -f `ls -r | tail -n 1`
      done
      cd $DATABASEDIR
    # THE BIG TRICK: ls gives false (status>0) if one of the files is missing!!! ;-) 
      if ls $BACKUPLIST &> /dev/null
    then
        # is database OK?   
            if [ `grep modified database.properties | cut -d= -f2` = "no" ] 
        then
        # f - is needed in case someone has set his $TAPE variable...
        tar -cf - $BACKUPLIST | gzip > $BACKUPDIR/$PREFIX-$DATE.tgz
        # ...and this is shorter, but won't work if there's no GNU tar! :-(
        # tar -czf $BACKUPDIR/$PREFIX-$DATE.tgz $BACKUPLIST 
        else
        cat <<-EOF >&2
            OLD database was not relased correctly! I will do no backup
            BTW,... if you have problems starting HO, try switches -r or -rd
        EOF
        fi
        else
        echo "Database files not found, so there is nothing to backup."
        fi   
}

# Restore

restore(){
    cd $DATABASEDIR
    if [ -z $RESTOREDATE ]
    then
        if ls $BACKUPDIR/$PREFIX*.tgz &> /dev/null
        then
            gunzip -c `ls $BACKUPDIR/$PREFIX*.tgz | tail -n 1` | tar -xf -
        else
            echo "No backup file(s) found!" >&2
            exit 2
        fi
    else
        if [ -r "$BACKUPDIR/$PREFIX-$RESTOREDATE.tgz" ]
        then
            gunzip -c "$BACKUPDIR/$PREFIX-$RESTOREDATE.tgz" | tar -xf -
            echo "Restored database from $BACKUPDIR/$PREFIX-$RESTOREDATE.tgz"
        else
            echo "Error reading backup file $BACKUPDIR/$PREFIX-$RESTOREDATE.tgz!" >&2
            exit 2
        fi
    fi
}

# Check java -version

checkjava(){
    test -x "$JAVA" || { echo "Can't find java!" ; exit 1 ; }
    JAVAVER=`$JAVA -version 2>&1 | head -n 1 | \
             awk -F\" '{print $2}' | sed s/[^0-9\.].*//g`
    JAVAMAJ=`echo $JAVAVER | awk -F. '{print $1}'`
    JAVAMIN=`echo $JAVAVER | awk -F. '{print $2}'`
    JAVAMINMIN=`echo $JAVAVER | awk -F. '{print $3}'`
    JAVAMAJREQ=`echo $JAVAVERREQ | awk -F. '{print $1}'`
    JAVAMINREQ=`echo $JAVAVERREQ | awk -F. '{print $2}'`
    JAVAMINMINREQ=`echo $JAVAVERREQ | awk -F. '{print $3}'`
        if ( [ $JAVAMAJ = "" ] || [ $JAVAMIN = "" ] \
                || [ $JAVAMINMIN = "" ] ) ; then
          echo -e "Couldn't check java version! \n
          Try '$HONAME -f' to override the version check" >&2
          exit 3
        fi
    if ( [ $JAVAMAJ -lt $JAVAMAJREQ ] || \
        ( [ $JAVAMAJ -eq $JAVAMAJREQ ] && \
        [ $JAVAMIN -lt $JAVAMINREQ ] ) || \
        ( [ $JAVAMAJ -eq $JAVAMAJREQ ] && \
        [ $JAVAMIN -eq $JAVAMINREQ ] && \
        [ $JAVAMINMIN -lt $JAVAMINMINREQ ] ) )
    then
        cat <<-EOF >&2
              The default Java version is too old!
            You could try another one: '$HONAME -j <path>'
        EOF
        exit 3
    fi
}

### MAIN

# Run through the params

until [ -z "$1" ]
do
    case "$1" in
        -j|--java)   
            JAVA=$2;
            if [ -z $JAVA ]
            then
                echo "Option j or java needs a parameter!" >&2
                exit 1
            fi
            shift
            ;;
        -m|--memory)   
            MAX_MEMORY=$2;
            if [ -z $MAX_MEMORY ]
            then
                echo "Option m or memory needs a parameter!" >&2
                exit 1
            fi
            shift
            ;;
        -v|--version)
            echo "This is HO! version $HOVERSION";
            exit 0
            ;;
        -nb|--nobackup)
            BACKUP=false
            ;;
        -b|--backup)
            BACKUP=true
            ;;
        -f|--force)
            CHECK=false
            ;;
        -h|--help)
            help
            ;;
        -bd|--backupdir)
            BACKUPDIR=$2
            shift
            ;;
        -r|--restore)
            RESTORE=true;
            BACKUP=false
            ;;
        -rd|--restoredate)
            RESTORE=true
            RESTOREDATE=$2
            if [ -z $RESTOREDATE ]
            then
                echo "Option rd or restoredate needs a date as parameter!" >&2
                if ls $BACKUPDIR/$PREFIX-*.tgz &> /dev/null
                then
                    echo -e "Available backups: \n`ls -1 $BACKUPDIR/$PREFIX-*.tgz`" >&2
                else
                                    echo "Sorry, there's no Backup available!!!" >&2
                fi   
                exit 1
            fi
            BACKUP=false;
            shift
            ;;
        *)
            echo -e "Unknown parameter $1\n
            Try $HONAME --help to get help." >&2
            exit 1
            ;;
    esac
    shift
done


# Check for java -version (if called without `force')

`$CHECK`   && checkjava

# Check if all needed directories exist

if [ ! -d $HOHOME ]
then
    echo "creating $HOHOME"
    mkdir $HOHOME
fi

if [ ! -d $PLUGINSDIR ]
then
        if [ ! -d $HODIR/hoplugins ]
        then
          echo "creating $HODIR/hoplugins"
          mkdir $HOHOME/hoplugins
        else
        echo "copying $PLUGINSDIR"
      cp -r $HODIR/hoplugins $HOHOME
        fi
fi

if [ ! -d $SPRACHDIR ]
then
    echo "copying $SPRACHDIR"
    cp -r $HODIR/sprache $HOHOME   
fi

# copy needed parameter files if not already there

if [ ! -e $HOHOME/ratings.dat ]
then
   cp $HODIR/ratings.dat $HOHOME/ratings.dat
fi
if [ ! -e $HOHOME/epv.dat ]
then
   cp $HODIR/epv.dat $HOHOME/epv.dat
fi


# Perform backups or restore only if $DATABASEDIR exists

if [ -d $DATABASEDIR ]
then
    `$BACKUP`  && backup
    `$RESTORE` && restore
else
    echo -e "No directory $DATABASEDIR found. \n This is your first HO!-Session, isn't it? Have fun!"
fi

# Start HO! (or the Launcher)

start

# Exit this script

exit 0

Hors ligne

#7 Le 09/06/2007, à 20:01

nikko

Re : Hattrick Organizer probleme avec java

Bonsoir juanito,

Il y a de fortes chances que le script de lancement ne soit pas éxécutable.

Dans un terminal tu tapes
chmod +x HO.sh

Et tu pourras le lancer via nautilus.

Ou tu le lances dans un terminal, ce qui te permettra de voir les erreurs, si il y en a.
bash HO.sh
./HO.sh     #si le fichier est exécutable.

Nikko

Hors ligne

#8 Le 10/06/2007, à 03:00

juanito83

Re : Hattrick Organizer probleme avec java

il ne trouve pas le fichier

Hors ligne

#9 Le 10/06/2007, à 13:32

nikko

Re : Hattrick Organizer probleme avec java

Bon ce n'est pas forcément HO.sh, c'est peut-être ho.sh, ou autre chose...

Essaye de rendre exécutable le fichier que tu double-cliques (via les propriétés si tu n'y arrives pas en console).

Nikko

Hors ligne