Рейтинг темы:
  • 0 Голос(ов) - 0 в среднем
  • 1
  • 2
  • 3
  • 4
  • 5
Проблема компиляции
#1
Добрый день!

При компиляции исходов Shark-TM возникает ошибка:

C:\srv>ant
Buildfile: C:\srv\build.xml

init:

compile-commons:
[delete] Deleting directory C:\srv\build\classes
[mkdir] Created dir: C:\srv\build\classes
[javac] C:\srv\build.xml:56: warning: 'includeantruntime' was not set, defau
lting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 77 source files to C:\srv\build\classes
[javac] warning: [options] bootstrap class path not set in conjunction with
-source 1.6
[javac] C:\srv\commons\java\la2shark\commons\dbcp\BasicDataSource.java:24: e
rror: BasicDataSource is not abstract and does not override abstract method getP
arentLogger() in CommonDataSource
[javac] public class BasicDataSource implements DataSource
[javac] ^
[javac] 1 error
[javac] 1 warning

BUILD FAILED
C:\srv\build.xml:56: Compile failed; see the compiler error output for details.

Total time: 5 seconds

Подскажите что делать? Насколько я понял, нужно изменять методы в BasicDataSource.java

Сам код файла BasicDataSource.java:

package la2shark.commons.dbcp;

import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Properties;

import javax.sql.DataSource;

import org.apache.commons.dbcp.ConnectionFactory;
import org.apache.commons.dbcp.DriverManagerConnectionFactory;
import org.apache.commons.dbcp.PoolableConnectionFactory;
import org.apache.commons.dbcp.PoolingDataSource;
import org.apache.commons.pool.ObjectPool;
import org.apache.commons.pool.impl.GenericKeyedObjectPool;
import org.apache.commons.pool.impl.GenericKeyedObjectPoolFactory;
import org.apache.commons.pool.impl.GenericObjectPool;

/**
* Базовая реализация пула потоков с использованием DBCP
*
* @author G1ta0
*/
public class BasicDataSource implements DataSource
{
private final PoolingDataSource _source;
private final ObjectPool _connectionPool;

/**
*
* @param driver The fully qualified Java class name of the JDBC driver to be used.
* @param url The connection URL to be passed to our JDBC driver to establish a connection.
* @param uname The connection username to be passed to our JDBC driver to establish a connection.
* @param passwd The connection password to be passed to our JDBC driver to establish a connection.
* @param maxActive The maximum number of active connections that can be allocated from this pool at the same time, or negative for no limit.
* @param idleTimeOut The minimum amount of time connection may stay in pool (in seconds)
* @param idleTestPeriod The period of time to check idle connections (in seconds)
* @param poolPreparedStatements
* @throws SQLException
*/
public BasicDataSource(String driver, String connectURI, String uname, String passwd, int maxActive, int maxIdle, int idleTimeOut, int idleTestPeriod, boolean poolPreparedStatements)
{
GenericObjectPool connectionPool = new GenericObjectPool(null);

connectionPool.setMaxActive(maxActive);
connectionPool.setMaxIdle(maxIdle);
connectionPool.setMinIdle(1);
connectionPool.setMaxWait(-1L);
connectionPool.setWhenExhaustedAction(GenericObjectPool.WHEN_EXHAUSTED_GROW);
connectionPool.setTestOnBorrow(false);
connectionPool.setTestWhileIdle(true);
connectionPool.setTimeBetweenEvictionRunsMillis(idleTestPeriod * 1000L);
connectionPool.setNumTestsPerEvictionRun(maxActive);
connectionPool.setMinEvictableIdleTimeMillis(idleTimeOut * 1000L);

GenericKeyedObjectPoolFactory statementPoolFactory = null;
if(poolPreparedStatements)
statementPoolFactory = new GenericKeyedObjectPoolFactory(null, -1, GenericObjectPool.WHEN_EXHAUSTED_FAIL, 0L, 1, GenericKeyedObjectPool.DEFAULT_MAX_TOTAL);

Properties connectionProperties = new Properties();
connectionProperties.put("user", uname);
connectionProperties.put("password", passwd);

ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(connectURI, connectionProperties);

@SuppressWarnings("unused")
PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory, connectionPool, statementPoolFactory, "SELECT 1", false, true);

PoolingDataSource dataSource = new PoolingDataSource(connectionPool);

_connectionPool = connectionPool;
_source = dataSource;
}

