Hi, friends...
I,m getting the following error
java.lang.NoClassDefFoundError: oracle/dms/console/DMSConsole
at oracle.jdbc.driver.DMSFactory.<clinit>(DMSFactory.java:27)
at oracle.jdbc.driver.OracleConnection.createDMSSensors(OracleConnection.java:506)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:330)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:485)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:337)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at net.sf.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:101)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:73)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1155)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:789)
at work.AmigoDAO.<init>(AmigoDAO.java:16)
at work.Listar.lista(Listar.java:31)
at work.TesteAmigo.main(TesteAmigo.java:54)
Exception in thread "main"
I had copy all files from an stand-alone application that was working fine, and insert into an application under Eclipse seted to work with Tomcat but i´m not using it connected to a server yet and did not create a JSP yet. The Tomcat is stoped and i was trying to run my application stand-alone. After, i'll write the JSP code and start Tomcat. I had updated the xmls to point to the new package.
The DAO code is:
package work;
import java.util.List;
import net.sf.hibernate.Session;
import net.sf.hibernate.SessionFactory;
import net.sf.hibernate.Transaction;
import net.sf.hibernate.cfg.Configuration;
public class AmigoDAO{
private SessionFactory factory;
public AmigoDAO() throws Exception{
factory = new Configuration().configure().buildSessionFactory();
Session session = factory.openSession();
java.sql.Connection cn = session.connection();
}
public void insert(Amigo amigo) throws Exception
{
Session session = factory.openSession();
Transaction t = session.beginTransaction();
session.save(amigo);
t.commit();
session.flush();
session.close();
}
public void update(Amigo amigo) throws Exception
{
Session session = factory.openSession();
Transaction t = session.beginTransaction();
session.saveOrUpdate(amigo);
t.commit();
session.flush();
session.close();
}
public java.util.List getList(String sqlQuery) throws Exception
{
Session session = factory.openSession();
List amigos = session.find(sqlQuery);
session.flush();
session.close();
return amigos;
}
public Amigo retrieve(String pk) throws Exception
{
Session session = factory.openSession();
Transaction t = session.beginTransaction();
Amigo amigo = (Amigo)session.load(Amigo.class, pk);
t.commit();
session.flush();
session.close();
return amigo;
}
public void delete(Amigo amigo) throws Exception
{
Session session = factory.openSession();
Transaction t = session.beginTransaction();
session.delete(amigo);
t.commit();
session.flush();
session.close();
}
}
Can i do that seted with a Tomcat application?
Thank for your help...
|