-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Could not initialize class javabean.HibernateUtil
PostPosted: Tue Aug 31, 2010 2:40 am 
Newbie

Joined: Tue Aug 31, 2010 2:32 am
Posts: 4
I am trying to upload data from client to server using webservices

I am getting this exception....

Can anyone help me out in resolving it.

Thank you

javax.xml.ws.soap.SOAPFaultException: Could not initialize class javabean.HibernateUtil
at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:188)
at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:130)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)
at $Proxy33.insertMigrationReturn(Unknown Source)
at Scheduler_package.CallWebServiceJob.upload(CallWebServiceJob.java:154)
at Scheduler_package.CallWebServiceJob.execute(CallWebServiceJob.java:70)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class javabean.HibernateUtil
at manager.ManagerPhoto.createAndStoreData(ManagerPhoto.java:52)
at WebService.InsertTable.InsertMigrationReturn(InsertTable.java:63)
at sun.reflect.GeneratedMethodAccessor269.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:246)
at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)
at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)
at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:93)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:598)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:557)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:542)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:439)
at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:470)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75)
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:127)
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:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)


Top
 Profile  
 
 Post subject: Re: Could not initialize class javabean.HibernateUtil
PostPosted: Tue Aug 31, 2010 3:14 am 
Beginner
Beginner

Joined: Thu Dec 11, 2008 8:18 am
Posts: 35
can you please send the code.


Top
 Profile  
 
 Post subject: Re: Could not initialize class javabean.HibernateUtil
PostPosted: Tue Aug 31, 2010 3:18 am 
Newbie

Joined: Tue Aug 31, 2010 2:32 am
Posts: 4
This is my HibernateUtil file.

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package javabean;

import java.io.FileInputStream;
import java.io.InputStream;
import org.hibernate.SessionFactory;
import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;
import org.hibernate.cfg.Configuration;

/**
* Hibernate Utility class with a convenient method to get Session Factory object.
*
* @author Administrator
*/
public class HibernateUtil {
private static final SessionFactory sessionFactory;

static {
try{
// Create the SessionFactory from standard (hibernate.cfg.xml)
// config file.
String configfile=System.getProperty("user.dir")+"\\"+"GENURN.conf";
/*------------------ to see the path of the configuration file---------------*/
// System.out.println("config file is:"+configfile);
InputStream in = new FileInputStream(configfile);
ResourceBundle resource = new PropertyResourceBundle(in);
Configuration cfg = new Configuration()
.setProperty("hibernate.connection.url",
resource.getString("hibernate.connection.url"))
.setProperty("hibernate.connection.password",
resource.getString("DbObject.OraclePassword"))
.setProperty("hibernate.connection.username",
resource.getString("DbObject.OracleUser"));
sessionFactory = cfg.configure().buildSessionFactory();

} catch (Throwable ex) {
// Log the exception.
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}
}

public static SessionFactory getSessionFactory() {
return sessionFactory;
}
}


Top
 Profile  
 
 Post subject: Re: Could not initialize class javabean.HibernateUtil
PostPosted: Tue Aug 31, 2010 3:43 am 
Beginner
Beginner

Joined: Thu Dec 11, 2008 8:18 am
Posts: 35
This type of error gives the indication of missing jar files.
Did you add cglib and asm related jar files in the classpath.


Top
 Profile  
 
 Post subject: Re: Could not initialize class javabean.HibernateUtil
PostPosted: Tue Aug 31, 2010 4:31 am 
Newbie

Joined: Tue Aug 31, 2010 2:32 am
Posts: 4
The cglib and asm related jar files is not added.

If I work in test environment (local network and windows) I am able to upload...

But when I am moving the same to production environment(WAN and Linux),

I am facing the issue...

Shall I add cglib and asm related jar files? and to client or server

Thank you


Top
 Profile  
 
 Post subject: Re: Could not initialize class javabean.HibernateUtil
PostPosted: Tue Aug 31, 2010 6:36 am 
Newbie

Joined: Tue Aug 31, 2010 2:32 am
Posts: 4
The problem is with this line

String configfile=System.getProperty("user.dir")+"\\"+"GENURN.conf";

Because in Linux \\ is not recognized so we changed to / and now its working fine.

Instead of throwing file not found exception it thrown that exception thats why

Thanks a lot achyut


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.