ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zhengqingzheng <zhengqingzh...@huawei.com>
Subject 答复: ignite Spring application context resource is not injected problem
Date Wed, 20 Jul 2016 00:53:33 GMT
Hi Val,
I tried both. And non of them work for me:
1. first I start from ignite.sh script, cache created okay. However, when I call from the
client side (using Ignition.start()) to put data into cache, it gives me Spring application
context resource is not injected error.
2. I restart the server without any cache configuration, and start to create the cache from
the client side. And the same error occurred again.
Here is my default-config.xml :
---------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>

<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:util="http://www.springframework.org/schema/util"
       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/util
                           http://www.springframework.org/schema/util/spring-util.xsd">
    <!--
        Alter configuration below as needed.
    -->
	<!-- Sample data source -->
	<bean id= "dataSource" class="oracle.jdbc.pool.OracleDataSource">
	 <property name="URL" value="jdbc:oracle:thin:@xxx.xxx.xx.xx:xxx:xxx"/>
	 <property name="user" value="xxxxx"/>
	 <property name="password" value="xxxxx"/>
	</bean>
	   
	<bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
	    <!-- Enable client mdoe. -->
		<property name="clientMode" value="true"/>
		<property name="peerClassLoadingEnabled" value="false"/>
		
 		 <property name="cacheConfiguration">
		  <list>
			<!-- define uniquefields cache -->
			<bean class="org.apache.ignite.configuration.CacheConfiguration">
			
				<property name="readThrough" value="false"/>
				<property name="writeThrough" value="true"/>
				<property name="cacheMode" value="PARTITIONED"/>
				<property name="atomicityMode" value="ATOMIC"/>
				<property name="swapEnabled" value="false"/>
				<property name="name" value="UniquefieldsCache"/>
				<property name="cacheStoreFactory">
				
					<bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory">
						<property name="dataSourceBean" value="dataSource"/>
						<property name="dialect">
							<bean class="org.apache.ignite.cache.store.jdbc.dialect.OracleDialect"/>
						</property>
	
						<property name="types"> 
							<list> 
								<bean class="org.apache.ignite.cache.store.jdbc.JdbcType">
									<property name="databaseSchema" value="DEQUATIONS"/>
									<property name="databaseTable" value="UNIQUEFIELDS"/>
									<property name="keyType" value="com.huawei.soa.ignite.model.UniquefieldsKey"/>
									<property name="valueType" value="com.huawei.soa.ignite.model.Uniquefields"/>
									<property name="keyFields">
										<list>
											<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
												<property name="databaseFieldType">
													<util:constant static-field="java.sql.Types.VARCHAR"/>
												</property>
												<property name="databaseFieldName" value="OBJID"/>
												<property name="javaFieldType" value="java.lang.String"/>
												<property name="javaFieldName" value="objid"/>
											</bean>
											<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
												<property name="databaseFieldType">
													<util:constant static-field="java.sql.Types.VARCHAR"/>
												</property>
												<property name="databaseFieldName" value="STRINGVALUE"/>
												<property name="javaFieldType" value="java.lang.String"/>
												<property name="javaFieldName" value="stringvalue"/>
											</bean>
											<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
												<property name="databaseFieldType">
													<util:constant static-field="java.sql.Types.NUMERIC"/>
												</property>
												<property name="databaseFieldName" value="NUMVALUE"/>
												<property name="javaFieldType" value="java.math.BigDecimal"/>
												<property name="javaFieldName" value="numvalue"/>
											</bean>
										</list>
									</property>
									<property name="valueFields">
										<list>
											<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
												<property name="databaseFieldType">
													<util:constant static-field="java.sql.Types.VARCHAR"/>
												</property>
												<property name="databaseFieldName" value="ORGID"/>
												<property name="javaFieldType" value="java.lang.String"/>
												<property name="javaFieldName" value="orgid"/>
											</bean>
											<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
												<property name="databaseFieldType">
													<util:constant static-field="java.sql.Types.VARCHAR"/>
												</property>
												<property name="databaseFieldName" value="OBJID"/>
												<property name="javaFieldType" value="java.lang.String"/>
												<property name="javaFieldName" value="objid"/>
											</bean>
											<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
												<property name="databaseFieldType">
													<util:constant static-field="java.sql.Types.SMALLINT"/>
												</property>
												<property name="databaseFieldName" value="FIELDNUM"/>
												<property name="javaFieldType" value="java.lang.Short"/>
												<property name="javaFieldName" value="fieldnum"/>
											</bean>
											<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
												<property name="databaseFieldType">
													<util:constant static-field="java.sql.Types.VARCHAR"/>
												</property>
												<property name="databaseFieldName" value="GUID"/>
												<property name="javaFieldType" value="java.lang.String"/>
												<property name="javaFieldName" value="guid"/>
											</bean>
											<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
												<property name="databaseFieldType">
													<util:constant static-field="java.sql.Types.VARCHAR"/>
												</property>
												<property name="databaseFieldName" value="STRINGVALUE"/>
												<property name="javaFieldType" value="java.lang.String"/>
												<property name="javaFieldName" value="stringvalue"/>
											</bean>
											<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
												<property name="databaseFieldType">
													<util:constant static-field="java.sql.Types.NUMERIC"/>
												</property>
												<property name="databaseFieldName" value="NUMVALUE"/>
												<property name="javaFieldType" value="java.math.BigDecimal"/>
												<property name="javaFieldName" value="numvalue"/>
											</bean>
											<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
												<property name="databaseFieldType">
													<util:constant static-field="java.sql.Types.DATE"/>
												</property>
												<property name="databaseFieldName" value="DATEVALUE"/>
												<property name="javaFieldType" value="java.sql.Timestamp"/>
												<property name="javaFieldName" value="datevalue"/>
											</bean>
										</list>
									</property>
								</bean>
								
								
							</list>
						</property>
					</bean>
				</property>
				
				<property name="queryEntities">
					<list>
						<bean class="org.apache.ignite.cache.QueryEntity">
							<property name="keyType" value="com.huawei.soa.ignite.model.UniquefieldsKey"/>
							<property name="valueType" value="com.huawei.soa.ignite.model.Uniquefields"/>
							<property name="fields">
								<util:map map-class="java.util.LinkedHashMap">
									<entry key="orgid" value="java.lang.String"/>
									<entry key="objid" value="java.lang.String"/>
									<entry key="fieldnum" value="java.lang.Short"/>
									<entry key="guid" value="java.lang.String"/>
									<entry key="stringvalue" value="java.lang.String"/>
									<entry key="numvalue" value="java.math.BigDecimal"/>
									<entry key="datevalue" value="java.sql.Timestamp"/>
								</util:map>
							</property>
						</bean>
					
					</list>
				</property>
			</bean>
		
		  </list>
		 </property>
	
		<property name="discoverySpi">
			<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
			  <property name="ipFinder">
				<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
				  <property name="addresses">
					<list>
						<value>xxx.xxx.xxx.xxx:47500..47509</value>
	
					</list>
				  </property>
				</bean>
			  </property>
			</bean>
		</property> 
	</bean>
</beans>

Best regards,
Kevin

----------------------------------------------------------
-----邮件原件-----
发件人: vkulichenko [mailto:valentin.kulichenko@gmail.com] 
发送时间: 2016年7月20日 7:36
收件人: user@ignite.apache.org
主题: Re: ignite Spring application context resource is not injected problem

Hi Kevin,

Can you please provide the whole configuration file and also show how you start the node?
Is it a standalone node started with ignite.sh script or an embedded node started in code
using Ignition.start()?

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/ignite-Spring-application-context-resource-is-not-injected-problem-tp6377p6397.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Mime
View raw message