Results 1 to 7 of 7

Thread: environment-ref unrecognized on jee:jndi-look-up tag

  1. #1

    Default environment-ref unrecognized on jee:jndi-look-up tag

    Hello
    I am trying to look up a jndi resource (a jms connection factory) using the jee:jndi-look-up tags. Here is how it looks like

    <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer">
    <property name="location">
    <value>classpath:jndi.properties</value>
    </property>
    </bean>


    <!-- define all jndi properties -->
    <utilroperties id="jndiProps" location="classpath:jndi.properties"/>

    <!-- initialize the jms boiler plate code here -->
    <jee:jndi-lookup id="internalJmsQueueConnectionFactory1" jndi-name="${qmanager.1.name}"
    environment-ref="jndiProps" lookup-on-startup="true"/>.

    The weird thing is that at the point of loading the application context , I get an error sying "Attribute 'environment-ref' is not allowed to appear in element 'jee:jndi-lookup'. ".

    I am really surprised that this is happening. I am using spring-2.0.5 and the corresponding versions.

    I saw the on spring2.0.3 release notes that environment-ref is supported on all jee:* tags. Can some one help me figure this out.
    thanks
    -Satish

  2. #2
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    Strange. I have no 2.0.5 version at hand, but the xsd of 2.0.6 has the environment-ref entry.

    I suggest checking your local xsd (located in org/springframework/ejb/config package).

    Regards,
    Andreas

  3. #3

    Default

    Thanks Andreas for the response.

    I checked the XSD for environment-ref attribute and it is present in the XSD distributed in 2.0.5 version. So not quite sure what is happening there. I wonder if any one else has noticed this.

    I got this to work without using the environment-ref tag though. I think spring puts everything in <utilroperties ...> into context attributes for JNDI look ups.

    I am not sure if I should log a JIRA for this one.

    thanks

    -Satish

  4. #4
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    Can you verify that the schema declaration is like the one stated in the reference?
    Perhaps you are referring to an older xsd.

  5. #5

    Default

    No.
    My declaration is correct.

    <beans
    xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:lang="http://www.springframework.org/schema/lang"
    xmlns:jee="http://www.springframework.org/schema/jee"
    xmlns:util="http://www.springframework.org/schema/util"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schem...ring-beans.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schem...spring-aop.xsd
    http://www.springframework.org/schema/lang http://www.springframework.org/schem...pring-lang.xsd
    http://www.springframework.org/schema/jee http://www.springframework.org/schem...ng-jee-2.0.xsd
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">


    thx
    -Satish

  6. #6
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    Very strange, indeed. Can you try this also with Spring 2.0.6? And can you post the stacktrace (using [ code] [ /code] tags around it) please?

  7. #7

    Default

    Quote Originally Posted by Andreas Senft View Post
    Very strange, indeed. Can you try this also with Spring 2.0.6? And can you post the stacktrace (using [ code] [ /code] tags around it) please?

    My mistake (rather I should blame maven for that). When I ran my unit tests with -X option, I realized that maven was putting spring2.0.jar on classpath for my tests (the actual app uses 2.0.5). Once I fixed that issue , it worked ok.

    Apologies for wasting your time .

    -Satish

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •