Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: The prefix "base" for attribute "base:package" associated with an element type "context:component-scan" is not bound.

  1. #1
    Member
    Join Date
    Apr 2014
    Posts
    31
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default The prefix "base" for attribute "base:package" associated with an element type "context:component-scan" is not bound.

    mvc-dispatcher-servlet.jpg

    I have read that this error could be in reason of Eclipse bug but I am not able to run my small application and it is the only error I can see. Is there anything wrong with:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:mvc="http://www.springframework.org/schema/mvc" 
    	xmlns:context="http://www.springframework.org/schema/context"
    	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.xsd
            http://www.springframework.org/schema/mvc
            http://www.springframework.org/schema/mvc/spring-mvc.xsd
            http://www.springframework.org/schema/context
            http://www.springframework.org/schema/context/spring-context.xsd">
    	<context:component-scan base:package="tutorial.mvc" />
    	<mvc:annotation-driven />
     
    	<bean id="jspViewResolver"
    		class="org.springframework.web.servlet.view.InternalResourceViewResolver">
     
    		<property name="prefix" value="/WEB-INF/jsp/" />
    		<property name="suffix" value=".jsp" />
    	</bean>
     
    </beans>


  2. #2
    Junior Member
    Join Date
    Apr 2014
    Posts
    15
    Thanks
    4
    Thanked 2 Times in 2 Posts

    Default Re: The prefix "base" for attribute "base:package" associated with an element type "context:component-scan" is not bound.

    maybe it should be this way?

    <context:component-scan base-package="test.package" />

    watch for the dash instead of colon in base-package

  3. The Following User Says Thank You to Zavael For This Useful Post:

    DemeCarv (July 17th, 2014)

  4. #3
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: The prefix "base" for attribute "base:package" associated with an element type "context:component-scan" is not bound.

    Thread moved.

  5. #4
    Member
    Join Date
    Apr 2014
    Posts
    31
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default Re: The prefix "base" for attribute "base:package" associated with an element type "context:component-scan" is not bound.

    GregBrannon, what does "Thread moved" mean? Did I post in wrong session?

  6. #5
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: The prefix "base" for attribute "base:package" associated with an element type "context:component-scan" is not bound.

    In a word, Yes.

    Don't despair. The forum is configured to dump all requests for help initiated with the "Ask a Question" button in a default location that is not always appropriate, and it's not clear to the person posting the request that this is happening.

Similar Threads

  1. Replies: 2
    Last Post: May 22nd, 2014, 01:17 PM
  2. Understanding layers of system logic. Clarity for what "SDK" & "JDK" mean
    By MilkWetGhost in forum Java Theory & Questions
    Replies: 1
    Last Post: October 3rd, 2013, 12:25 PM
  3. Why is there no "package-private interfaces" and "abstract static"?
    By Cornix in forum Java Theory & Questions
    Replies: 12
    Last Post: September 14th, 2013, 11:20 AM
  4. Replies: 2
    Last Post: June 22nd, 2013, 10:30 AM
  5. Replies: 7
    Last Post: August 13th, 2011, 01:22 AM

Tags for this Thread