I just started using Proxool (JDBC Connection Pool manager). I downloaded the jar which is found at the following link: http://proxool.sourceforge.net/download.html. After that, I just added the jar location into the ClassPath in netbeans 7.0.1, built the project, restarted my server (which is Glassfish) and then tried to configure it as this example shows:
https://java2s.com/Open-Source/Java/Database-JDBC-Connection-Pool/proxool/org/logicalcobwebs/proxool/ProxoolDataSourceTest.java.htm
I just adapted the Example (parameters) to fix into my application and the following piece of code below crashes. It shows the error java.lang.NoClassDefFoundError: Could not initialize class org.logicalcobwebs.proxool.ProxoolDataSource
.
I can't understand why because I just imported the whole package. I do not know where to start.
Here's my code:
import org.logicalcobwebs.proxool.*;
import org.logicalcobwebs.*;
/* Error Here ----> */ ProxoolDataSource dataSource = new ProxoolDataSource();
dataSource.setAlias("flpool");
dataSource.setDriver("com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource");
dataSource.setDriverUrl("jdbc:mysql://localhost:3306/superdb");
dataSource.setUser("db");
dataSource.setPassword("password");
dataSource.setMaximumActiveTime(100);
dataSource.setMinimumConnectionCount(8);
dataSource.setMaximumConnectionCount(25);
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.rmi.registry.RegistryContextFactory");
env.put(Context.PROVIDER_URL, "rmi://localhost:1099");
Context context = new InitialContext(env);
context.createSubcontext("jdbc");
context.bind(jndiName,dataSource);
context.close();
DataSource ds = (DataSource) context.lookup(jndiName);
ProxoolFacade.removeConnectionPool("flpool");
context.close();
if someone have any idea will appreciate it your help, thanks in advance.