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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:20:15+00:00 2026-05-18T23:20:15+00:00

Here is my bean.xml <?xml version=1.0 encoding=UTF-8?> <beans xmlns=http://www.springframework.org/schema/beans xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:context=http://www.springframework.org/schema/context xmlns:p=http://www.springframework.org/schema/p xmlns:tx=http://www.springframework.org/schema/tx xsi:schemaLocation=

  • 0

Here is my bean.xml

 <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:context="http://www.springframework.org/schema/context"
  xmlns:p="http://www.springframework.org/schema/p"
  xmlns:tx="http://www.springframework.org/schema/tx"
  xsi:schemaLocation="
  http://www.springframework.org/schema/tx 
  http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
  http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
  http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

<!-- Turn on AspectJ @Configurable support -->

<context:spring-configured />
<context:property-placeholder location="classpath*:*.properties" />
<context:component-scan base-package="your.intermedix"/>
<context:annotation-config/>

<!-- Turn on @Autowired, @PostConstruct etc support -->
<bean class="org.springframework.context.annotation.CommonAnnotationBeanPostProcessor" />

<bean id="mySessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
        <property name="dataSource" ref="myDataSource" />
        <property name="annotatedClasses">
            <list>
                <value>your.intermedix.domain.Contact</value>
            </list>
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
                <prop key="hibernate.show_sql">true</prop>
                <prop key="hibernate.hbm2ddl.auto">create</prop>
            </props>
        </property>
    </bean>

    <bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
        <property name="url" value="jdbc:mysql://127.0.0.1:3306/spring"/>
        <property name="username" value="monty"/>
        <property name="password" value="indian"/>
    </bean>   

    <tx:annotation-driven transaction-manager="txManager"/>

    <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
      <property name="sessionFactory" ref="mySessionFactory" />
    </bean>

</beans>

My Service class

package your.intermedix.services;


import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import your.intermedix.domain.Contact;
import your.intermedix.services.IContact;

@Service
@Transactional
public class ContactSerImpl extends HibernateDaoSupport implements IContact {

        public Contact saveContact(Contact contact) {
            System.out.println(contact);
            getHibernateTemplate().saveOrUpdate(contact);
            return contact;
        }

        public void hello() {
            System.out.println("Hello Guru");
        }
}

My Frontend

package your.intermedix;

import java.util.logging.Logger;

import your.intermedix.domain.Contact;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Form;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.data.util.BeanItem;
import com.vaadin.terminal.Sizeable;
import com.vaadin.terminal.UserError;
import com.vaadin.ui.Window;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.stereotype.Controller;

import your.intermedix.domain.ContactValdiation;
import your.intermedix.services.IContact;


/**
 * The Application's "main" class
 */
@SuppressWarnings("serial")
@Configurable(preConstruction = true)
@Controller
public class MyVaadinApplication extends Application implements Button.ClickListener
{

    @Autowired
    private transient IContact icontact;

    private Window window;
    private Button save = new Button("Save", (ClickListener) this);
    private Button cancel = new Button("Cancel", (ClickListener) this);
    private Contact contact = new Contact();
    private Form form = new Form();
    private BeanItem item = new BeanItem(contact);
    private GridLayout ourLayout;


        public void init(){         
            loadForm();
        }

        private void loadForm(){
            window = new Window("InterMedix Application");
            setMainWindow(window);
                final Panel panel = new Panel("Contact Information");
                panel.addStyleName("panelexample");
            // The width of a Panel is 100% by default, make it
            // shrink to fit the contents.
                panel.setWidth(Sizeable.SIZE_UNDEFINED, 0);
                form.setWriteThrough(false);
                form.setInvalidCommitted(false);
                form.setImmediate(true);
                form.setFormFieldFactory(new ContactValdiation());
                form.setRequired(true);
                form.setItemDataSource(item);
                form.setVisibleItemProperties(new Object[] {"name","lastname","email","designation","date","comments"});
                form.setValidationVisibleOnCommit(true);
                form.setFooter(new VerticalLayout());
                // Have a button bar in the footer.
                HorizontalLayout buttons = new HorizontalLayout();
                form.getLayout().addComponent(buttons);
                buttons.addComponent(save);
                buttons.addComponent(cancel);
                panel.addComponent(form);

            window.addComponent(panel);

        }   


