Announcement Announcement Module
Collapse
No announcement yet.
Using jee: namespace in spring config file Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using jee: namespace in spring config file

    Hello,

    i am integrating the Activiti BPMN engine which uses sping for its configuration and bean instantiation. Activiti has the possibility to inject an datasource which i want to lookup via JNDI from the glassfish application server.

    I use the following spring cfg file:

    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">
    
       <jee:jndi-lookup jndi-name="jdbc/MysqlErp" id="dataSource" />
    
       <bean id="processEngineConfiguration"
          class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
          <property name="dataSource" ref="dataSource" />
          <property name="databaseSchemaUpdate" value="true" />
          <property name="databaseType" value="mysql" />
          <property name="jobExecutorActivate" value="false" />
       </bean>
    </beans>
    Unfortunately i get the following exception when i want to initialize the Activiti engine:

    Code:
    INFO: initializing process engine for resource file:/data/Projects/JavaLibs/glassfish/glassfish3/glassfish/domains/domain1/eclipseApps/erp.web/WEB-INF/classes/activiti.cfg.xml
    INFO: Loading XML bean definitions from resource loaded through InputStream
    
    SCHWERWIEGEND: Exception while initializing process engine :Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/jee]
    Offending resource: resource loaded through InputStream
    org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/jee]
    Offending resource: resource loaded through InputStream
       at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
       at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
       at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
       at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:284)
       at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1332)
       at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1325)
       at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
       at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)
       at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
       at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
       at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
       at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
       at org.activiti.engine.impl.cfg.BeansConfigurationHelper.parseProcessEngineConfiguration(BeansConfigurationHelper.java:35)
       at org.activiti.engine.impl.cfg.BeansConfigurationHelper.parseProcessEngineConfigurationFromInputStream(BeansConfigurationHelper.java:43)
       at org.activiti.engine.ProcessEngineConfiguration.createProcessEngineConfigurationFromInputStream(ProcessEngineConfiguration.java:163)
       at org.activiti.engine.ProcessEngineConfiguration.createProcessEngineConfigurationFromInputStream(ProcessEngineConfiguration.java:159)
       at org.activiti.engine.ProcessEngines.buildProcessEngine(ProcessEngines.java:176)
       at org.activiti.engine.ProcessEngines.initProcessEnginFromResource(ProcessEngines.java:150)
       at org.activiti.engine.ProcessEngines.init(ProcessEngines.java:88)
       at com.examples.ejbeans.ActivitiStarter.initEngine(ActivitiStarter.java:30)
    From the Activiti POM http://maven.alfresco.com/nexus/cont...engine-5.6.pom i see that it has a dependency to:

    Code:
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-beans</artifactId>
    </dependency>
    is there anything else i need for spring to be able to resolve the namespace jee: ?
    </dependency>

  • #2
    Just in case somebody else finds in here - the jee stuff lives in spring-context, so you need

    Code:
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    </dependency>

    Comment

    Working...
    X