Results 1 to 6 of 6

Thread: jndi schema not avilable

  1. #1

    Default jndi schema not avilable

    hi;
    it seems that the jndi xsd is not available at http://www.springframework.org/schem...pring-jndi.xsd (at the time of this writing)
    this seem to affect my application that cannot be started now (see stack trace below) do i have alternatives? i would not want my application to be dependent on this xsd extrernally for a correct startup.
    thanks in advance.

    stack trace:
    Code:
    03/06/2006 10:40:52 org.apache.catalina.core.ApplicationContext log
    INFO: Loading Spring root WebApplicationContext
    2006-06-03 10:40:52 [main] WARN  factory.xml.XmlBeanDefinitionReader  - Ignored
    XML validation warning
    org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema documen
    t 'http://www.springframework.org/schema/jndi/spring-jndi.xsd', because 1) could
     not find the document; 2) the document could not be read; 3) the root element o
    f the document is not <xsd:schema>.
            at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAX
    ParseException(ErrorHandlerWrapper.java:236)
            at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.warning(E
    rrorHandlerWrapper.java:137)
            at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
    XMLErrorReporter.java:378)
            at c...
    2006-06-03 10:40:52 [main] ERROR web.context.ContextLoader  - Context initializa
    tion failed
    org.springframework.beans.factory.BeanDefinitionStoreException: Line 152 in XML
    document from ServletContext resource [/WEB-INF/spring-config.xml] is invalid; n
    ested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The ma
    tching wildcard is strict, but no declaration can be found for element 'jndi:loo
    kup'.
    Caused by:
    org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is
    strict, but no declaration can be found for element 'jndi:lookup'.
            at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAX
    ParseException(ErrorHandlerWrapper.java:236)
            at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Err
    orHandlerWrapper.java:172)
            at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
    XMLErrorReporter.java:382)
    ...
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
            at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    03/06/2006 10:40:52 org.apache.catalina.core.StandardContext start
    SEVERE: Error listenerStart
    03/06/2006 10:40:52 org.apache.catalina.core.StandardContext start
    SEVERE: Context [] startup failed due to previous errors
    03/06/2006 10:40:52 org.apache.catalina.core.ApplicationContext log
    INFO: Closing Spring root WebApplicationContext
    03/06/2006 10:40:53 org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8080
    03/06/2006 10:40:53 org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    03/06/2006 10:40:53 org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/47  config=null
    03/06/2006 10:40:53 org.apache.catalina.storeconfig.StoreLoader load
    INFO: Find registry server-registry.xml at classpath resource
    03/06/2006 10:40:53 org.apache.catalina.startup.Catalina start
    INFO: Server startup in 4985 ms
    __________
    Guy Katz
    www.xwave.co.il

  2. #2
    Join Date
    Aug 2004
    Posts
    1,104

    Default

    As of 2.0 M5 jndi lookup has been moved to the new jee schema -

    http://www.springframework.org/schem...spring-jee.xsd

    Here are sample of the new tags (from the jeeNameSpaceHandlerTests.xml):
    Code:
    <?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:jee="http://www.springframework.org/schema/jee"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
           http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd">
    
    <!-- JNDI Lookup Tests -->
    <jee:jndi-lookup id="simple" jndi-name="jdbc/MyDataSource"/>
    
    <jee:jndi-lookup id="complex"
                     jndi-name="jdbc/MyDataSource"
                     cache="true"
                     resource-ref="true"
                     lookup-on-startup="true"
                     expected-type="com.myapp.DefaultFoo"
                     proxy-interface="com.myapp.Foo"/>
    
    ...
    Thomas Risberg
    SpringSource by Pivotal
    http://www.springsource.org

  3. #3
    Join Date
    May 2006
    Posts
    12

    Default jee:jndi-lookup issues

    Hi,
    I am using spring rc1 and am getting the below exception when I change jndi referencing from
    <!--

    <bean id="dataSource"
    class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiName">
    <value>java:jdbc/OracleDS</value>
    </property>
    </bean>
    -->
    to
    <jee:jndi-lookup id="dataSource" jndi-name="java:jdbc/OracleDS"/>

    My xml name space is
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:jee="http://www.springframework.org/schema/jee"
    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"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...ring-beans.xsd
    http://www.springframework.org/schema/jee http://www.springframework.org/schem...spring-jee.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schem...spring-aop.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">

    My deploy env jboss 4.0.4
    Caused by: org.springframework.beans.factory.access.Bootstrap Exception: Unable to initialize group definition. Group resource name [classpath*:beanRefFactory.xml], factory key [com.xxx.springbeans]; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'com.xxx.springbeans' defined in URL [jar:file:/root/jboss/jboss-4.0.4.GA/server/default/tmp/deploy/tmp14356raEar-0.0.1.ear-contents/uaServices-1.0.0.jar!/beanRefFactory.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlAp plicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanDefinitionSt oreException: Line 22 in XML document from class path resource [uaServicesspringhibernate.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jee:jndi-lookup'.
    at org.springframework.beans.factory.access.Singleton BeanFactoryLocator.useBeanFactory(SingletonBeanFac toryLocator.java:383)
    at com.xxx.jsf.beans.PortletPrefsBean.<init>(PortletP refsBean.java:49)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Construc tor.java:494)
    at java.lang.Class.newInstance0(Class.java:350)
    at java.lang.Class.newInstance(Class.java:303)
    at java.beans.Beans.instantiate(Beans.java:204)
    ... 56 more
    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'com.xxx.springbeans' defined in URL [jar:file:/root/jboss/jboss-4.0.4.GA/server/default/tmp/deploy/tmp14356raEar-0.0.1.ear-contents/uaServices-1.0.0.jar!/beanRefFactory.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlAp plicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanDefinitionSt oreException: Line 22 in XML document from class path resource [uaServicesspringhibernate.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jee:jndi-lookup'.
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:399)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:257)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:168)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:254)
    at org.springframework.beans.factory.access.Singleton BeanFactoryLocator.initializeDefinition(SingletonB eanFactoryLocator.java:496)
    at org.springframework.beans.factory.access.Singleton BeanFactoryLocator.useBeanFactory(SingletonBeanFac toryLocator.java:380)
    ... 64 more
    Caused by: org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlAp plicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanDefinitionSt oreException: Line 22 in XML document from class path resource [uaServicesspringhibernate.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jee:jndi-lookup'.
    at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:97)
    at org.springframework.beans.factory.support.SimpleIn stantiationStrategy.instantiate(SimpleInstantiatio nStrategy.java:78)
    at org.springframework.beans.factory.support.Construc torResolver.autowireConstructor(ConstructorResolve r.java:156)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.autowireConstructor(Abs tractAutowireCapableBeanFactory.java:545)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:352)
    ... 69 more
    Caused by: org.springframework.beans.factory.BeanDefinitionSt oreException: Line 22 in XML document from class path resource [uaServicesspringhibernate.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jee:jndi-lookup'.
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:393)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:340)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:315)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:126)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:142)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:168)
    at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:113)
    at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:79)
    at org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefreshableApplicationContext.java:89)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:278)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:92)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:77)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Construc tor.java:494)
    at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:82)
    ... 73 more
    Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jee:jndi-lookup'.
    at org.apache.xerces.util.ErrorHandlerWrapper.createS AXParseException(Unknown Source)
    at org.apache.xerces.util.ErrorHandlerWrapper.error(U nknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportErro r(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportErro r(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIEr rorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.repor tSchemaError(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.handl eStartElement(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.empty Element(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.sc anStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(U nknown Source)
    at org.springframework.beans.factory.xml.DefaultDocum entLoader.loadDocument(DefaultDocumentLoader.java: 68)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:385)
    ... 89 more

    Can anyone provide a solution
    thanks
    Krishh

  4. #4
    Join Date
    Aug 2004
    Location
    The Netherlands
    Posts
    160

    Default Is this problem ever resolved?

    Hai did anyone ever resolve this issue? I am getting the same problem with junit tests run in eclipse and with maven2. What I also find strange is that eclispe code completion can only find the elements/atributes found in the jee xsd, so the impored xsd elements are not used.
    Jettro Coenradie
    http://www.gridshore.nl

  5. #5

    Default

    my original problem was solved when upgrading to the final 2.0 form one of the RCs and adapting the new namespaces
    __________
    Guy Katz
    www.xwave.co.il

  6. #6

    Default The schema file name has been changed

    The schema file name has been changed to :

    http://www.springframework.org/schem...ng-jee-2.0.xsd

    See the URL http://www.springframework.org/schema/jee

    Thanks,
    Sathishknair

Posting Permissions

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