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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:51:22+00:00 2026-05-31T06:51:22+00:00

Please forgive if i use terminology wrong, but i’m new to java-web development and

  • 0

Please forgive if i use terminology wrong, but i’m new to java-web development and Spring.
Correct my assumptions, if i’m wrong.

I want to create a WebApp, that uses Vaadin for UI and Spring MVC for RESTful Web-Services.
So, i think, I need 2 Servlets.
One for serving Vaadin and one for serving Spring MVC.

I have some generic dao-beans, which are used by both servlets, so i thought, that i could use Spring, with @Autowired annotation to inject those @Repository and @Component – tagged beans into the MVC and the Vaadin-“(App|Servlet)”. (Discovered through springs component-scan – feature)

But i can’t get it working.
The Spring-MVC-App – works. I’ve annotated all @Controllers and all things are @Autowired automaticly.

But in Vaadin i always get:

SCHWERWIEGEND: Servlet.service() for servlet [hello] in context with path [/pliste] threw exception [javax.servlet.ServletException: failed to acquire new instance of class net.d21.pliste.HelloWorld] with root cause
org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [net.d21.pliste.HelloWorld] is defined: expected single bean but found 0: 

I think my basic question is, how to inject general dependencies into 2 different servlets? (In my case it’s Vaadin and MVC, but i think it’s replaceable).

  • 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-31T06:51:24+00:00Added an answer on May 31, 2026 at 6:51 am

    A typical Spring webapp has a 2-level hierarchy of application contexts:

    • Root application context loaded by ContextLoaderListener, its default config file is applicationContext.xml. This context contains common beans that can be used by all servlets, filters, etc.

    • Servlet-specific application contexts. Their default config locations are ${serlvet-name}-servlet.xml. These contexts contain beans specific to particualr servlets.

    So, in your case you need to declare common beans in applicationContext.xml and servlet-specific beans (for example, controllers for Spring MVC) in servlet-specific contexts.

    Note that if you use <component-scan> you need to avoid duplication of beans in different contexts, either by using different base packages or by filtering them by annotations.

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

Sidebar

Related Questions

Please forgive me if any of this is wrong -I'm completely new to Java.
Please forgive this rather basic question, but I'm very new to Java and still
I'm new in Java so please forgive any obscene errors that I may make
im new to android development so please forgive me if this is an easy
Please forgive my ignorance, but I am very new to IOC and NinJect. I
I'm fairly new to Java so please forgive me if this is a stupid
(please forgive my english) I'm new at IOS developing but I've a good skill
I'm new to web design, so please forgive if this is super simple- I've
I am new to both openGL and android development so please forgive me if
Please forgive my programming knowledge. I know this is a simple thing, but I

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.