When i checked tomcat logs..i think its falling error while its
creating session(hibernate) from service.Please guide me in this..
[ERROR] Could not initialize class org.hibernate.impl.SessionFactoryImpl
java.lang.NoClassDefFoundError: Could not initialize class
org.hibernate.impl.SessionFactoryImpl
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1043)
at ch.elca.des.testwebservice.testDBDAO.initSession(testDBDAO.java:19)
at ch.elca.des.testwebservice.testDBDAO.InsertRow(testDBDAO.java:40)
at
ch.elca.des.testwebservice.testWService.GenerateName(testWService.java:12)
at ch.elca.des.testwebservice.TestSkeleton.insert(TestSkeleton.java:35)
at
ch.elca.des.testwebservice.TestMessageReceiverInOut.invokeBusinessLogic(TestMessageReceiverInOut.java:51)
at
org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:100)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:133)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:857)
at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565)
at
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509)
at java.lang.Thread.run(Unknown Source)
testDBDAO.java
----------------
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
public class testDBDAO {
public Session session;
public testDBDAO(){
}
public void initSession(){
//this.session=null;
try{
// This step will read hibernate.cfg.xml and prepare hibernate
for use
SessionFactory sessionFactory = new
Configuration().configure().buildSessionFactory();
this.session =sessionFactory.openSession();
if(this.session==null)
System.out.println("session null");
}catch(Exception e){
System.out.println(e.getMessage());
}
}
public void closeSession(){
// Actual Ticket insertion will happen at this step
try {
if(this.session==null)
System.out.println("session null");
else{
this.session.flush();
this.session.close();
}
}catch(Exception e){ System.out.println(e.getMessage() +
"erroe");}
}
public void InsertRow(testService t){
try{
this.initSession();
System.out.println("Inserting a new Record in
testtable");
System.out.println("-----------------------");
Transaction tx = null;
try{
tx=this.session.beginTransaction();
this.session.save(t);
}catch(Exception e){
if(tx!=null)
tx.rollback();
throw e;
}
tx.commit();
}catch(Exception e){
System.out.println(e.getMessage());
}finally{
this.closeSession();
}
}
}
--- On Tue, 17/2/09, robert lazarski <[email protected]> wrote:
> From: robert lazarski <[email protected]>
> Subject: Re: Problem in Hibernate Axis2 Integration !! Help Required
> To: [email protected], [email protected]
> Date: Tuesday, 17 February, 2009, 10:20 AM
> On Tue, Feb 17, 2009 at 3:09 PM, gade anudeep
> <[email protected]> wrote:
> > at
> ch.elca.des.testwebservice.TestStub.insert(TestStub.java:183)
> > at
> ch.elca.des.testwebservice.TicketWSClient.GenerateName(TicketWSClient.java:29)
>
> You have some type of exception in that code - seemingly
> something you
> wrote - and need to debug it. Maybe add some logging?
>
> - R
From Chandigarh to Chennai - find friends all over India. Go to
http://in.promos.yahoo.com/groups/citygroups/