        public void buttonClick(ClickEvent event) {

            if (event.getSource() == save) {
                try {
                    form.commit();
                    icontact.hello();
                    icontact.saveContact(contact);
                }
                 catch (Exception e)    {

                 }
                }
            }
        }

The Error below:

2011-01-04 21:57:46.331:WARN::Failed startup of context org.mortbay.jetty.plugin.Jetty6PluginWebAppContext@14ce5eb{/sampleproject,file:/C:/projects/sampleproject/src/main/webapp/;file:/C:/projects/sampleproject/target/sampleproject-1.0/;}
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘myVaadinApplication’: Unsatisfied dependency expressed through bean property ‘user’: No unique bean of type [java.lang.Object] is defined: expected single matching bean but found 15: [org.springframework.context.config.internalBeanConfigurerAspect, org.springframework.beans.factory.config.PropertyPlace
holderConfigurer#0, contactSerImpl, org.springframework.context.annotation.internalRequiredAnnotationProcessor, org.springframework.context.annotation.internalAutowiredAnnotationProcessor, org.springframework.context.annotation.internalCommonAnnotationProcessor, org.springframework.context.annotation.internalPersistenceAnnotationProcessor, org.springframework.context.annotation.CommonAnnotationBea
nPostProcessor#0, mySessionFactory, myDataSource, org.springframework.aop.config.internalAutoProxyCreator, org.springframework.transaction.config.internalTransactionAdvisor, txManager, messageSource, applicationEventMulticaster]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1119)

  • 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-18T23:20:16+00:00Added an answer on May 18, 2026 at 11:20 pm

    I think you are doing several things multiple times:

    This:

    <context:annotation-config/>
    

    already includes this:

    <!-- Turn on @Autowired, @PostConstruct etc support -->
    <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor" />
    <bean class="org.springframework.context.annotation.CommonAnnotationBeanPostProcessor" />
    

    Remove the <bean> definitions and try again, perhaps that’s the reason.

    Reference: Annotation-based container configuration


    Update: about your new error:

    HibernateDaoSupport needs either a HibernateTemplate or a SessionFactory as dependency. You have a SessionFactory, but Spring can’t wire it because by default, Spring doesn’t autowire properties, so you need to either manually wire the property or set <beans default-autowire="byType"> (if you use byName, you will have to change your SessionFactory bean definition to id="sessionFactory")

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

Sidebar

Related Questions

Here is my security-context.xml file <?xml version=1.0 encoding=UTF-8?> <beans xmlns=http://www.springframework.org/schema/beans xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:sec=http://www.springframework.org/schema/security xmlns:aop=http://www.springframework.org/schema/aop xsi:schemaLocation=http://www.springframework.org/schema/beans
Here is the context for Spring Batch: <beans:beans xmlns:beans=http://www.springframework.org/schema/beans xmlns:b=http://www.springframework.org/schema/batch xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
here is my web.xml : <?xml version=1.0 encoding=UTF-8?> <web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee xmlns:xml=http://www.w3.org/XML/1998/namespace xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
I have got my main.xml as follows: <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=fill_parent
I need help making AOP work. What am I missing here? <?xml version=1.0 encoding=UTF-8?>
Here is my code, which takes two version identifiers in the form 1, 5,
Let's say I have following Spring config (version of Spring is 3.0.3): <?xml version=1.0
The basic problem I have here is that I have one xml file that
Here is my situation: I have my mvc-config.xml file for my web service set
Here's the problem in a nutshell: <bean id=handlerFactory class=com.westfieldgrp.audit.jdklogging.cpm.CPMHandlerFactory> <property name=schemaName value=${env.audit.databaseSchema} /> <property

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.