Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9202241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:12:31+00:00 2026-06-17T23:12:31+00:00

we are integrating the java blazeds hibernate with flex project..First we tested the pure

  • 0

we are integrating the java blazeds hibernate with flex project..First we tested the pure java hibernate in eclipse and it is executing fine. But when we put the same in tomcat for flex integration with blazeds it is showing the following error.this is the only error.

Jan 24, 2013 11:31:31 AM org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.2.6
Jan 24, 2013 11:31:31 AM org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
Jan 24, 2013 11:31:31 AM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : cglib
Jan 24, 2013 11:31:31 AM org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
Jan 24, 2013 11:31:31 AM org.hibernate.cfg.Configuration configure
INFO: configuring from resource: /hibernate.cfg.xml
Jan 24, 2013 11:31:31 AM org.hibernate.cfg.Configuration getConfigurationInputSt
ream
INFO: Configuration resource: /hibernate.cfg.xml

this is the hibernate.cfg.xml(To identify whether hibernate.cfg.xml is not found and i tested by deleting DOCTYPE of .cfg.xml then tomcat output displayed saying the root element is not found…which means it is able to find the hibernate.cfg.xml( i think)

 <?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <property name="connection.url">jdbc:mysql://localhost/test</property>
        <property name="connection.username">root</property>
        <property name="connection.password">root</property>
        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="dialect">org.hibernate.dialect.MySQLDialect</property>

        <property name="show_sql">true</property>

        <property name="format_sql">true</property>

        <!-- JDBC connection pool (use the built-in) -->
        <property name="connection.pool_size">1</property>

         <property name="current_session_context_class">thread</property>
        <mapping class="com.model.User" />
        <mapping class="com.model.UserDetails" />
        <mapping class="com.model.LoanDetails" />
        <mapping class="com.model.BorrowerDetails" />

    </session-factory>
</hibernate-configuration>

this is hiberutil.java

public class HibernateUtil
{



    private static  SessionFactory sessionFactory=configureSessionFactory();
    private static ServiceRegistry serviceRegistry;


    private static SessionFactory configureSessionFactory() throws HibernateException {
        Configuration configuration = new Configuration();
        configuration.configure();
        serviceRegistry = new ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry();        
        sessionFactory = configuration.buildSessionFactory(serviceRegistry);
        return sessionFactory;
    }
    public static SessionFactory getSessionFactory()
    {
        return sessionFactory;
    }
}

why the error is showing? the control is coming from flex side and executing the starting point of the java method…but when it comes to hibernate stuff execution, it is showing this error in tomcat…

But when i execute java+hibernate as a pure java application it is executing fine..

can anybody help me?

Thanks

EDIT 1 After the modification suggested by @Andremoniy and putting the .cfg.xml in src folder and here also in eclipse it is working but not in tomcat with flex

following error comes

org.hibernate.MappingException: An AnnotationConfiguration instance is required
to use <mapping class="com.model.User"/>
        at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.jav
a:1606)
        at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.jav
a:1561)
        at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1540)
        at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1514)
        at org.hibernate.cfg.Configuration.configure(Configuration.java:1434)
        at org.hibernate.cfg.Configuration.configure(Configuration.java:1420)
        at com.sample.HibernateUtil.configureSessionFactory(HibernateUtil
.java:26)
        at com.sample.HibernateUtil.<clinit>(HibernateUtil.java:20)
        at com.sample.App.checkUser(App.java:34)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:12:33+00:00Added an answer on June 17, 2026 at 11:12 pm

    I guess the problem is with the code for configuration you mentioned for .hbm.xml may not be working in Tomcat.

    I think it needs AnnotationConfiguration object. I guess you used this code due to the Annotationconfiguration object creation is not working.

    Better create a maven hibernate project with pom and export the war file to Tomcat (with the changes of Annotationconfiguration). Also use log4j jar for showing the details of Tomcat execution with the debug outputs, so that Tomcat output will print all of execution flow.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having Flex + Spring BlazeDS Integration + Java combination for my project.
I have a Java-based server side and a flex client side using Spring BlazeDS
We have a large scale Java web application project. I am considering integrating some
I know there are plenty of tutorials about integrating C++ into Java, but whats
I'm looking at integrating an ESB into an existing Java/Maven web based product. Specifically,
I'm using java.awt.Robot for integration tests of my Swing application, but I'm having trouble
I am integrating a WordPress template. But my category list is repeating again. This
I am Integrating Face book application with Our Website. My Website is in Java's
Our application is written in Java. Now we are integrating with a different company
I am new to Flex and need to integrate Java services with Flex UI

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.