Home > other >  Use spark2 - submit submit spark job run normally, using oozie start times wrong, big help
Use spark2 - submit submit spark job run normally, using oozie start times wrong, big help

Time:10-08

Directly on the code
 
Datas. ForeachPartition (new ForeachPartitionFunction () {
private static final long serialVersionUID=1L;
@ SuppressWarnings (" resource ")
@ Override
Public void call (Iterator T) throws the Exception {
ApplicationContext context=new ClassPathXmlApplicationContext (" conf/spring - config. XML ");
OracleDataService OracleDataService=context. GetBean (OracleDataService. Class);

List Records=new ArrayList (a);
While (Todd Harper asNext ()) {
The Row Row=t.n ext ();
TgPoweroffTimePoint poweroffRecord=new TgPoweroffTimePoint ();
PoweroffRecord. SetCollMeterId (row. GetLong (0));
PoweroffRecord. SetTimePoint (row. Get string (1));
PoweroffRecord. SetDataDate (row. Get string (2));
PoweroffRecord. SetCurveDensity (row. Get string (3));
Records. The add (poweroffRecord);

If (records. The size ()==1000) {
List Temp=new ArrayList (a);
Temp. AddAll (records);
OracleDataService. SuppleAnalysis (temp);
Records. The clear ();
}
}
if(! CollectionUtils. IsEmpty (records)) {
OracleDataService. SuppleAnalysis (records);
}
}
});

The code using the spring + mybatis way operation database, use the spark2 - submit way is able to run normally, but using oozie start task creation sqlSessionFactory times wrong:
 
Under Caused by: org. Springframework. Beans. Factory. BeanCreationException: Error creating bean with the name 'sqlSessionFactory defined in the class path resource/conf/spring - config. XML: Invocation of the init method failed; Nested exception is org. Springframework. Core. NestedIOException: Failed to parse mapping resource: 'URL [jar: file:/hadoopdata/yarn/nm/usercache/xlsoft/appcache application_1585627237317_0051/container_1585627237317_0051_01_000001/__app__ jar!/mappers/OracleDataMapper XML]'. Nested exception is org. Apache. Ibatis. Builder. BuilderException: Error parsing XML Mapper. Cause: Java. Lang. IllegalArgumentException: Result Maps collection already contains the value for the com. Xinlian. CollStat. Dao. OracleDataMapper. SysGatherStatMap
The at org. Springframework. Beans. Factory. Support. AbstractAutowireCapableBeanFactory. InitializeBean (AbstractAutowireCapableBeanFactory. Java: 1628)
The at org. Springframework. Beans. Factory. Support. AbstractAutowireCapableBeanFactory. DoCreateBean (AbstractAutowireCapableBeanFactory. Java: 555)
The at org. Springframework. Beans. Factory. Support. AbstractAutowireCapableBeanFactory. CreateBean (AbstractAutowireCapableBeanFactory. Java: 483)
The at org. Springframework. Beans. Factory. Support. AbstractBeanFactory $1. GetObject (AbstractBeanFactory. Java: 306)
The at org. Springframework. Beans. Factory. Support. DefaultSingletonBeanRegistry. GetSingleton (DefaultSingletonBeanRegistry. Java: 230)
The at org. Springframework. Beans. Factory. Support. AbstractBeanFactory. DoGetBean (AbstractBeanFactory. Java: 302)
The at org. Springframework. Beans. Factory. Support. AbstractBeanFactory. GetBean (AbstractBeanFactory. Java: 197)
The at org. Springframework. Beans. Factory. Support. BeanDefinitionValueResolver. ResolveReference (BeanDefinitionValueResolver. Java: 351)
. 38 more
Under Caused by: org. Springframework. Core. NestedIOException: Failed to parse mapping resource: 'URL [jar: file:/hadoopdata/yarn/nm/usercache/xlsoft/appcache application_1585627237317_0051/container_1585627237317_0051_01_000001/__app__ jar!/mappers/OracleDataMapper XML]'. Nested exception is org. Apache. Ibatis. Builder. BuilderException: Error parsing XML Mapper. Cause: Java. Lang. IllegalArgumentException: Result Maps collection already contains the value for the com. Xinlian. CollStat. Dao. OracleDataMapper. SysGatherStatMap
The at org. Mybatis. Spring. SqlSessionFactoryBean. BuildSqlSessionFactory (SqlSessionFactoryBean. Java: 466)
The at org. Mybatis. Spring. SqlSessionFactoryBean. AfterPropertiesSet (SqlSessionFactoryBean. Java: 340)
The at org. Springframework. Beans. Factory. Support. AbstractAutowireCapableBeanFactory. InvokeInitMethods (AbstractAutowireCapableBeanFactory. Java: 1687)
The at org. Springframework. Beans. Factory. Support. AbstractAutowireCapableBeanFactory. InitializeBean (AbstractAutowireCapableBeanFactory. Java: 1624)
. 45 more
Under Caused by: org. Apache. Ibatis. Builder. BuilderException: Error parsing XML Mapper. Cause: Java. Lang. IllegalArgumentException: Result Maps collection already contains the value for the com. Xinlian. CollStat. Dao. OracleDataMapper. SysGatherStatMap
The at org. Apache. Ibatis. Builder. XML. XMLMapperBuilder. ConfigurationElement (XMLMapperBuilder. Java: 120)
The at org. Apache. Ibatis. Builder. XML. XMLMapperBuilder. Parse (XMLMapperBuilder. Java: 92)
The at org. Mybatis. Spring. SqlSessionFactoryBean. BuildSqlSessionFactory (SqlSessionFactoryBean. Java: 464)
. 48 more
Under Caused by: Java. Lang. IllegalArgumentException: Result Maps collection already contains the value for the com. Xinlian. CollStat. Dao. OracleDataMapper. SysGatherStatMap
At org. Apache. Ibatis. Session. The Configuration $StrictMap. Put (816) Configuration. Java:
nullnullnullnullnullnullnullnullnullnullnull
  • Related