cancel
Showing results for 
Search instead for 
Did you mean: 

bean definition getting awry

hello_wrold
Champ in-the-making
Champ in-the-making
Hello there,

looks like I stumbled upon another issue  that's troubling me.

For my little project I followed the steps in Jeff Potts fine tutorial
using the Eclipse and the Alfresco Maven-SDK.  To connect my custom
content model with my localized labels in fooModel.properties, I
created a foo-content-share-context.xml with a bean referring to my model:



<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>
    <bean id="${project.artifactId}_resources" class="org.springframework.extensions.surf.util.ResourceBundleBootstrapComponent">
        <property name="resourceBundles">
            <list>
                <value>alfresco.module.${project.artifactId}.messages.fooModel</value>
            </list>
        </property>
    </bean>
</beans>


Except for the 'foo' this is just copy/pasted from the tutorial. "${project.artifactId}" gets
replaced with the artifactId by maven during the build process.

The problem now is, that Eclipse puts a red flag on the bean definition:
<cite>
  Multiple annotations found at this line:
   - Start tag of element <bean>
   - Attribute value "${project.artifactId}_resources" of type ID must be a name.
</cite>
   
This behaviour seems to new – it worked like this before and I didn't change
the code or other relevant parts of the code so this one comes out of the blue for me.

I don't know what kind of magic I need to make that one work again. (And BTW: am I
the only one who fell into this pit?)

Best regards,
  daniel
4 REPLIES 4

angelborroy
Community Manager Community Manager
Community Manager
Did you remove original <CODE>content-share-context.xml</CODE> file? If there are both, Spring bean name will conflict.
Hyland Developer Evangelist

I just checked: the original
content-share-context.xml
is removed already; there are no other files in my web-extension directory.

Thanks anyway,
  -daniel

angelborroy
Community Manager Community Manager
Community Manager
Have you tried to change <CODE>bean id="${project.artifactId}_resources"</CODE> by another name (ex. "${project.artifactId}_foo_resources")?

This will not show the problem, but may let you continue with the project.
Hyland Developer Evangelist

What I did was to replace the <cite>${project.artifactId}</cite> with the actual artifactId by hand just to get a working enviroment. However, hardcoding isn't exactly the way it ought to be and sooner or later I will run into other surprises.

… and I have no idea how I managed to run into this in the first place. My Maven-foo is kind of limited and I didn't touch it's innards.