↑ ↓

как я понял, не работает java, возможно нет

Тема в разделе "Помощь", создана пользователем Dolp, 6 авг 2020.

  1. TopicStarter Overlay
    Offline

    Dolp

    9
    0
    1
    Кредиты:
    $181,46
    Репутация:
    0
    подобные ошибка выползают на разных сборках, конкретно эта ошибка с этой (Please login or register to view links)

    java и 1,6 и 1,7 и 1,8 пробовал, все переменные среды и прочее как указано здесь делал (Please login or register to view links)

    10:33:58.956 INFO [main]: - Using default implementation for ThreadExecutor
    10:33:58.974 INFO [main]: - Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
    10:33:58.975 INFO [main]: - Quartz Scheduler v.2.1.3 created.
    10:33:58.977 INFO [main]: - RAMJobStore initialized.
    10:33:58.978 INFO [main]: - Scheduler meta-data: Quartz Scheduler (v2.1.3) 'QuartzScheduler' with instanceId 'NON_CLUSTERED'
    Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
    NOT STARTED.
    Currently in standby mode.
    Number of jobs executed: 0
    Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 1 threads.
    Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.
    10:33:58.979 INFO [main]: - Quartz scheduler 'QuartzScheduler' initialized from an externally provided properties instance.
    10:33:58.980 INFO [main]: - Quartz scheduler version: 2.1.3
    10:33:58.980 INFO [main]: - Scheduler QuartzScheduler_$_NON_CLUSTERED started.
    10:33:58.981 INFO [main]: - 2020-08-06 10-33-58
    10:33:58.982 INFO [main]: - Loading: myls.properties
    10:33:58.983 INFO [main]: - No override properties found
    ===================================================================-[ Network ]
    10:33:58.995 INFO [main]: - Loading: ./config/network/network.properties
    10:33:58.995 INFO [main]: - Loading: ./config/network/floodcontroller.properties
    10:33:59.006 INFO [main]: - Loading: ./config/network/commons.properties
    10:33:59.007 INFO [main]: - Loading: ./config/network/database.properties
    ==================================================================-[ Database ]
    10:33:59.288 INFO [main]: - Successfully connected to database
    Exception in thread "main" java.lang.Error: Can't load database script context: .\data\scripts\system\database.xml
    at com.aionemu.commons.database.dao.DAOManager.init(DAOManager.java:71)
    at org.jsemu.loginserver.LoginServer.main(LoginServer.java:100)
    Caused by: java.lang.NullPointerException
    at com.aionemu.commons.scripting.impl.javacompiler.ClassFileManager.<init>(ClassFileManager.java:59)
    at com.aionemu.commons.scripting.impl.javacompiler.ScriptCompilerImpl.doCompilation(ScriptCompilerImpl.java:177)
    at com.aionemu.commons.scripting.impl.javacompiler.ScriptCompilerImpl.compile(ScriptCompilerImpl.java:161)
    at com.aionemu.commons.scripting.impl.ScriptContextImpl.init(ScriptContextImpl.java:141)
    at com.aionemu.commons.scripting.scriptmanager.ScriptManager.load(ScriptManager.java:86)
    at com.aionemu.commons.database.dao.DAOManager.init(DAOManager.java:68)
    ... 1 more

    надеюсь, кто-то поможет
     
  2. Offline

    Dision Ефрейтор Команда форума VIP

    274
    62
    61
    Кредиты:
    $15.415,48
    Репутация:
    7
    Написано же что контекста не загружен: Can't load database script context: .\data\scripts\system\database.xml
    Смотрите есть ли контекст по указанному пути.
     
  3. TopicStarter Overlay
    Offline

    Dolp

    9
    0
    1
    Кредиты:
    $181,46
    Репутация:
    0
    а то что прям перед этим написано "java.lang.Error" не говорит об ошибке java?

    в файле по пути только это написано, а что там должно быть?
    <?xml version='1.0' encoding='UTF-8' ?>
    <scriptlist xmlns:xsi="Please login or register to view links"
    xsi:noNamespaceSchemaLocation="../contexts.xsd">
    <scriptinfo root="./data/scripts/system/database"/>

    </scriptlist>
     
  4. Offline

    Dision Ефрейтор Команда форума VIP

    274
    62
    61
    Кредиты:
    $15.415,48
    Репутация:
    7
    DAO лежат где надо?
     
  5. TopicStarter Overlay
    Offline

    Dolp

    9
    0
    1
    Кредиты:
    $181,46
    Репутация:
    0
    что это?
     
  6. Offline

    Dision Ефрейтор Команда форума VIP

    274
    62
    61
    Кредиты:
    $15.415,48
    Репутация:
    7
    \data\scripts\system\database\mysql.\MySQL...DAO.java
     
  7. TopicStarter Overlay
    Offline

    Dolp

    9
    0
    1
    Кредиты:
    $181,46
    Репутация:
    0
    6 файлов до 11кб лежат
     
  8. Offline

    Dision Ефрейтор Команда форума VIP

    274
    62
    61
    Кредиты:
    $15.415,48
    Репутация:
    7
    Проверьте нет ли ошибок в файлах этх.
    Валидность импортов.
     
  9. TopicStarter Overlay
    Offline

    Dolp

    9
    0
    1
    Кредиты:
    $181,46
    Репутация:
    0
    а как это сделать?
     
  10. Offline

    Dision Ефрейтор Команда форума VIP

    274
    62
    61
    Кредиты:
    $15.415,48
    Репутация:
    7
    в среде разработки откройте исходы (папку)
     
  11. TopicStarter Overlay
    Offline

    Dolp

    9
    0
    1
    Кредиты:
    $181,46
    Репутация:
    0
    MySQL5AccountDAO
    package mysql5;
    import com.aionemu.commons.database.DB;
    import com.aionemu.commons.database.IUStH;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import org.jsemu.loginserver.dao.AccountDAO;
    import org.jsemu.loginserver.model.Account;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    /**
    * MySQL5 Account DAO implementation
    *
    * @author SoulKeeper
    */
    public class MySQL5AccountDAO extends AccountDAO {
    /**
    * Logger
    */
    private static final Logger log = LoggerFactory.getLogger(MySQL5AccountDAO.class);
    /**
    * {@inheritDoc}
    */
    @Override
    public Account getAccount(String name) {
    Account account = null;
    PreparedStatement st = DB.prepareStatement("SELECT * FROM account_data WHERE `name` = ?");
    try {
    st.setString(1, name);
    ResultSet rs = st.executeQuery();
    if (rs.next()) {
    account = new Account();
    account.setId(rs.getInt("id"));
    account.setName(name);
    account.setPasswordHash(rs.getString("password"));
    account.setAccessLevel(rs.getByte("access_level"));
    account.setMembership(rs.getByte("membership"));
    account.setCraftership(rs.getByte("craftership"));
    account.setActivated(rs.getByte("activated"));
    account.setLastServer(rs.getByte("last_server"));
    account.setLastIp(rs.getString("last_ip"));
    account.setIpForce(rs.getString("ip_force"));
    account.setExpire(rs.getDate("expire"));
    account.setCraftExpire(rs.getDate("craft_expire"));
    account.setMoney(rs.getLong("money"));
    account.setBonusRub(rs.getLong("bonus_rub"));
    }
    } catch (Exception e) {
    log.error("Can't select account with name: " + name, e);
    } finally {
    DB.close(st);
    }
    return account;
    }
    /**
    * {@inheritDoc}
    */
    @Override
    public int getAccountId(String name) {
    int id = -1;
    PreparedStatement st = DB.prepareStatement("SELECT `id` FROM account_data WHERE `name` = ?");
    try {
    st.setString(1, name);
    ResultSet rs = st.executeQuery();
    rs.next();
    id = rs.getInt("id");
    } catch (SQLException e) {
    log.error("Can't select id after account insertion", e);
    } finally {
    DB.close(st);
    }
    return id;
    }
    /**
    * {@inheritDoc}
    */
    @Override
    public int getAccountCount() {
    PreparedStatement st = DB.prepareStatement("SELECT count(*) AS c FROM account_data");
    ResultSet rs = DB.executeQuerry(st);
    try {
    rs.next();
    return rs.getInt("c");
    } catch (SQLException e) {
    log.error("Can't get account count", e);
    } finally {
    DB.close(st);
    }
    return -1;
    }
    /**
    * {@inheritDoc}
    */
    @Override
    public boolean insertAccount(Account account) {
    int result = 0;
    PreparedStatement st =
    DB.prepareStatement("INSERT INTO account_data(`name`, `password`, access_level, membership, craftership, activated, last_server, last_ip, ip_force, expire, craft_expire, bonus_rub, money) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?,?)");
    try {
    st.setString(1, account.getName());
    st.setString(2, account.getPasswordHash());
    st.setByte(3, account.getAccessLevel());
    st.setByte(4, account.getMembership());
    st.setByte(5, account.getCraftership());
    st.setByte(6, account.getActivated());
    st.setByte(7, account.getLastServer());
    st.setString(8, account.getLastIp());
    st.setString(9, account.getIpForce());
    st.setDate(10, account.getExpire());
    st.setDate(11, account.getCraftExpire());
    st.setLong(12, account.getBonusRub());
    st.setLong(13, account.getMoney());
    result = st.executeUpdate();
    } catch (SQLException e) {
    log.error("Can't inser account", e);
    } finally {
    DB.close(st);
    }
    if (result > 0) {
    account.setId(getAccountId(account.getName()));
    }
    return result > 0;
    }
    /**
    * {@inheritDoc}
    */
    @Override
    public boolean updateAccount(Account account) {
    int result = 0;
    PreparedStatement st =
    DB.prepareStatement("UPDATE account_data SET `name` = ?, `password` = ?, access_level = ?, membership = ?, craftership = ?, last_server = ?, last_ip = ?, ip_force = ?, expire = ?, craft_expire = ?, bonus_rub = ?, money = ? WHERE `id` = ?");
    try {
    st.setString(1, account.getName());
    st.setString(2, account.getPasswordHash());
    st.setByte(3, account.getAccessLevel());
    st.setByte(4, account.getMembership());
    st.setByte(5, account.getCraftership());
    st.setByte(6, account.getLastServer());
    st.setString(7, account.getLastIp());
    st.setString(8, account.getIpForce());
    st.setDate(9, account.getExpire());
    st.setDate(10, account.getCraftExpire());
    st.setLong(11, account.getBonusRub());
    st.setLong(12, account.getMoney());
    st.setInt(13, account.getId());
    st.executeUpdate();
    } catch (SQLException e) {
    log.error("Can't update account");
    } finally {
    DB.close(st);
    }
    return result > 0;
    }
    /**
    * {@inheritDoc}
    */
    @Override
    public boolean updateLastServer(final int accountId, final byte lastServer) {
    return DB.insertUpdate("UPDATE account_data SET last_server = ? WHERE id = ?", new IUStH() {
    @Override
    public void handleInsertUpdate(PreparedStatement preparedStatement) throws SQLException {
    preparedStatement.setByte(1, lastServer);
    preparedStatement.setInt(2, accountId);
    preparedStatement.execute();
    }
    });
    }
    /**
    * {@inheritDoc}
    */
    @Override
    public boolean updateLastIp(final int accountId, final String ip) {
    return DB.insertUpdate("UPDATE account_data SET last_ip = ? WHERE id = ?", new IUStH() {
    @Override
    public void handleInsertUpdate(PreparedStatement preparedStatement) throws SQLException {
    preparedStatement.setString(1, ip);
    preparedStatement.setInt(2, accountId);
    preparedStatement.execute();
    }
    });
    }
    @Override
    public boolean updateMembership(final int accountId) {
    return DB.insertUpdate("UPDATE account_data SET membership = 0, expire = NULL WHERE id = ? and expire < CURRENT_TIMESTAMP", new IUStH() {
    @Override
    public void handleInsertUpdate(PreparedStatement preparedStatement) throws SQLException {
    preparedStatement.setInt(1, accountId);
    preparedStatement.execute();
    }
    });
    }
    @Override
    public boolean updateCraftership(final int accountId) {
    return DB.insertUpdate("UPDATE account_data SET craftership = 0, craft_expire = NULL WHERE id = ? and craft_expire < CURRENT_TIMESTAMP", new IUStH() {
    @Override
    public void handleInsertUpdate(PreparedStatement preparedStatement) throws SQLException {
    preparedStatement.setInt(1, accountId);
    preparedStatement.execute();
    }
    });
    }
    /**
    * {@inheritDoc}
    */
    @Override
    public String getLastIp(final int accountId) {
    String lastIp = "";
    PreparedStatement st = DB.prepareStatement("SELECT `last_ip` FROM `account_data` WHERE `id` = ?");
    try {
    st.setInt(1, accountId);
    ResultSet rs = st.executeQuery();
    if (rs.next()) {
    lastIp = rs.getString("last_ip");
    }
    } catch (Exception e) {
    log.error("Can't select last IP of account ID: " + accountId, e);
    return "";
    } finally {
    DB.close(st);
    }
    return lastIp;
    }
    @Override
    public boolean updateLastMac(final int accountId, final String address) {
    return DB.insertUpdate("UPDATE account_data SET address = ? WHERE id = ?", new IUStH() {
    @Override
    public void handleInsertUpdate(PreparedStatement preparedStatement) throws SQLException {
    preparedStatement.setString(1, address);
    preparedStatement.setInt(2, accountId);
    preparedStatement.execute();
    }
    });
    }
    @Override
    public boolean updateBonusRub(final int accountId, final long bonusRub) {
    return DB.insertUpdate("UPDATE account_data SET bonus_rub = ? WHERE id = ?", new IUStH() {
    @Override
    public void handleInsertUpdate(PreparedStatement preparedStatement) throws SQLException {
    preparedStatement.setLong(1, bonusRub);
    preparedStatement.setInt(2, accountId);
    preparedStatement.execute();
    }
    });
    }
    @Override
    public boolean updateMoney(final int accountId, final long money) {
    return DB.insertUpdate("UPDATE account_data SET money = ? WHERE id = ?", new IUStH() {
    @Override
    public void handleInsertUpdate(PreparedStatement preparedStatement) throws SQLException {
    preparedStatement.setLong(1, money);
    preparedStatement.setInt(2, accountId);
    preparedStatement.execute();
    }
    });
    }
    /**
    * {@inheritDoc}
    */
    @Override
    public boolean supports(String database, int majorVersion, int minorVersion) {
    return MySQL5DAOUtils.supports(database, majorVersion, minorVersion);
    }
    }

    MySQL5AccountTimeDAO

    package mysql5;
    import com.aionemu.commons.database.DB;
    import com.aionemu.commons.database.IUStH;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import org.jsemu.loginserver.dao.AccountTimeDAO;
    import org.jsemu.loginserver.model.AccountTime;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    /**
    * MySQL5 AccountTimeDAO implementation
    *
    * @author EvilSpirit
    */
    public class MySQL5AccountTimeDAO extends AccountTimeDAO {
    /**
    * Logger
    */
    private static final Logger log = LoggerFactory.getLogger(MySQL5AccountTimeDAO.class);
    /**
    * {@inheritDoc}
    */
    @Override
    public boolean updateAccountTime(final int accountId, final AccountTime accountTime) {
    return DB.insertUpdate("REPLACE INTO account_time (account_id, last_active, expiration_time, "
    + "session_duration, accumulated_online, accumulated_rest, penalty_end) values "
    + "(?,?,?,?,?,?,?)",
    new IUStH() {
    @Override
    public void handleInsertUpdate(PreparedStatement preparedStatement) throws SQLException {
    preparedStatement.setLong(1, accountId);
    preparedStatement.setTimestamp(2, accountTime.getLastLoginTime());
    preparedStatement.setTimestamp(3, accountTime.getExpirationTime());
    preparedStatement.setLong(4, accountTime.getSessionDuration());
    preparedStatement.setLong(5, accountTime.getAccumulatedOnlineTime());
    preparedStatement.setLong(6, accountTime.getAccumulatedRestTime());
    preparedStatement.setTimestamp(7, accountTime.getPenaltyEnd());
    preparedStatement.execute();
    }
    });
    }
    /**
    * {@inheritDoc}
    */
    @Override
    public AccountTime getAccountTime(int accountId) {
    AccountTime accountTime = null;
    PreparedStatement st = DB.prepareStatement("SELECT * FROM account_time WHERE account_id = ?");
    try {
    st.setLong(1, accountId);
    ResultSet rs = st.executeQuery();
    if (rs.next()) {
    accountTime = new AccountTime();
    accountTime.setLastLoginTime(rs.getTimestamp("last_active"));
    accountTime.setSessionDuration(rs.getLong("session_duration"));
    accountTime.setAccumulatedOnlineTime(rs.getLong("accumulated_online"));
    accountTime.setAccumulatedRestTime(rs.getLong("accumulated_rest"));
    accountTime.setPenaltyEnd(rs.getTimestamp("penalty_end"));
    accountTime.setExpirationTime(rs.getTimestamp("expiration_time"));
    }
    } catch (Exception e) {
    log.error("Can't get account time for account with id: " + accountId, e);
    } finally {
    DB.close(st);
    }
    return accountTime;
    }
    /**
    * {@inheritDoc}
    */
    @Override
    public boolean supports(String database, int majorVersion, int minorVersion) {
    return MySQL5DAOUtils.supports(database, majorVersion, minorVersion);
    }
    }

    MySQL5BannedIpDAO

    package mysql5;
    import com.aionemu.commons.database.DB;
    import com.aionemu.commons.database.IUStH;
    import com.aionemu.commons.database.ParamReadStH;
    import com.aionemu.commons.database.ReadStH;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Timestamp;
    import java.sql.Types;
    import java.util.HashSet;
    import java.util.Set;
    import org.jsemu.loginserver.dao.BannedIpDAO;
    import org.jsemu.loginserver.model.BannedIP;
    /**
    * BannedIP DAO implementation for MySQL5
    *
    * @author SoulKeeper
    */
    public class MySQL5BannedIpDAO extends BannedIpDAO {
    /**
    * {@inheritDoc}
    */
    @Override
    public BannedIP insert(String mask) {
    return insert(mask, null);
    }
    /**
    * {@inheritDoc}
    */
    @Override
    public BannedIP insert(final String mask, final Timestamp expireTime) {
    BannedIP result = new BannedIP();
    result.setMask(mask);
    result.setTimeEnd(expireTime);
    if (insert(result)) {
    return result;
    } else {
    return null;
    }
    }
    /**
    * {@inheritDoc}
    */
    @Override
    public boolean insert(final BannedIP bannedIP) {
    boolean insert = DB.insertUpdate("INSERT INTO banned_ip(mask, time_end) VALUES (?, ?)", new IUStH() {
    @Override
    public void handleInsertUpdate(PreparedStatement preparedStatement) throws SQLException {
    preparedStatement.setString(1, bannedIP.getMask());
    if (bannedIP.getTimeEnd() == null) {
    preparedStatement.setNull(2, Types.TIMESTAMP);
    } else {
    preparedStatement.setTimestamp(2, bannedIP.getTimeEnd());
    }
    preparedStatement.execute();
    }
    });
    if (!insert) {
    return false;
    }
    final BannedIP result = new BannedIP();
    DB.select("SELECT * FROM banned_ip WHERE mask = ?", new ParamReadStH() {
    @Override
    public void setParams(PreparedStatement preparedStatement) throws SQLException {
    preparedStatement.setString(1, bannedIP.getMask());
    }
    @Override
    public void handleRead(ResultSet resultSet) throws SQLException {
    resultSet.next(); // mask is unique, only one result allowed
    result.setId(resultSet.getInt("id"));
    result.setMask(resultSet.getString("mask"));
    result.setTimeEnd(resultSet.getTimestamp("time_end"));
    }
    });
    return true;
    }
    /**
    * {@inheritDoc}
    */
    @Override
    public boolean update(final BannedIP bannedIP) {
    return DB.insertUpdate("UPDATE banned_ip SET mask = ?, time_end = ? WHERE id = ?", new IUStH() {
    @Override
    public void handleInsertUpdate(PreparedStatement preparedStatement) throws SQLException {
    preparedStatement.setString(1, bannedIP.getMask());
    if (bannedIP.getTimeEnd() == null) {
    preparedStatement.setNull(2, Types.TIMESTAMP);
    } else {
    preparedStatement.setTimestamp(2, bannedIP.getTimeEnd());
    }
    preparedStatement.setInt(3, bannedIP.getId());
    preparedStatement.execute();
    }
    });
    }
    /**
    * {@inheritDoc}
    */
    @Override
    public boolean remove(final String mask) {
    return DB.insertUpdate("DELETE FROM banned_ip WHERE mask = ?", new IUStH() {
    @Override
    public void handleInsertUpdate(PreparedStatement preparedStatement) throws SQLException {
    preparedStatement.setString(1, mask);
    preparedStatement.execute();
    }
    });
    }
    /**
    * {@inheritDoc}
    */
    @Override
    public boolean remove(final BannedIP bannedIP) {
    return DB.insertUpdate("DELETE FROM banned_ip WHERE mask = ?", new IUStH() {
    @Override
    public void handleInsertUpdate(PreparedStatement preparedStatement) throws SQLException {
    // Changed from id to mask because we don't get id of last inserted ban
    preparedStatement.setString(1, bannedIP.getMask());
    preparedStatement.execute();
    }
    });
    }
    /**
    * {@inheritDoc}
    */
    @Override
    public Set<BannedIP> getAllBans() {
    final Set<BannedIP> result = new HashSet<BannedIP>();
    DB.select("SELECT * FROM banned_ip", new ReadStH() {
    @Override
    public void handleRead(ResultSet resultSet) throws SQLException {
    while (resultSet.next()) {
    BannedIP ip = new BannedIP();
    ip.setId(resultSet.getInt("id"));
    ip.setMask(resultSet.getString("mask"));
    ip.setTimeEnd(resultSet.getTimestamp("time_end"));
    result.add(ip);
    }
    }
    });
    return result;
    }
    /**
    * {@inheritDoc}
    */
    @Override
    public boolean supports(String s, int i, int i1) {
    return MySQL5DAOUtils.supports(s, i, i1);
    }
    }

    MySQL5BannedMacDAO

    package mysql5;
    import com.aionemu.commons.database.DB;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.Map;
    import javolution.util.FastMap;
    import org.jsemu.loginserver.dao.BannedMacDAO;
    import org.jsemu.loginserver.model.BannedMacEntry;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    /**
    *
    * @author KID
    *
    */
    public class MySQL5BannedMacDAO extends BannedMacDAO {
    private static final Logger log = LoggerFactory.getLogger(MySQL5AccountDAO.class);
    @Override
    public Map<String, BannedMacEntry> load() {
    Map<String, BannedMacEntry> map = new FastMap<String, BannedMacEntry>();
    PreparedStatement ps = DB.prepareStatement("SELECT `address`,`time`,`details` FROM `banned_mac`");
    try {
    ResultSet rs = ps.executeQuery();
    if (rs.next()) {
    String address = rs.getString("address");
    map.put(address, new BannedMacEntry(address, rs.getTimestamp("time"), rs.getString("details")));
    }
    } catch (SQLException e) {
    log.error("Error loading last saved server time", e);
    } finally {
    DB.close(ps);
    }
    return map;
    }
    @Override
    public boolean update(BannedMacEntry entry) {
    boolean success = false;
    PreparedStatement ps = DB.prepareStatement("REPLACE INTO `banned_mac` (`address`,`time`,`details`) VALUES (?,?,?)");
    try {
    ps.setString(1, entry.getMac());
    ps.setTimestamp(2, entry.getTime());
    ps.setString(3, entry.getDetails());
    success = ps.executeUpdate() > 0;
    } catch (SQLException e) {
    log.error("Error storing BannedMacEntry " + entry.getMac(), e);
    } finally {
    DB.close(ps);
    }
    return success;
    }
    @Override
    public boolean remove(String address) {
    boolean success = false;
    PreparedStatement ps = DB.prepareStatement("DELETE FROM `banned_mac` WHERE address=?");
    try {
    ps.setString(1, address);
    success = ps.executeUpdate() > 0;
    } catch (SQLException e) {
    log.error("Error removing BannedMacEntry " + address, e);
    } finally {
    DB.close(ps);
    }
    return success;
    }
    @Override
    public boolean supports(String databaseName, int majorVersion, int minorVersion) {
    return MySQL5DAOUtils.supports(databaseName, majorVersion, minorVersion);
    }
    }

    MySQL5DAOUtils

    package mysql5;
    /**
    * DAO utils for MySQL5
    *
    * @author SoulKeeper
    */
    public class MySQL5DAOUtils {
    /**
    * Constant for MySQL name ;)
    */
    public static final String MYSQL_DB_NAME = "MySQL";
    /**
    * Returns true only if DB supports MySQL5
    *
    * @param db
    * database name
    * @param majorVersion
    * major version
    * @param minorVersion
    * minor version, ignored
    * @return supports or not
    */
    public static boolean supports(String db, int majorVersion, int minorVersion) {
    return MYSQL_DB_NAME.equals(db) && majorVersion == 5;
    }
    }

    MySQL5GameServersDAO

    package mysql5;
    import com.aionemu.commons.database.DB;
    import com.aionemu.commons.database.DatabaseFactory;
    import com.aionemu.commons.database.ReadStH;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.HashMap;
    import java.util.Map;
    import org.jsemu.loginserver.GameServerInfo;
    import org.jsemu.loginserver.dao.GameServersDAO;
    import org.slf4j.LoggerFactory;
    /**
    * GameServers DAO implementation for MySQL5
    *
    * @author -Nemesiss-
    *
    */
    public class MySQL5GameServersDAO extends GameServersDAO {
    /**
    * {@inheritDoc}
    */
    @Override
    public Map<Byte, GameServerInfo> getAllGameServers() {
    final Map<Byte, GameServerInfo> result = new HashMap<Byte, GameServerInfo>();
    DB.select("SELECT * FROM gameservers", new ReadStH() {
    @Override
    public void handleRead(ResultSet resultSet) throws SQLException {
    while (resultSet.next()) {
    byte id = resultSet.getByte("id");
    String ipMask = resultSet.getString("mask");
    String password = resultSet.getString("password");
    GameServerInfo gsi = new GameServerInfo(id, ipMask, password);
    result.put(id, gsi);
    }
    }
    });
    return result;
    }
    @Override
    public void writeGameServerStatus(GameServerInfo gsi) {
    Connection con = null;
    try {
    con = DatabaseFactory.getConnection();
    String query = "UPDATE gameservers SET status = ? WHERE id = ?";
    PreparedStatement stmt = con.prepareStatement(query);
    stmt.setInt(1, gsi.isOnline() ? 1 : 0);
    stmt.setInt(2, gsi.getId());
    stmt.execute();
    } catch (Exception e) {
    LoggerFactory.getLogger(MySQL5GameServersDAO.class).error("Cannot write GS " + gsi.getId() + " status", e);
    } finally {
    DatabaseFactory.close(con);
    }
    }
    /**
    * {@inheritDoc}
    */
    @Override
    public boolean supports(String s, int i, int i1) {
    return MySQL5DAOUtils.supports(s, i, i1);
    }
    }
     
  12. Offline

    yayaya Ефрейтор Команда форума

    587
    183
    76
    Кредиты:
    $20.524,68
    Репутация:
    38
    Версия мускуля не совпадает с либами.
    \trunk\AC-Game\libs - в этой папке есть файл
    mysql-connector-java.....
    какой там номер?
     
  13. TopicStarter Overlay
    Offline

    Dolp

    9
    0
    1
    Кредиты:
    $181,46
    Репутация:
    0
    mysql-connector-java-5.1.18-bin
     
  14. Offline

    Dision Ефрейтор Команда форума VIP

    274
    62
    61
    Кредиты:
    $15.415,48
    Репутация:
    7
    Кстати да какой MySql вы юзаете?
     
  15. TopicStarter Overlay
    Offline

    Dolp

    9
    0
    1
    Кредиты:
    $181,46
    Репутация:
    0
    5.1
     
  16. TopicStarter Overlay
    Offline

    Dolp

    9
    0
    1
    Кредиты:
    $181,46
    Репутация:
    0
    так, с этим разобрался, нашел косяк (в path был выше путь тоже java, но в какую-то другую папку), исправил, сервера запускаются, спасибо тем, кто отозвался.

    вот только теперь ls и gs между собой конектиться не хотят, но это уже история не для этого топика... печаль тоска