public Connection getConnection(Connection con) throws SQLException
{
return con == null || con.isClosed() ? con = _source.getConnection() : con;
}

public int getBusyConnectionCount() throws SQLException
{
return _connectionPool.getNumActive();
}

public int getIdleConnectionCount() throws SQLException
{
return _connectionPool.getNumIdle();
}

public void shutdown() throws Exception
{
_connectionPool.close();
}

@Override
public PrintWriter getLogWriter() throws SQLException
{
return _source.getLogWriter();
}

@Override
public void setLogWriter(PrintWriter out) throws SQLException
{
_source.setLogWriter(out);
}

@Override
public void setLoginTimeout(int seconds) throws SQLException
{
throw new UnsupportedOperationException();
}

@Override
public int getLoginTimeout() throws SQLException
{
throw new UnsupportedOperationException();
}

@Override
public <T> T unwrap(Class<T> iface) throws SQLException
{
throw new UnsupportedOperationException();
}

@Override
public boolean isWrapperFor(Class<?> iface) throws SQLException
{
return false;
}

@Override
public Connection getConnection() throws SQLException
{
return _source.getConnection();
}

@Override
public Connection getConnection(String username, String password) throws SQLException
{
throw new UnsupportedOperationException();
}
}
Ответ
#2
Java у тебя какая?
Ответ
#3
6я, факт. Добавляй метод:
Код:
public Logger getParentLogger() throws SQLFeatureNotSupportedException {
        return Logger.getLogger(BasicDataSource.class.getName());
    }
Ответ
#4
YaGo Написал:6я, факт. Добавляй метод:
Код:
public Logger getParentLogger() throws SQLFeatureNotSupportedException {
        return Logger.getLogger(BasicDataSource.class.getName());
    }

а точней седьмая )) поставьте 6 версию или добавьте выше описаный метод
consulo.io - Consulo - multi-language IDE
Ответ
#5
VISTALL;211274 Написал:а точней седьмая )) поставьте 6 версию или добавьте выше описаный метод
Точно, ошибся Sad 6й до борта, есть ли он там или нет Smile
Ответ
#6
ant -f "D:\\server\\shark-tm source(up1)" dist
init:
compile-commons:
Deleting directory D:\server\shark-tm source(up1)\build\classes
Created dir: D:\server\shark-tm source(up1)\build\classes
D:\server\shark-tm source(up1)\build.xml:56: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
Compiling 77 source files to D:\server\shark-tm source(up1)\build\classes
D:\server\shark-tm source(up1)\commons\java\la2shark\commons\dbcp\BasicDataSource.java:1: illegal character: \65279
?package la2shark.commons.dbcp;
1 error
D:\server\shark-tm source(up1)\build.xml:56: Compile failed; see the compiler error output for details.
СБОРКА ЗАВЕРШЕНА СО СБОЕМ (общее время: 0 секунд)

А у меня вот такая ошибка, поставил 6 яву и всёравно... Помогите плиз!
Ответ
#7
Помогите плиииз!
Ответ


Возможно похожие темы ...
Тема Автор Ответы Просмотры Последний пост
  Проблема с квестами "Письма Кекропуса" Metallurg1985 0 542 11-05-2023, 07:01 PM
Последний пост: Metallurg1985
  Проблема с баферами Mor9k400 4 1,911 09-10-2018, 09:08 PM
Последний пост: Mor9k400
  Проблема с созданием персонажа Trufan 3 1,928 08-18-2016, 01:26 PM
Последний пост: Gaikotsu
  Проблема с custom jscripts. Сборка pw ESCfromReality 2 1,984 08-14-2016, 04:05 PM
Последний пост: KID
  Проблема с компилом Nez 2 1,728 08-04-2016, 04:08 PM
Последний пост: Nez
  Ошибки при компиляции Snork28 4 2,396 06-02-2016, 02:58 PM
Последний пост: Snork28
  Проблема с квестом взросление дракончика nemoruss 3 1,774 01-29-2016, 01:35 AM
Последний пост: nemoruss
  Проблема с квестом Elrokian Hunter's Proof Goffa 1 1,478 01-26-2016, 12:04 PM
Последний пост: GenCloud
  Проблема с лучниками vanyahunter123 3 1,694 12-13-2015, 09:15 AM
Последний пост: HiredKiller
  Проблема с скриптом DroNik 1 1,370 08-10-2015, 12:20 AM
Последний пост: Mosinnik

Перейти к форуму:


Пользователи, просматривающие эту тему: 1 Гость(ей)