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

  • SEARCH
  • Home
  • 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 4573312
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T19:46:04+00:00 2026-05-21T19:46:04+00:00

I have a web application that uses spring and hibernate. My hibernate session factory

  • 0

I have a web application that uses spring and hibernate. My hibernate session factory is configured in spring as:

<bean id="mySessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
    <property name="dataSource" ref="myDataSource" />
    <property name="configurationClass">
        <value>org.hibernate.cfg.AnnotationConfiguration</value>
    </property>
    <property name="hibernateProperties">
        <props>
            <prop key="hibernate.show_sql">true</prop>
            <prop key="hibernate.dialect">org.hibernate.dialect.SQLServer2005Dialect</prop>
            <prop key="hibernate.cache.use_query_cache">false</prop>
            <prop key="hibernate.cache.use_second_level_cache">false</prop>
        </props>
    </property>
    <property name="packagesToScan">
        <list>
            <value>com.example.dslibweb.model</value>
        </list>
    </property>
</bean>

The data source as:

<bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource">
    <property name="driverClassName" value="${jdbc.driverClassName}" />
    <property name="url" value="${jdbc.url}" />
    <property name="username" value="${jdbc.username}" />
    <property name="password" value="${jdbc.password}" />
    <property name="maxActive" value="${jdbc.maxConnections}" />
</bean>

and the properties file for the data source is:

jdbc.username=sa
jdbc.password=***
jdbc.url=jdbc:sqlserver://10.62.0.105:1433;databaseName=example;useUnicode=true;characterEncoding=utf-8
jdbc.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc.maxConnections=-1

I have a call:

DsActions action = (DsActions) this.hibernateCriteriaCommons.findById(id, new DsActions());

and findById is defined as:

public T findById(String id, Object model) {
    return (T) this.sessionFactory.getCurrentSession().get(model.getClass(), id);
}

So I am calling the get method of hibernate session for a specific id and I expect an instance of type DsActions.

All works well when I run it from a local Tomcat instance (run through netbeans).

When I install it on a remote tomcat server, the instance of DsActions seems to have an encoding issue. When retriveing a field of DsActions instance I get question marks (??? ?????? ??????). The text is supposed to be greek characters

I am very confused, I do not understand why in the first case it is working and not in the second.
Note: the data is retrieved by the same database server, so no difference there. The only difference is the machine where the application is running.

Thank you all in advance.

  • 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-05-21T19:46:05+00:00Added an answer on May 21, 2026 at 7:46 pm

    I’m pretty sure that Hibernate retrieves that field correctly, and the problem is in the way you output these characters.

    As a quick check you can add a condition such as f.contains("?") to your code and output its result – it should be false (if original string doesn’t contain ?s, of course).

    For possible problems in output see Unicode – How to get the characters right?.

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

Sidebar

Related Questions

We have a Java web application that uses Spring and Hibernate and has a
I have a web application that uses spring and hibernate for JPA support, but
I have a web application that uses the Spring Framework (3.1) and persistence through
I have a web application that uses spring security. It uses <intercept-url ../> elements
We have a web application that uses Spring (3.0.5) and CXF (currently 2.4.2 for
We have an ASP.NET web application running in IIS that uses the SoapHttpClientProtocol class
I have a Spring application that uses JAX-WS to consume another web service. Everything
I have a web app that uses Spring's Log4jConfigurer class to initialize my Log4J
We have a web application which uses Struts 2, Spring and Hibernate. Currently a
I have an application built on Spring MVC that uses Hibernate for all of

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.