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 7637021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:50:09+00:00 2026-05-31T07:50:09+00:00

I have a desktop app in Java that connects to a MySql database through

  • 0

I have a desktop app in Java that connects to a MySql database through Hibernate.

I have the following files for configuration:

  • pom.xml, where I put some stuff and database profiles
  • [app_name]_context.xml, where I put the main configuration, including the beans and the datasource
  • [app_name]_hibernate.cfg.xml, where I put the mappings to the tables

The app is almost finished, everything was working 100%, but then I decided to change the configuration to create DB profiles (before that the pom.xml didn’t include any profile).
So I created the profiles in pom.xml and referenced them from context.xml. Everything was working. Then I wanted the SQL to be printed to the terminal for debugging, and for some reason, it wasn’t being printed. So I changed the database configurations until I got it right. Everything was working. Then I changed it to the way it was before the sql-print changes, the exact configuration it was working before, but now I’m getting this error for a bean that was always there, and was never changed.

Here’s some code to understand it better:

The datasource in context.xml: (the ${} strings are filtered and replaced with the real values stored in pom.xml)

<bean id="desenvolvimentoDS" class="org.apache.commons.dbcp.BasicDataSource">
    <property name="driverClassName">
        <value>org.hibernate.dialect.MySQLDialect</value>
    </property>
    <property name="url">
        <value>${db.mysql.url}</value>
    </property>
    <property name="username">
        <value>${db.mysql.username}</value>
    </property>
    <property name="password">
        <value>${db.mysql.password}</value>
    </property>
</bean>

The current profile being used, in pom.xml:

<profile>
        <id>HOMOLOGACAO</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
            <profile.group>HOMOLOGACAO</profile.group>
            <maven.test.skip>true</maven.test.skip>
            <db.show_sql>true</db.show_sql>
            <db.format_sql>false</db.format_sql>
            <db.mysql.url>[filtered]</db.mysql.url>
            <db.mysql.username>[filtered]</db.mysql.username>
            <db.mysql.password>[filtered]</db.mysql.password>
        </properties>
    </profile>

The resource part of pom.xml, that tells Spring to filter those context.xml strings to the profiles values:

    <resources>
        <resource>
            <directory>src/main/resources/configuracao</directory>
            <filtering>true</filtering>
        </resource>
    </resources>

And finally, the bean that is giving me the error:

<bean name="servidorUDP"
    class="br.uff.pgci.sgca.gateway.server.ServidorUDP"
    scope="singleton"/>

Resuming, I created the database profiles to organize the configurations, changed some database configurations back and forth, and suddenly I’m getting “NoSuchBeanDefinitionException no bean named ServidorUDP” error.

Could this be caused by misplaced linebreaks, or spaces, or wrong open/close xml tags? I’m pretty sure this isn’t the case, but we never know…

  • 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-31T07:50:10+00:00Added an answer on May 31, 2026 at 7:50 am

    Where exactly you placed your [app_name]_context.xml? Does the filters you introduced in the pom is skipping the bean definition xml?

    Check this maven pom reference http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html, it might give you some clues.

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

Sidebar

Related Questions

We have a Windows Java desktop application that creates some configuration files at %APPDATA%
I have a rather large (80k loc) java desktop app that talks to a
I have a small Java desktop app that uses Swing. There is a data
i have a java based desktop app that i am hoping to rewrite as
I have a Java rich client desktop app. that I want to distribute on
I have a Java web application that has a 'disconnected' Java Swing desktop app.
I have a desktop (winforms) application that uses a Firebird database as a data
We have a one Java Swing app. Now there is one requirement that it
We have a desktop application written in Java Swing that currently uses Java Web
I have following code in web aplication java.​awt.Desktop.getDesktop().print(new File(path)); It is working with any

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.