问:
Sqoop import into Hive - ERROR ("javax.management.MBeanTrustPermission" "register")
i'm facing this error when running a sqoop import command to hive and HDFS, the HDFS job runs without problems, but i can't make the same import to hive due to theese java errors.

log:

```[sga-dl@localhost ~]$ sqoop import --connect jdbc:mysql://localhost:3306/v3_abrasivos --username hiveusr --password DATPASS --table History_Demand --m 1 --target-dir /raw_imports/History_Demand --hive-import --create-hive-table --hive-table sqoop_v3_abrasivos.History_Demand
...
20/02/04 09:50:01 INFO mapreduce.ImportJobBase: Transferred 794.1428 MB in 58.9304 seconds (13.476
20/02/04 09:50:01 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `History_Demand` AS t LIMIT 1
20/02/04 09:50:01 WARN hive.TableDefWriter: Column Dia had to be cast to a less precise type in Hive
20/02/04 09:50:01 INFO hive.HiveImport: Loading uploaded data into Hive
20/02/04 09:50:01 INFO conf.HiveConf: Found configuration file file:/opt/hive/conf/hive-site.xml
2020-02-04 09:50:02,957 main ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:585)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(DefaultMBeanServerInterceptor.java:1848)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:322)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
    at org.apache.logging.log4j.core.jmx.Server.register(Server.java:380)
    at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:165)
    at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:138)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:507)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:249)
    at org.apache.logging.log4j.core.async.AsyncLoggerContext.start(AsyncLoggerContext.java:86)
    at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:239)
    at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:157)
    at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:130)
    at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:100)
    at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:187)
    at org.apache.hadoop.hive.common.LogUtils.initHiveLog4jDefault(LogUtils.java:154)
    at org.apache.hadoop.hive.common.LogUtils.initHiveLog4jCommon(LogUtils.java:90)
    at org.apache.hadoop.hive.common.LogUtils.initHiveLog4jCommon(LogUtils.java:82)
    at org.apache.hadoop.hive.common.LogUtils.initHiveLog4j(LogUtils.java:65)
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:702)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.sqoop.hive.HiveImport.executeScript(HiveImport.java:331)
    at org.apache.sqoop.hive.HiveImport.importTable(HiveImport.java:241)
    at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:537)
    at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:628)
    at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243)
    at org.apache.sqoop.Sqoop.main(Sqoop.java:252)

Logging initialized using configuration in jar:file:/usr/local/apache-hive-2.3.6-bin/lib/hive-common-2.3.6.jar!/hive-log4j2.properties Async: true
20/02/04 09:50:03 INFO SessionState:
Logging initialized using configuration in jar:file:/usr/local/apache-hive-2.3.6-bin/lib/hive-common-2.3.6.jar!/hive-log4j2.properties Async: true
20/02/04 09:50:03 INFO session.SessionState: Created HDFS directory: /tmp/hive/sga-dl/9133a12b-b9d9-4d17-ad47-3dc6ca872ab6
20/02/04 09:50:03 INFO session.SessionState: Created local directory: /tmp/sga-dl/9133a12b-b9d9-4d17-ad47-3dc6ca872ab6
20/02/04 09:50:03 INFO session.SessionState: Created HDFS directory: /tmp/hive/sga-dl/9133a12b-b9d9-4d17-ad47-3dc6ca872ab6/_tmp_space.db
20/02/04 09:50:03 INFO conf.HiveConf: Using the default value passed in for log id: 9133a12b-b9d9-4d17-ad47-3dc6ca872ab6
20/02/04 09:50:03 INFO session.SessionState: Updating thread name to 9133a12b-b9d9-4d17-ad47-3dc6ca872ab6 main
20/02/04 09:50:03 INFO conf.HiveConf: Using the default value passed in for log id: 9133a12b-b9d9-4d17-ad47-3dc6ca872ab6
20/02/04 09:50:03 INFO ql.Driver: Compiling command(queryId=sga-dl_20200204095003_9b2a8fbf-d798-4146-b57c-ffcb5920891b): CREATE TABLE `sqoop_v3_abrasivos.History_Demand` ( `idHistory_Demand` BIGINT, `Entidade_SalesOrg` STRING, `Cod_Material` BIGINT, `Material` STRING, `Plan_Group` STRING, `Linha_Produto` STRING, `MTS_MTO` STRING, `Cod_Tipo_OV` STRING, `Tipo_OV` STRING, `OV_Numero` BIGINT, `OV_Linha` INT, `Cod_Cliente` STRING, `Cliente` STRING, `Cod_Cliente_Corp` STRING, `Cliente_Corp` STRING, `Pais_Cliente` STRING, `UF_Cliente` STRING, `Estado_Cliente` STRING, `Cidade_Cliente` STRING, `Bairro_Cliente` STRING, `Sigla_Moeda` STRING, `OV_Moeda` STRING, `Cod_Sell_Plant` INT, `Sell_Plant` STRING, `Pais_SalesOrg` STRING, `Dia` STRING, `Periodo` STRING, `UN_Estoque` STRING, `Qtd_UN_Estoque` STRING, `Vendas_LOC` STRING) COMMENT 'Imported by sqoop on 2020/02/04 09:50:01' ROW FORMAT DELIMITED FIELDS TERMINATED BY '\001' LINES TERMINATED BY '\012' STORED AS TEXTFILE
20/02/04 09:50:05 INFO metastore.HiveMetaStore: 0: Opening raw store with implementation class:org.apache.hadoop.hive.metastore.ObjectStore
20/02/04 09:50:05 INFO metastore.ObjectStore: ObjectStore, initialize called
20/02/04 09:50:06 INFO DataNucleus.Persistence: Property hive.metastore.integral.jdo.pushdown unknown - will be ignored
20/02/04 09:50:06 INFO DataNucleus.Persistence: Property datanucleus.cache.level2 unknown - will be ignored
20/02/04 09:50:06 ERROR bonecp.BoneCP: Unable to start/stop JMX
java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:585)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(DefaultMBeanServerInterceptor.java:1848)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:322)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
    at com.jolbox.bonecp.BoneCP.registerUnregisterJMX(BoneCP.java:528)
    at com.jolbox.bonecp.BoneCP.<init>(BoneCP.java:500)
    at com.jolbox.bonecp.BoneCPDataSource.getConnection(BoneCPDataSource.java:120)
    at org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getConnection(ConnectionFactoryImpl.java:483)
    at org.datanucleus.store.rdbms.RDBMSStoreManager.<init>(RDBMSStoreManager.java:297)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.datanucleus.plugin.NonManagedPluginRegistry.createExecutableExtension(NonManagedPluginRegistry.java:606)
    at org.datanucleus.plugin.PluginManager.createExecutableExtension(PluginManager.java:301)
    at org.datanucleus.NucleusContextHelper.createStoreManagerForProperties(NucleusContextHelper.java:133)
    at org.datanucleus.PersistenceNucleusContextImpl.initialise(PersistenceNucleusContextImpl.java:422)
    at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.freezeConfiguration(JDOPersistenceManagerFactory.java:817)
    at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(JDOPersistenceManagerFactory.java:334)
    at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:213)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at javax.jdo.JDOHelper$16.run(JDOHelper.java:1965)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.jdo.JDOHelper.invoke(JDOHelper.java:1960)
    at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1166)
    at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:808)
    at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:701)
    at org.apache.hadoop.hive.metastore.ObjectStore.getPMF(ObjectStore.java:521)
    at org.apache.hadoop.hive.metastore.ObjectStore.getPersistenceManager(ObjectStore.java:550)
    at org.apache.hadoop.hive.metastore.ObjectStore.initializeHelper(ObjectStore.java:405)
    at org.apache.hadoop.hive.metastore.ObjectStore.initialize(ObjectStore.java:342)
    at org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:303)
    at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:76)
    at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
    at org.apache.hadoop.hive.metastore.RawStoreProxy.<init>(RawStoreProxy.java:58)
    at org.apache.hadoop.hive.metastore.RawStoreProxy.getProxy(RawStoreProxy.java:67)
    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.newRawStoreForConf(HiveMetaStore.java:628)
    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMSForConf(HiveMetaStore.java:594)
    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:588)
    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:655)
    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:431)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invokeInternal(RetryingHMSHandler.java:148)
    at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:107)
    at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:79)
    at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:92)
    at org.apache.hadoop.hive.metastore.HiveMetaStore.newRetryingHMSHandler(HiveMetaStore.java:6902)
    at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:164)
    at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.<init>(SessionHiveMetaStoreClient.java:70)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1707)
    at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.<init>(RetryingMetaStoreClient.java:83)
    at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:133)
    at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:104)
    at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:3600)
    at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3652)
    at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3632)
    at org.apache.hadoop.hive.ql.metadata.Hive.getAllFunctions(Hive.java:3894)
    at org.apache.hadoop.hive.ql.metadata.Hive.reloadFunctions(Hive.java:248)
    at org.apache.hadoop.hive.ql.metadata.Hive.registerAllFunctionsOnce(Hive.java:231)
    at org.apache.hadoop.hive.ql.metadata.Hive.<init>(Hive.java:388)
    at org.apache.hadoop.hive.ql.metadata.Hive.create(Hive.java:332)
    at org.apache.hadoop.hive.ql.metadata.Hive.getInternal(Hive.java:312)
    at org.apache.hadoop.hive.ql.metadata.Hive.get(Hive.java:288)
    at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.createHiveDB(BaseSemanticAnalyzer.java:236)
    at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.<init>(BaseSemanticAnalyzer.java:215)
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.<init>(SemanticAnalyzer.java:362)
    at org.apache.hadoop.hive.ql.parse.CalcitePlanner.<init>(CalcitePlanner.java:267)
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzerFactory.get(SemanticAnalyzerFactory.java:318)
    at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:484)
    at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1317)
    at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1457)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1237)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1227)
    at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:233)
    at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:184)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:403)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:336)
    at org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:474)
    at org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:490)
    at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:793)
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:759)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.sqoop.hive.HiveImport.executeScript(HiveImport.java:331)
    at org.apache.sqoop.hive.HiveImport.importTable(HiveImport.java:241)
    at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:537)
    at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:628)
    at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243)
    at org.apache.sqoop.Sqoop.main(Sqoop.java:252)
20/02/04 09:50:06 INFO metastore.ObjectStore: Setting MetaStore object pin classes with hive.metastore.cache.pinobjtypes="Table,StorageDescriptor,SerDeInfo,Partition,Database,Type,FieldSchema,Order"
20/02/04 09:50:08 ERROR bonecp.BoneCP: Unable to start/stop JMX
java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:585)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(DefaultMBeanServerInterceptor.java:1848)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:322)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
    at com.jolbox.bonecp.BoneCP.registerUnregisterJMX(BoneCP.java:528)
    at com.jolbox.bonecp.BoneCP.<init>(BoneCP.java:500)
    at com.jolbox.bonecp.BoneCPDataSource.getConnection(BoneCPDataSource.java:120)
    at org.datanucleus.store.rdbms.ConnectionProviderPriorityList.getConnection(ConnectionProviderPriorityList.java:57)
    at org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getConnection(ConnectionFactoryImpl.java:402)
    at org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getXAResource(ConnectionFactoryImpl.java:361)
    at org.datanucleus.store.connection.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:316)
    at org.datanucleus.store.connection.AbstractConnectionFactory.getConnection(AbstractConnectionFactory.java:84)
    at org.datanucleus.store.AbstractStoreManager.getConnection(AbstractStoreManager.java:347)
    at org.datanucleus.store.AbstractStoreManager.getConnection(AbstractStoreManager.java:310)
    at org.datanucleus.store.rdbms.query.JDOQLQuery.performExecute(JDOQLQuery.java:591)
    at org.datanucleus.store.query.Query.executeQuery(Query.java:1855)
    at org.datanucleus.store.query.Query.executeWithArray(Query.java:1744)
    at org.datanucleus.store.query.Query.execute(Query.java:1726)
    at org.datanucleus.api.jdo.JDOQuery.executeInternal(JDOQuery.java:374)
    at org.datanucleus.api.jdo.JDOQuery.execute(JDOQuery.java:216)
    at org.apache.hadoop.hive.metastore.MetaStoreDirectSql.ensureDbInit(MetaStoreDirectSql.java:181)
    at org.apache.hadoop.hive.metastore.MetaStoreDirectSql.<init>(MetaStoreDirectSql.java:144)
    at org.apache.hadoop.hive.metastore.ObjectStore.initializeHelper(ObjectStore.java:410)
    at org.apache.hadoop.hive.metastore.ObjectStore.initialize(ObjectStore.java:342)
    at org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:303)
    at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:76)
    at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
    at org.apache.hadoop.hive.metastore.RawStoreProxy.<init>(RawStoreProxy.java:58)
    at org.apache.hadoop.hive.metastore.RawStoreProxy.getProxy(RawStoreProxy.java:67)
    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.newRawStoreForConf(HiveMetaStore.java:628)
    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMSForConf(HiveMetaStore.java:594)
    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:588)
    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:655)
    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:431)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invokeInternal(RetryingHMSHandler.java:148)
    at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:107)
    at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:79)
    at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:92)
    at org.apache.hadoop.hive.metastore.HiveMetaStore.newRetryingHMSHandler(HiveMetaStore.java:6902)
    at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:164)
    at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.<init>(SessionHiveMetaStoreClient.java:70)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1707)
    at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.<init>(RetryingMetaStoreClient.java:83)
    at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:133)
    at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:104)
    at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:3600)
    at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3652)
    at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3632)
    at org.apache.hadoop.hive.ql.metadata.Hive.getAllFunctions(Hive.java:3894)
    at org.apache.hadoop.hive.ql.metadata.Hive.reloadFunctions(Hive.java:248)
    at org.apache.hadoop.hive.ql.metadata.Hive.registerAllFunctionsOnce(Hive.java:231)
    at org.apache.hadoop.hive.ql.metadata.Hive.<init>(Hive.java:388)
    at org.apache.hadoop.hive.ql.metadata.Hive.create(Hive.java:332)
    at org.apache.hadoop.hive.ql.metadata.Hive.getInternal(Hive.java:312)
    at org.apache.hadoop.hive.ql.metadata.Hive.get(Hive.java:288)
    at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.createHiveDB(BaseSemanticAnalyzer.java:236)
    at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.<init>(BaseSemanticAnalyzer.java:215)
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.<init>(SemanticAnalyzer.java:362)
    at org.apache.hadoop.hive.ql.parse.CalcitePlanner.<init>(CalcitePlanner.java:267)
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzerFactory.get(SemanticAnalyzerFactory.java:318)
    at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:484)
    at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1317)
    at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1457)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1237)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1227)
    at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:233)
    at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:184)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:403)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:336)
    at org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:474)
    at org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:490)
    at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:793)
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:759)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.sqoop.hive.HiveImport.executeScript(HiveImport.java:331)
    at org.apache.sqoop.hive.HiveImport.importTable(HiveImport.java:241)
    at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:537)
    at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:628)
    at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243)
    at org.apache.sqoop.Sqoop.main(Sqoop.java:252)
20/02/04 09:50:09 INFO metastore.MetaStoreDirectSql: Using direct SQL, underlying DB is MYSQL
20/02/04 09:50:09 INFO metastore.ObjectStore: Initialized ObjectStore
20/02/04 09:50:09 INFO metastore.HiveMetaStore: Added admin role in metastore
20/02/04 09:50:09 INFO metastore.HiveMetaStore: Added public role in metastore
20/02/04 09:50:09 INFO metastore.HiveMetaStore: No user is added in admin role, since config is empty
20/02/04 09:50:09 INFO metastore.HiveMetaStore: 0: get_all_functions
20/02/04 09:50:09 INFO HiveMetaStore.audit: ugi=sga-dl  ip=unknown-ip-addr  cmd=get_all_functions
20/02/04 09:50:09 INFO parse.CalcitePlanner: Starting Semantic Analysis
20/02/04 09:50:09 INFO parse.CalcitePlanner: Creating table sqoop_v3_abrasivos.History_Demand position=13
20/02/04 09:50:09 INFO metastore.HiveMetaStore: 0: get_database: sqoop_v3_abrasivos
20/02/04 09:50:09 INFO HiveMetaStore.audit: ugi=sga-dl  ip=unknown-ip-addr  cmd=get_database: sqoop_v3_abrasivos
20/02/04 09:50:09 WARN metastore.ObjectStore: Failed to get database sqoop_v3_abrasivos, returning NoSuchObjectException
FAILED: SemanticException [Error 10072]: Database does not exist: sqoop_v3_abrasivos
20/02/04 09:50:09 ERROR ql.Driver: FAILED: SemanticException [Error 10072]: Database does not exist: sqoop_v3_abrasivos
org.apache.hadoop.hive.ql.parse.SemanticException: Database does not exist: sqoop_v3_abrasivos
    at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.getDatabase(BaseSemanticAnalyzer.java:1687)
    at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.getDatabase(BaseSemanticAnalyzer.java:1676)
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.addDbAndTabToOutputs(SemanticAnalyzer.java:12171)
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeCreateTable(SemanticAnalyzer.java:12024)
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genResolvedParseTree(SemanticAnalyzer.java:11020)
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:11133)
    at org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:286)
    at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:258)
    at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:512)
    at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1317)
    at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1457)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1237)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1227)
    at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:233)
    at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:184)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:403)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:336)
    at org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:474)
    at org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:490)
    at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:793)
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:759)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.sqoop.hive.HiveImport.executeScript(HiveImport.java:331)
    at org.apache.sqoop.hive.HiveImport.importTable(HiveImport.java:241)
    at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:537)
    at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:628)
    at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243)
    at org.apache.sqoop.Sqoop.main(Sqoop.java:252)

20/02/04 09:50:09 INFO ql.Driver: Completed compiling command(queryId=sga-dl_20200204095003_9b2a8fbf-d798-4146-b57c-ffcb5920891b); Time taken: 6.541 seconds
20/02/04 09:50:09 INFO conf.HiveConf: Using the default value passed in for log id: 9133a12b-b9d9-4d17-ad47-3dc6ca872ab6
20/02/04 09:50:09 INFO session.SessionState: Resetting thread name to  main
20/02/04 09:50:09 INFO conf.HiveConf: Using the default value passed in for log id: 9133a12b-b9d9-4d17-ad47-3dc6ca872ab6
20/02/04 09:50:09 INFO session.SessionState: Deleted directory: /tmp/hive/sga-dl/9133a12b-b9d9-4d17-ad47-3dc6ca872ab6 on fs with scheme hdfs
20/02/04 09:50:09 INFO session.SessionState: Deleted directory: /tmp/sga-dl/9133a12b-b9d9-4d17-ad47-3dc6ca872ab6 on fs with scheme file
20/02/04 09:50:09 INFO metastore.HiveMetaStore: 0: Cleaning up thread local RawStore...
20/02/04 09:50:09 INFO HiveMetaStore.audit: ugi=sga-dl  ip=unknown-ip-addr  cmd=Cleaning up thread local RawStore...
20/02/04 09:50:09 INFO metastore.HiveMetaStore: 0: Done cleaning up thread local RawStore
20/02/04 09:50:09 INFO HiveMetaStore.audit: ugi=sga-dl  ip=unknown-ip-addr  cmd=Done cleaning up thread local RawStore
20/02/04 09:50:09 ERROR tool.ImportTool: Import failed: java.io.IOException: Hive CliDriver exited with status=10072
    at org.apache.sqoop.hive.HiveImport.executeScript(HiveImport.java:355)
    at org.apache.sqoop.hive.HiveImport.importTable(HiveImport.java:241)
    at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:537)
    at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:628)
    at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243)
    at org.apache.sqoop.Sqoop.main(Sqoop.java:252)

```

<p>The data from mysql goes to hdfs, but the hive part just doesn't run. In my head the main 'offensor' is the error pointed here</p>

```2020-02-04 09:50:02,957 main ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")
```

How can i fix this?

答:
I encountered the problem when I try to get a KafkaConsumer using KafkaClient.
I set a SecurityManager to the System to avoid "System.exit(in org.apache.spark.deploy.SparkSubmit.main)" calls, which will result in service exit.

```<code>    def forbidSystemExistCall = {
    val securityManager = new SecurityManager {
      override def checkPermission(perm: Permission): Unit = {
        if(perm.getName.startsWith("exitVM")) {
          throw new ExitTrappedException
        }
      }
    }
    System.setSecurityManager(securityManager)
  }
</code>```

However,this SecurityManager does not handle "javax.management.MBeanTrustPermission",then the problems comes. My sulotion(work a charm in my app):

```<code>Policy.setPolicy(new MBeanRegistryPolicy)

class MBeanRegistryPolicy extends Policy {

val defaultPolicy = Policy.getPolicy()

override def implies(domain: ProtectionDomain, permission: Permission): Boolean = {
  if(permission.isInstanceOf[javax.management.MBeanTrustPermission]) true
  else defaultPolicy.implies(domain, permission)
}
}
</code>```

By default, JVM doesn't use a SecurityManager, so if I don't invoke "forbidSystemCall"(which attach a user-defined SecurityManager to JVM), the problem did not occur.
May it help your problem.

Body:
i'm facing this error when running a sqoop import command to hive and HDFS, the HDFS job runs without problems, but i can't make the same import to hive due to theese java errors.

log:

[sga-dl@localhost ~]$ sqoop import --connect jdbc:mysql://localhost:3306/v3_abrasivos --username hiveusr --password DATPASS --table History_Demand --m 1 --target-dir /raw_imports/History_Demand --hive-import --create-hive-table --hive-table sqoop_v3_abrasivos.History_Demand
...
20/02/04 09:50:01 INFO mapreduce.ImportJobBase: Transferred 794.1428 MB in 58.9304 seconds (13.476
20/02/04 09:50:01 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `History_Demand` AS t LIMIT 1
20/02/04 09:50:01 WARN hive.TableDefWriter: Column Dia had to be cast to a less precise type in Hive
20/02/04 09:50:01 INFO hive.HiveImport: Loading uploaded data into Hive
20/02/04 09:50:01 INFO conf.HiveConf: Found configuration file file:/opt/hive/conf/hive-site.xml
2020-02-04 09:50:02,957 main ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:585)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(DefaultMBeanServerInterceptor.java:1848)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:322)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
    at org.apache.logging.log4j.core.jmx.Server.register(Server.java:380)
    at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:165)
    at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:138)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:507)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:249)
    at org.apache.logging.log4j.core.async.AsyncLoggerContext.start(AsyncLoggerContext.java:86)
    at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:239)
    at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:157)
    at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:130)
    at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:100)
    at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:187)
    at org.apache.hadoop.hive.common.LogUtils.initHiveLog4jDefault(LogUtils.java:154)
    at org.apache.hadoop.hive.common.LogUtils.initHiveLog4jCommon(LogUtils.java:90)
    at org.apache.hadoop.hive.common.LogUtils.initHiveLog4jCommon(LogUtils.java:82)
    at org.apache.hadoop.hive.common.LogUtils.initHiveLog4j(LogUtils.java:65)
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:702)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.sqoop.hive.HiveImport.executeScript(HiveImport.java:331)
    at org.apache.sqoop.hive.HiveImport.importTable(HiveImport.java:241)
    at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:537)
    at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:628)
    at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243)
    at org.apache.sqoop.Sqoop.main(Sqoop.java:252)

Logging initialized using configuration in jar:file:/usr/local/apache-hive-2.3.6-bin/lib/hive-common-2.3.6.jar!/hive-log4j2.properties Async: true
20/02/04 09:50:03 INFO SessionState:
Logging initialized using configuration in jar:file:/usr/local/apache-hive-2.3.6-bin/lib/hive-common-2.3.6.jar!/hive-log4j2.properties Async: true
20/02/04 09:50:03 INFO session.SessionState: Created HDFS directory: /tmp/hive/sga-dl/9133a12b-b9d9-4d17-ad47-3dc6ca872ab6
20/02/04 09:50:03 INFO session.SessionState: Created local directory: /tmp/sga-dl/9133a12b-b9d9-4d17-ad47-3dc6ca872ab6
20/02/04 09:50:03 INFO session.SessionState: Created HDFS directory: /tmp/hive/sga-dl/9133a12b-b9d9-4d17-ad47-3dc6ca872ab6/_tmp_space.db
20/02/04 09:50:03 INFO conf.HiveConf: Using the default value passed in for log id: 9133a12b-b9d9-4d17-ad47-3dc6ca872ab6
20/02/04 09:50:03 INFO session.SessionState: Updating thread name to 9133a12b-b9d9-4d17-ad47-3dc6ca872ab6 main
20/02/04 09:50:03 INFO conf.HiveConf: Using the default value passed in for log id: 9133a12b-b9d9-4d17-ad47-3dc6ca872ab6
20/02/04 09:50:03 INFO ql.Driver: Compiling command(queryId=sga-dl_20200204095003_9b2a8fbf-d798-4146-b57c-ffcb5920891b): CREATE TABLE `sqoop_v3_abrasivos.History_Demand` ( `idHistory_Demand` BIGINT, `Entidade_SalesOrg` STRING, `Cod_Material` BIGINT, `Material` STRING, `Plan_Group` STRING, `Linha_Produto` STRING, `MTS_MTO` STRING, `Cod_Tipo_OV` STRING, `Tipo_OV` STRING, `OV_Numero` BIGINT, `OV_Linha` INT, `Cod_Cliente` STRING, `Cliente` STRING, `Cod_Cliente_Corp` STRING, `Cliente_Corp` STRING, `Pais_Cliente` STRING, `UF_Cliente` STRING, `Estado_Cliente` STRING, `Cidade_Cliente` STRING, `Bairro_Cliente` STRING, `Sigla_Moeda` STRING, `OV_Moeda` STRING, `Cod_Sell_Plant` INT, `Sell_Plant` STRING, `Pais_SalesOrg` STRING, `Dia` STRING, `Periodo` STRING, `UN_Estoque` STRING, `Qtd_UN_Estoque` STRING, `Vendas_LOC` STRING) COMMENT 'Imported by sqoop on 2020/02/04 09:50:01' ROW FORMAT DELIMITED FIELDS TERMINATED BY '\001' LINES TERMINATED BY '\012' STORED AS TEXTFILE
20/02/04 09:50:05 INFO metastore.HiveMetaStore: 0: Opening raw store with implementation class:org.apache.hadoop.hive.metastore.ObjectStore
20/02/04 09:50:05 INFO metastore.ObjectStore: ObjectStore, initialize called
20/02/04 09:50:06 INFO DataNucleus.Persistence: Property hive.metastore.integral.jdo.pushdown unknown - will be ignored
20/02/04 09:50:06 INFO DataNucleus.Persistence: Property datanucleus.cache.level2 unknown - will be ignored
20/02/04 09:50:06 ERROR bonecp.BoneCP: Unable to start/stop JMX
java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:585)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(DefaultMBeanServerInterceptor.java:1848)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:322)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
    at com.jolbox.bonecp.BoneCP.registerUnregisterJMX(BoneCP.java:528)
    at com.jolbox.bonecp.BoneCP.<init>(BoneCP.java:500)
    at com.jolbox.bonecp.BoneCPDataSource.getConnection(BoneCPDataSource.java:120)
    at org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getConnection(ConnectionFactoryImpl.java:483)
    at org.datanucleus.store.rdbms.RDBMSStoreManager.<init>(RDBMSStoreManager.java:297)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.datanucleus.plugin.NonManagedPluginRegistry.createExecutableExtension(NonManagedPluginRegistry.java:606)
    at org.datanucleus.plugin.PluginManager.createExecutableExtension(PluginManager.java:301)
    at org.datanucleus.NucleusContextHelper.createStoreManagerForProperties(NucleusContextHelper.java:133)
    at org.datanucleus.PersistenceNucleusContextImpl.initialise(PersistenceNucleusContextImpl.java:422)
    at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.freezeConfiguration(JDOPersistenceManagerFactory.java:817)
    at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(JDOPersistenceManagerFactory.java:334)
    at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:213)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at javax.jdo.JDOHelper$16.run(JDOHelper.java:1965)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.jdo.JDOHelper.invoke(JDOHelper.java:1960)
    at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1166)
    at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:808)
    at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:701)
    at org.apache.hadoop.hive.metastore.ObjectStore.getPMF(ObjectStore.java:521)
    at org.apache.hadoop.hive.metastore.ObjectStore.getPersistenceManager(ObjectStore.java:550)
    at org.apache.hadoop.hive.metastore.ObjectStore.initializeHelper(ObjectStore.java:405)
    at org.apache.hadoop.hive.metastore.ObjectStore.initialize(ObjectStore.java:342)
    at org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:303)
    at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:76)
    at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
    at org.apache.hadoop.hive.metastore.RawStoreProxy.<init>(RawStoreProxy.java:58)
    at org.apache.hadoop.hive.metastore.RawStoreProxy.getProxy(RawStoreProxy.java:67)
    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.newRawStoreForConf(HiveMetaStore.java:628)
    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMSForConf(HiveMetaStore.java:594)
    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:588)
    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:655)
    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:431)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invokeInternal(RetryingHMSHandler.java:148)
    at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:107)
    at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:79)
    at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:92)
    at org.apache.hadoop.hive.metastore.HiveMetaStore.newRetryingHMSHandler(HiveMetaStore.java:6902)
    at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:164)
    at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.<init>(SessionHiveMetaStoreClient.java:70)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1707)
    at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.<init>(RetryingMetaStoreClient.java:83)
    at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:133)
    at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:104)
    at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:3600)
    at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3652)
    at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3632)
    at org.apache.hadoop.hive.ql.metadata.Hive.getAllFunctions(Hive.java:3894)
    at org.apache.hadoop.hive.ql.metadata.Hive.reloadFunctions(Hive.java:248)
    at org.apache.hadoop.hive.ql.metadata.Hive.registerAllFunctionsOnce(Hive.java:231)
    at org.apache.hadoop.hive.ql.metadata.Hive.<init>(Hive.java:388)
    at org.apache.hadoop.hive.ql.metadata.Hive.create(Hive.java:332)
    at org.apache.hadoop.hive.ql.metadata.Hive.getInternal(Hive.java:312)
    at org.apache.hadoop.hive.ql.metadata.Hive.get(Hive.java:288)
    at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.createHiveDB(BaseSemanticAnalyzer.java:236)
    at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.<init>(BaseSemanticAnalyzer.java:215)
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.<init>(SemanticAnalyzer.java:362)
    at org.apache.hadoop.hive.ql.parse.CalcitePlanner.<init>(CalcitePlanner.java:267)
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzerFactory.get(SemanticAnalyzerFactory.java:318)
    at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:484)
    at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1317)
    at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1457)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1237)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1227)
    at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:233)
    at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:184)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:403)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:336)
    at org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:474)
    at org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:490)
    at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:793)
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:759)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.sqoop.hive.HiveImport.executeScript(HiveImport.java:331)
    at org.apache.sqoop.hive.HiveImport.importTable(HiveImport.java:241)
    at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:537)
    at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:628)
    at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243)
    at org.apache.sqoop.Sqoop.main(Sqoop.java:252)
20/02/04 09:50:06 INFO metastore.ObjectStore: Setting MetaStore object pin classes with hive.metastore.cache.pinobjtypes="Table,StorageDescriptor,SerDeInfo,Partition,Database,Type,FieldSchema,Order"
20/02/04 09:50:08 ERROR bonecp.BoneCP: Unable to start/stop JMX
java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:585)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(DefaultMBeanServerInterceptor.java:1848)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:322)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
    at com.jolbox.bonecp.BoneCP.registerUnregisterJMX(BoneCP.java:528)
    at com.jolbox.bonecp.BoneCP.<init>(BoneCP.java:500)
    at com.jolbox.bonecp.BoneCPDataSource.getConnection(BoneCPDataSource.java:120)
    at org.datanucleus.store.rdbms.ConnectionProviderPriorityList.getConnection(ConnectionProviderPriorityList.java:57)
    at org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getConnection(ConnectionFactoryImpl.java:402)
    at org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getXAResource(ConnectionFactoryImpl.java:361)
    at org.datanucleus.store.connection.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:316)
    at org.datanucleus.store.connection.AbstractConnectionFactory.getConnection(AbstractConnectionFactory.java:84)
    at org.datanucleus.store.AbstractStoreManager.getConnection(AbstractStoreManager.java:347)
    at org.datanucleus.store.AbstractStoreManager.getConnection(AbstractStoreManager.java:310)
    at org.datanucleus.store.rdbms.query.JDOQLQuery.performExecute(JDOQLQuery.java:591)
    at org.datanucleus.store.query.Query.executeQuery(Query.java:1855)
    at org.datanucleus.store.query.Query.executeWithArray(Query.java:1744)
    at org.datanucleus.store.query.Query.execute(Query.java:1726)
    at org.datanucleus.api.jdo.JDOQuery.executeInternal(JDOQuery.java:374)
    at org.datanucleus.api.jdo.JDOQuery.execute(JDOQuery.java:216)
    at org.apache.hadoop.hive.metastore.MetaStoreDirectSql.ensureDbInit(MetaStoreDirectSql.java:181)
    at org.apache.hadoop.hive.metastore.MetaStoreDirectSql.<init>(MetaStoreDirectSql.java:144)
    at org.apache.hadoop.hive.metastore.ObjectStore.initializeHelper(ObjectStore.java:410)
    at org.apache.hadoop.hive.metastore.ObjectStore.initialize(ObjectStore.java:342)
    at org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:303)
    at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:76)
    at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
    at org.apache.hadoop.hive.metastore.RawStoreProxy.<init>(RawStoreProxy.java:58)
    at org.apache.hadoop.hive.metastore.RawStoreProxy.getProxy(RawStoreProxy.java:67)
    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.newRawStoreForConf(HiveMetaStore.java:628)
    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMSForConf(HiveMetaStore.java:594)
    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:588)
    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:655)
    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:431)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invokeInternal(RetryingHMSHandler.java:148)
    at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:107)
    at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:79)
    at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:92)
    at org.apache.hadoop.hive.metastore.HiveMetaStore.newRetryingHMSHandler(HiveMetaStore.java:6902)
    at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:164)
    at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.<init>(SessionHiveMetaStoreClient.java:70)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1707)
    at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.<init>(RetryingMetaStoreClient.java:83)
    at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:133)
    at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:104)
    at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:3600)
    at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3652)
    at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3632)
    at org.apache.hadoop.hive.ql.metadata.Hive.getAllFunctions(Hive.java:3894)
    at org.apache.hadoop.hive.ql.metadata.Hive.reloadFunctions(Hive.java:248)
    at org.apache.hadoop.hive.ql.metadata.Hive.registerAllFunctionsOnce(Hive.java:231)
    at org.apache.hadoop.hive.ql.metadata.Hive.<init>(Hive.java:388)
    at org.apache.hadoop.hive.ql.metadata.Hive.create(Hive.java:332)
    at org.apache.hadoop.hive.ql.metadata.Hive.getInternal(Hive.java:312)
    at org.apache.hadoop.hive.ql.metadata.Hive.get(Hive.java:288)
    at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.createHiveDB(BaseSemanticAnalyzer.java:236)
    at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.<init>(BaseSemanticAnalyzer.java:215)
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.<init>(SemanticAnalyzer.java:362)
    at org.apache.hadoop.hive.ql.parse.CalcitePlanner.<init>(CalcitePlanner.java:267)
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzerFactory.get(SemanticAnalyzerFactory.java:318)
    at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:484)
    at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1317)
    at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1457)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1237)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1227)
    at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:233)
    at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:184)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:403)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:336)
    at org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:474)
    at org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:490)
    at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:793)
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:759)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.sqoop.hive.HiveImport.executeScript(HiveImport.java:331)
    at org.apache.sqoop.hive.HiveImport.importTable(HiveImport.java:241)
    at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:537)
    at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:628)
    at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243)
    at org.apache.sqoop.Sqoop.main(Sqoop.java:252)
20/02/04 09:50:09 INFO metastore.MetaStoreDirectSql: Using direct SQL, underlying DB is MYSQL
20/02/04 09:50:09 INFO metastore.ObjectStore: Initialized ObjectStore
20/02/04 09:50:09 INFO metastore.HiveMetaStore: Added admin role in metastore
20/02/04 09:50:09 INFO metastore.HiveMetaStore: Added public role in metastore
20/02/04 09:50:09 INFO metastore.HiveMetaStore: No user is added in admin role, since config is empty
20/02/04 09:50:09 INFO metastore.HiveMetaStore: 0: get_all_functions
20/02/04 09:50:09 INFO HiveMetaStore.audit: ugi=sga-dl  ip=unknown-ip-addr  cmd=get_all_functions
20/02/04 09:50:09 INFO parse.CalcitePlanner: Starting Semantic Analysis
20/02/04 09:50:09 INFO parse.CalcitePlanner: Creating table sqoop_v3_abrasivos.History_Demand position=13
20/02/04 09:50:09 INFO metastore.HiveMetaStore: 0: get_database: sqoop_v3_abrasivos
20/02/04 09:50:09 INFO HiveMetaStore.audit: ugi=sga-dl  ip=unknown-ip-addr  cmd=get_database: sqoop_v3_abrasivos
20/02/04 09:50:09 WARN metastore.ObjectStore: Failed to get database sqoop_v3_abrasivos, returning NoSuchObjectException
FAILED: SemanticException [Error 10072]: Database does not exist: sqoop_v3_abrasivos
20/02/04 09:50:09 ERROR ql.Driver: FAILED: SemanticException [Error 10072]: Database does not exist: sqoop_v3_abrasivos
org.apache.hadoop.hive.ql.parse.SemanticException: Database does not exist: sqoop_v3_abrasivos
    at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.getDatabase(BaseSemanticAnalyzer.java:1687)
    at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.getDatabase(BaseSemanticAnalyzer.java:1676)
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.addDbAndTabToOutputs(SemanticAnalyzer.java:12171)
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeCreateTable(SemanticAnalyzer.java:12024)
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genResolvedParseTree(SemanticAnalyzer.java:11020)
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:11133)
    at org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:286)
    at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:258)
    at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:512)
    at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1317)
    at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1457)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1237)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1227)
    at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:233)
    at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:184)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:403)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:336)
    at org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:474)
    at org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:490)
    at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:793)
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:759)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.sqoop.hive.HiveImport.executeScript(HiveImport.java:331)
    at org.apache.sqoop.hive.HiveImport.importTable(HiveImport.java:241)
    at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:537)
    at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:628)
    at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243)
    at org.apache.sqoop.Sqoop.main(Sqoop.java:252)

20/02/04 09:50:09 INFO ql.Driver: Completed compiling command(queryId=sga-dl_20200204095003_9b2a8fbf-d798-4146-b57c-ffcb5920891b); Time taken: 6.541 seconds
20/02/04 09:50:09 INFO conf.HiveConf: Using the default value passed in for log id: 9133a12b-b9d9-4d17-ad47-3dc6ca872ab6
20/02/04 09:50:09 INFO session.SessionState: Resetting thread name to  main
20/02/04 09:50:09 INFO conf.HiveConf: Using the default value passed in for log id: 9133a12b-b9d9-4d17-ad47-3dc6ca872ab6
20/02/04 09:50:09 INFO session.SessionState: Deleted directory: /tmp/hive/sga-dl/9133a12b-b9d9-4d17-ad47-3dc6ca872ab6 on fs with scheme hdfs
20/02/04 09:50:09 INFO session.SessionState: Deleted directory: /tmp/sga-dl/9133a12b-b9d9-4d17-ad47-3dc6ca872ab6 on fs with scheme file
20/02/04 09:50:09 INFO metastore.HiveMetaStore: 0: Cleaning up thread local RawStore...
20/02/04 09:50:09 INFO HiveMetaStore.audit: ugi=sga-dl  ip=unknown-ip-addr  cmd=Cleaning up thread local RawStore...
20/02/04 09:50:09 INFO metastore.HiveMetaStore: 0: Done cleaning up thread local RawStore
20/02/04 09:50:09 INFO HiveMetaStore.audit: ugi=sga-dl  ip=unknown-ip-addr  cmd=Done cleaning up thread local RawStore
20/02/04 09:50:09 ERROR tool.ImportTool: Import failed: java.io.IOException: Hive CliDriver exited with status=10072
    at org.apache.sqoop.hive.HiveImport.executeScript(HiveImport.java:355)
    at org.apache.sqoop.hive.HiveImport.importTable(HiveImport.java:241)
    at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:537)
    at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:628)
    at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243)
    at org.apache.sqoop.Sqoop.main(Sqoop.java:252)

The data from mysql goes to hdfs, but the hive part just doesn't run. In my head the main 'offensor' is the error pointed here

2020-02-04 09:50:02,957 main ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")

How can i fix this?

Body:
I encountered the problem when I try to get a KafkaConsumer using KafkaClient.
I set a SecurityManager to the System to avoid "System.exit(in org.apache.spark.deploy.SparkSubmit.main)" calls, which will result in service exit.

    def forbidSystemExistCall = {
    val securityManager = new SecurityManager {
      override def checkPermission(perm: Permission): Unit = {
        if(perm.getName.startsWith("exitVM")) {
          throw new ExitTrappedException
        }
      }
    }
    System.setSecurityManager(securityManager)
  }

However,this SecurityManager does not handle "javax.management.MBeanTrustPermission",then the problems comes. My sulotion(work a charm in my app):

Policy.setPolicy(new MBeanRegistryPolicy)

class MBeanRegistryPolicy extends Policy {

val defaultPolicy = Policy.getPolicy()

override def implies(domain: ProtectionDomain, permission: Permission): Boolean = {
  if(permission.isInstanceOf[javax.management.MBeanTrustPermission]) true
  else defaultPolicy.implies(domain, permission)
}
}

By default, JVM doesn't use a SecurityManager, so if I don't invoke "forbidSystemCall"(which attach a user-defined SecurityManager to JVM), the problem did not occur.
May it help your problem.


来源: stackexchange

问:
Facing a difficulty in a bubble sort algorithm in C
First of all I am beginner in C, so I am sorry if my question seems stupid.
I was learning how to use the bubble sort algorithm in C, and I came through this code :

```<code>#include <stdio.h>

int main() {
    int ctr, inner, outer, didSwap, temp;
    int nums[10] = {
        78,
        16,
        21,
        7,
        13,
        9,
        22,
        52,
        67,
        19
    };

    //Listing the array before sorting

    for (ctr = 0; ctr < 10; ctr++) {
        printf("%d\n", nums[ctr]);
    }

    //Sorting the arrays

    for (outer = 0; outer < 9; outer++) {
        didSwap = 0;
        for (inner = outer; inner < 10; inner++) {
            if (nums[inner] < nums[outer]) {
                temp = nums[inner];
                nums[inner] = nums[outer];
                nums[outer] = temp;
                didSwap = 1;
            }
        }
        if (didSwap == 0) {
            break;
        }
    }

    //Listing the array after sorting

    printf("\n\nThis is the sorted array\n");
    for (ctr = 0; ctr < 10; ctr++) {
        printf("%d\n", nums[ctr]);
    }

    return 0;
}
</code>```

The code works fine, but what I want to understand is how in the second for loop it is written inner = outer, and in the next if statement it is comparing the elements of the array were one of them has the same number as inner and the other has the same number as outer.
And since we said that inner = outer, that means that we are comparing the same element.
The way I think about it is, if outer = 0, and since inner = outer, then inner will be 0 too, so the next if statement will be if (nums[0] < nums[0]) and that doesn't make any sense.

I know that I am probably wrong about it because the code works fine, but what did I think wrong?

Thanks in advance.

答: What if your array already has the biggest(or the smallest number) at first position.Your programme will stop when outer equals 0.(Because didSwap is 0).If you wanna use some variables like didSwap or lastSwapIndex,bubble sort should compare array[x] and array[x-1].Your algorithm looks like Selection sort more than Bubble sort.</p>

ContentLicense: CC BY-SA 4.0

Body:
First of all I am beginner in C, so I am sorry if my question seems stupid.
I was learning how to use the bubble sort algorithm in C, and I came through this code :

#include <stdio.h>

int main() {
    int ctr, inner, outer, didSwap, temp;
    int nums[10] = {
        78,
        16,
        21,
        7,
        13,
        9,
        22,
        52,
        67,
        19
    };

    //Listing the array before sorting

    for (ctr = 0; ctr < 10; ctr++) {
        printf("%d\n", nums[ctr]);
    }

    //Sorting the arrays

    for (outer = 0; outer < 9; outer++) {
        didSwap = 0;
        for (inner = outer; inner < 10; inner++) {
            if (nums[inner] < nums[outer]) {
                temp = nums[inner];
                nums[inner] = nums[outer];
                nums[outer] = temp;
                didSwap = 1;
            }
        }
        if (didSwap == 0) {
            break;
        }
    }

    //Listing the array after sorting

    printf("\n\nThis is the sorted array\n");
    for (ctr = 0; ctr < 10; ctr++) {
        printf("%d\n", nums[ctr]);
    }

    return 0;
}

The code works fine, but what I want to understand is how in the second for loop it is written inner = outer, and in the next if statement it is comparing the elements of the array were one of them has the same number as inner and the other has the same number as outer.
And since we said that inner = outer, that means that we are comparing the same element.
The way I think about it is, if outer = 0, and since inner = outer, then inner will be 0 too, so the next if statement will be if (nums[0] < nums[0]) and that doesn't make any sense.

I know that I am probably wrong about it because the code works fine, but what did I think wrong?

Thanks in advance.


问:
Custom blade directives not working - syntax error, unexpected ')'
I'm trying to create a blade directive that checks if the User is logged in AND has an activated account. In our database, we have a user_status column with 0: pending, 9 active.

// AppServiceProvider.php

public function boot()
{
    Blade::directive('active', function () {
        $condition = false;

        // check if the user is authenticated
        if (Auth::check()) {
            // check if the user has a subscription
            if(auth()->user()->getStatus() == 9) {
                $condition = true;
            } else {
                $condition = false;
            }
        }

        return "<?php if ($condition) { ?>";
    });

    Blade::directive('inactive', function () {
        return "<?php } else { ?>";
    });

    Blade::directive('endactive', function () {
        return "<?php } ?>";
    });
}
```

<p>// welcome.blade.php</p>

<pre class="lang-php prettyprint-override"><code>@active
    <p>User is active</p>
@inactive
    <p>User is inactive</p>
@endactive
</code>```

I have included this getStatus() function on my User.php model.

public function getStatus() {
    return $this->user_status;
}
```

<p>I can also use the Trait MustActivateAccount, which includes this feature:</p>

<pre class="lang-php prettyprint-override"><code>/**
 * Determine if the user has activated account.
 *
 * @return bool
 */
public function hasActivatedAccount()
{
    return $this->user_status == 9;
}
</code>```

This blade directive when added to the page says this error:

Facade\Ignition\Exceptions\ViewException
syntax error, unexpected ')'

Am I not escaping correctly in the AppServiceProvider.php file and if so where and how?

答:
You can try this in your blade template</p>

```<code>@if(Auth()->user()->user_status == 9)
    <p>User is active</p>
@else
    <p>User is inactive</p>
@endif
</code>```

Body:
I'm trying to create a blade directive that checks if the User is logged in AND has an activated account. In our database, we have a user_status column with 0: pending, 9 active.

// AppServiceProvider.php

public function boot()
{
    Blade::directive('active', function () {
        $condition = false;

        // check if the user is authenticated
        if (Auth::check()) {
            // check if the user has a subscription
            if(auth()->user()->getStatus() == 9) {
                $condition = true;
            } else {
                $condition = false;
            }
        }

        return "<?php if ($condition) { ?>";
    });

    Blade::directive('inactive', function () {
        return "<?php } else { ?>";
    });

    Blade::directive('endactive', function () {
        return "<?php } ?>";
    });
}

// welcome.blade.php

@active

User is active

@inactive

User is inactive

@endactive

I have included this getStatus() function on my User.php model.

public function getStatus() {
    return $this->user_status;
}

I can also use the Trait MustActivateAccount, which includes this feature:

/**
 * Determine if the user has activated account.
 *
 * @return bool
 */
public function hasActivatedAccount()
{
    return $this->user_status == 9;
}

This blade directive when added to the page says this error:

Facade\Ignition\Exceptions\ViewException
syntax error, unexpected ')'

Am I not escaping correctly in the AppServiceProvider.php file and if so where and how?

Body:
You can try this in your blade template

@if(Auth()->user()->user_status == 9)
    <p>User is active</p>
@else
    <p>User is inactive</p>
@endif


问:
Does anyone really use .Net CAS in their apps?
I am thinking about taking the 70-536 exam, and there is all this stuff about CAS and caspol and stuff.

Has anyone out there actually taken the time to use CAS either Decoratively or Imperatively?

I can see where it would be useful to have a basic understanding of CAS Codegroups, permission sets and what not, but i can't fathom a real scenario where I would ever actually want to use it?

I understand what the SecurityAction Demand and LinkDemand do, i just can't imagine actually using them. The only scenario that comes to mind would if i had a strongly named assembly that would run from the internet with elevated privileges and for some reason i wanted to make sure that anybody calling my assemblies also had appropriate permissions... but when does that really happen?

I only do Winforms development, perhaps in web apps this a greater concern that people often need to address?

Perhaps I am not security minded enough, lol.

Again, i'm not looking for links to microsoft documentation :) i'm  looking for realworld examples where people use this stuff.

thanks

答: Any scenario, where you have untrusted code you need to run. Plugins for windows application is one example.</p>

ContentLicense: CC BY-SA 3.0


问:
react-native :app:installDebug FAILED
Install APK debug to my device failed.

```<code>jianglinghuadeMacBook-Pro:hello jianglinghua$ react-native run-android
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug...
WARNING [Project: :app] Current NDK support is deprecated.  Alternative will be provided in the future.
:app:preBuild UP-TO-DATE
......
:app:assembleDebug UP-TO-DATE
:app:installDebug
Installing APK 'app-debug.apk' on 'MI NOTE LTE - 6.0.1'
Unable to install /Users/jianglinghua/Desktop/hello/android/app/build/outputs/apk/app-debug.apk
com.android.ddmlib.InstallException: Failed to establish session
    at com.android.ddmlib.Device.installPackages(Device.java:894)
    ........
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
:app:installDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to establish session

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 13.945 secs
</code>```

Could not install the app on the device, read the error above for details.
    Make sure you have an Android emulator running or a device connected and have
    set up your Android development environment:
    https://facebook.github.io/react-native/docs/android-setup.html

I look at my devices

```<code>jianglinghuadeMacBook-Pro:hello jianglinghua$ adb devices
List of devices attached
98333978    device
</code>```

答: I got the same error but the issue was I did on the USB Debugging  after unable this is working for me.

Title: react-native :app:installDebug FAILED

Body:
Install APK debug to my device failed.

jianglinghuadeMacBook-Pro:hello jianglinghua$ react-native run-android
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug...
WARNING [Project: :app] Current NDK support is deprecated.  Alternative will be provided in the future.
:app:preBuild UP-TO-DATE
......
:app:assembleDebug UP-TO-DATE
:app:installDebug
Installing APK 'app-debug.apk' on 'MI NOTE LTE - 6.0.1'
Unable to install /Users/jianglinghua/Desktop/hello/android/app/build/outputs/apk/app-debug.apk
com.android.ddmlib.InstallException: Failed to establish session
    at com.android.ddmlib.Device.installPackages(Device.java:894)
    ........
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
:app:installDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to establish session

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 13.945 secs

Could not install the app on the device, read the error above for details.
    Make sure you have an Android emulator running or a device connected and have
    set up your Android development environment:
    https://facebook.github.io/react-native/docs/android-setup.html

I look at my devices

jianglinghuadeMacBook-Pro:hello jianglinghua$ adb devices
List of devices attached
98333978    device


问:
How do I use rbenv (specifically adding to bash_profile)?
When I run rbenv init I get the following message ...

I opened the .bash_profile file in Textedit and I am not sure where exactly I am supposed to add the file. Below is my .bash_profile file. Where am I supposed to add the command?

```<code>
# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH
# added by Anaconda3 2019.07 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
    \eval "$__conda_setup"
else
    if [ -f "/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/anaconda3/etc/profile.d/conda.sh"
        CONDA_CHANGEPS1=false conda activate base
    else
        \export PATH="/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda init <<<

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm

bash_completion

##
# Your previous /Users/(name)/.bash_profile file was backed up as /Users/(name)/.bash_profile.macports-saved_2019-10-27_at_02:02:44
##

# MacPorts Installer addition on 2019-10-27_at_02:02:44: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.
</code>```

答:
"Append" means "add to the end" (in both English and in many programming languages).

Add that snippet to the bottom of your .bash_profile.

Body:
When I run rbenv init I get the following message ...

I opened the .bash_profile file in Textedit and I am not sure where exactly I am supposed to add the file. Below is my .bash_profile file. Where am I supposed to add the command?

# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH
# added by Anaconda3 2019.07 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
    \eval "$__conda_setup"
else
    if [ -f "/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/anaconda3/etc/profile.d/conda.sh"
        CONDA_CHANGEPS1=false conda activate base
    else
        \export PATH="/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda init <<<

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm

bash_completion

##
# Your previous /Users/(name)/.bash_profile file was backed up as /Users/(name)/.bash_profile.macports-saved_2019-10-27_at_02:02:44
##

# MacPorts Installer addition on 2019-10-27_at_02:02:44: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.


问:
Access a IIS site on a remote machine on the same network using Host name instead of IP address and port number
I am hosting a .net core 3.0 app on IIS. Currently I have access to this using a remote machine on the network via my machine's IP address:port number(eg: 192.168.1.890:81).I can add a host name in the hosts file of my computer so that i can access it via that name (eg: www.xeroimport.com). But this is only for my own computer, I want to access it using the provided host name on all local computers in the same network. Also, I don't want to deploy my app to azure as it asks for credit card information so are there any alternatives ?</p>

答:
According to your description, you should set up a DNS server in your local network as Lex says.

A DNS server is a computer server that contains a database of public IP addresses and their associated hostnames, and in most cases serves to resolve, or translate, those names to IP addresses as requested.

More details about how to set up a DNS server and configure a DNS server , you could refer to below article: https://support.microsoft.com/en-us/help/814591/how-to-install-and-configure-dns-server-in-windows-server-2003


问:
Unsupported operation: Platform._operatingSystem
My flutter code isn't running on web.

I found that "bool kisweb" can be used to detect the platform. But my code is failing at "FirebaseAuth.instance". Does this mean I can't use Firebaseauth on web as it might be depending on dart:io?

```<code>> Launching lib\main.dart on Chrome in debug mode... Debug service
> listening on ws://127.0.0.1:54007/NghsYaNRLKE= compiled for web ══╡
> EXCEPTION CAUGHT BY WIDGETS LIBRARY
> ╞═══════════════════════════════════════════════════════════ The
> following UnsupportedError was thrown building MultiProvider:
> Unsupported operation: Platform._operatingSystem The relevant
> error-causing widget was: MultiProvider
> org-dartlang-app:///packages/My_App/main.dart:30:10 When the exception
> was thrown, this was the stack:
> package:build_web_compilers/src/dev_compiler/dart_sdk.js 3996:11
> throw_ package:build_web_compilers/src/dev_compiler/dart_sdk.js
> 57810:17  _operatingSystem
> package:build_web_compilers/src/dev_compiler/dart_sdk.js 57859:27  get
> operatingSystem
> package:build_web_compilers/src/dev_compiler/dart_sdk.js 57772:27  get
> _operatingSystem package:build_web_compilers/src/dev_compiler/dart_sdk.js 5020:17   get
> package:build_web_compilers/src/dev_compiler/dart_sdk.js 57796:26  get
> isIOS package:build_web_compilers/src/dev_compiler/dart_sdk.js 5020:17
> get package:firebase_core/src%5Cfirebase_app.dart 15:16
> get defaultAppName
> package:build_web_compilers/src/dev_compiler/dart_sdk.js 5020:17   get
> package:firebase_core/src%5Cfirebase_app.dart 51:57                get
> instance package:build_web_compilers/src/dev_compiler/dart_sdk.js
> 5020:17   get package:firebase_auth/src%5Cfirebase_auth.dart 25:67
> get instance package:build_web_compilers/src/dev_compiler/dart_sdk.js
> 5020:17   get internalCallback
> ════════════════════════════════════════════════════════════════════════════════════════════════════
> Exited
</code>```

答:
You can use a try-catch block to prevent the exception from breaking the flow:

```<code>bool kisweb;
try{
    if(Platform.isAndroid||Platform.isIOS) {
        kisweb=false;
    } else {
        kisweb=true;
    }
} catch(e){
    kisweb=true;
}
</code>```

Body:
My flutter code isn't running on web.

I found that "bool kisweb" can be used to detect the platform. But my code is failing at "FirebaseAuth.instance". Does this mean I can't use Firebaseauth on web as it might be depending on dart:io?

> Launching lib\main.dart on Chrome in debug mode... Debug service
> listening on ws://127.0.0.1:54007/NghsYaNRLKE= compiled for web ══╡
> EXCEPTION CAUGHT BY WIDGETS LIBRARY
> ╞═══════════════════════════════════════════════════════════ The
> following UnsupportedError was thrown building MultiProvider:
> Unsupported operation: Platform._operatingSystem The relevant
> error-causing widget was: MultiProvider
> org-dartlang-app:///packages/My_App/main.dart:30:10 When the exception
> was thrown, this was the stack:
> package:build_web_compilers/src/dev_compiler/dart_sdk.js 3996:11
> throw_ package:build_web_compilers/src/dev_compiler/dart_sdk.js
> 57810:17  _operatingSystem
> package:build_web_compilers/src/dev_compiler/dart_sdk.js 57859:27  get
> operatingSystem
> package:build_web_compilers/src/dev_compiler/dart_sdk.js 57772:27  get
> _operatingSystem package:build_web_compilers/src/dev_compiler/dart_sdk.js 5020:17   get
> package:build_web_compilers/src/dev_compiler/dart_sdk.js 57796:26  get
> isIOS package:build_web_compilers/src/dev_compiler/dart_sdk.js 5020:17
> get package:firebase_core/src%5Cfirebase_app.dart 15:16
> get defaultAppName
> package:build_web_compilers/src/dev_compiler/dart_sdk.js 5020:17   get
> package:firebase_core/src%5Cfirebase_app.dart 51:57                get
> instance package:build_web_compilers/src/dev_compiler/dart_sdk.js
> 5020:17   get package:firebase_auth/src%5Cfirebase_auth.dart 25:67
> get instance package:build_web_compilers/src/dev_compiler/dart_sdk.js
> 5020:17   get internalCallback
> ════════════════════════════════════════════════════════════════════════════════════════════════════
> Exited

Body:
You can use a try-catch block to prevent the exception from breaking the flow:

bool kisweb;
try{
    if(Platform.isAndroid||Platform.isIOS) {
        kisweb=false;
    } else {
        kisweb=true;
    }
} catch(e){
    kisweb=true;
}


问:
Undefined Input Error in Basic Handling Form ReactJs
I am working on ReactJs form with React Bootstrap Library, I got error Undefined when running the form in browser. In Terminal, I have no error.

```<code>constructor(props){
    super(props);

    this.state = {
        username: '',
        password: '',
        fullname: ''
    }

    this.handleUsername = this.handleUsername.bind(this);
    this.handlePassword = this.handlePassword.bind(this);
    this.handleFullname = this.handleFullname.bind(this);
    this.submitUser = this.submitUser.bind(this);
}

handleUsername = (event) => {
    this.setState({
        username : event.target.value
    }, () => console.log(this.setState))

}

handlePassword = (event) => {
    this.setState({
        password: event.target.value
    })
}

handleFullname = (event) => {
    this.setState({
        fullname: event.target.value
    })
}
</code>```

I tried some suggestion in handling form but still not working. here is the form i coded :

```<code><Form className="salesUser text-left " variant="success" onSubmit={this.submitUser}>
    <Form.Group>
         <Form.Label>Username</Form.Label>
         <Form.Control type="text" value={this.state.username} onChange={this.handleUsername}></Form.Control>
    </Form.Group>
    <Form.Group>
        <Form.Label>Password</Form.Label>
        <Form.Control type="password" value={this.state.password} onChange={this.handlePassword}></Form.Control>
    </Form.Group>
    <Form.Group>
        <Form.Label>Full Name</Form.Label>
        <Form.Control type="text" value={this.state.fullname} onChange={this.handleFullname}></Form.Control>
    </Form.Group>
    <Row>
        <Col>
            <Button type="submit" value="Submit" block>Submit</Button>
        </Col>
    </Row>
</Form>
</code>```

I tried to put console.log in handleUsername to find the error, and this is the error message when I type something in form username.

hopefully I ask the rigth question this time

答:
Problem is with

```<code>console.log(this.setState)
</code>```

It takes an object to update the state, remove log and try

Body:
I am working on ReactJs form with React Bootstrap Library, I got error Undefined when running the form in browser. In Terminal, I have no error.

constructor(props){
    super(props);

    this.state = {
        username: '',
        password: '',
        fullname: ''
    }

    this.handleUsername = this.handleUsername.bind(this);
    this.handlePassword = this.handlePassword.bind(this);
    this.handleFullname = this.handleFullname.bind(this);
    this.submitUser = this.submitUser.bind(this);
}

handleUsername = (event) => {
    this.setState({
        username : event.target.value
    }, () => console.log(this.setState))

}

handlePassword = (event) => {
    this.setState({
        password: event.target.value
    })
}

handleFullname = (event) => {
    this.setState({
        fullname: event.target.value
    })
}

I tried some suggestion in handling form but still not working. here is the form i coded :

<Form className="salesUser text-left " variant="success" onSubmit={this.submitUser}>
    <Form.Group>
         <Form.Label>Username</Form.Label>
         <Form.Control type="text" value={this.state.username} onChange={this.handleUsername}></Form.Control>
    </Form.Group>
    <Form.Group>
        <Form.Label>Password</Form.Label>
        <Form.Control type="password" value={this.state.password} onChange={this.handlePassword}></Form.Control>
    </Form.Group>
    <Form.Group>
        <Form.Label>Full Name</Form.Label>
        <Form.Control type="text" value={this.state.fullname} onChange={this.handleFullname}></Form.Control>
    </Form.Group>
    <Row>
        <Col>
            <Button type="submit" value="Submit" block>Submit</Button>
        </Col>
    </Row>
</Form>

I tried to put console.log in handleUsername to find the error, and this is the error message when I type something in form username.

hopefully I ask the rigth question this time

Body:
Problem is with

console.log(this.setState)

It takes an object to update the state, remove log and try


问:
EAR and WAR class loader
I'm very confused about the JBoss class loader. Can any one describe in details how the class loader works, exactly? I only have to do one thing...

If a WAR doesn't find a class with its own classloader, he delegates the search to its parent classloader which must be the EAR's.

What changes should I have to do in my application for the above?

Please reply as soon as possible.

Thank you.

答:
In continuation of our discussion in the comments, I noticed the following JBoss feature request.

https://issues.jboss.org/browse/JBAS-4037

It looks like JBoss 4 is not fully Java EE5 compatible, however later versions of JBoss should have fixed this issue.

What version of JBoss are you running?

Title: EAR and WAR class loader


问:
How do I allocate a struct with a given char array using strdup?
So I have a typedef struct called cmd_t with a character array member called argv.
And I have a function that takes a character array argument and I want it to initialize the struct with an array with the same values as the input array but I am required for this assignment to use strdup to copy the elements. So far I have something like this:

```<code>typedef struct {
  char  *argv[ARG_MAX+1]; //ARG_MAX being a defined constant
  ...
} cmd_t;
</code>```

```<code>cmd_t *cmd_new(char *argv[]){
  cmd_t *cmd;
  for (int i = 0; i < ARG_MAX; i++){ //Last element must be NULL
    cmd->argv[i] = strdup(argv[i]);
  }
  ...
}
</code>```

Though I am getting a warning which worries me.

```<code>warning: ‘cmd’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     cmd->argv[i] = strdup(argv[i]);
</code>```

I assume my approach is rather naive and if I could get some pointers in the right direction it would be splendid.

答:
<pre class="lang-cpp prettyprint-override"><code>  /* declared here as a pointer, but is not yet pointing to a valid object */
  cmd_t *cmd;
  for (int i = 0; i < ARGMAX; i++){

    /* cmd has not yet been initialised. It's pointing at garbage! */
    cmd->argv[i] = strdup(argv[i]);
  }
</code>```

<p>You possibly want to initialise the cmd pointer to some valid memory first... </p>

<pre class="lang-cpp prettyprint-override"><code>  cmd_t *cmd = malloc(sizeof(cmd_t));
</code>```

Body:
So I have a typedef struct called cmd_t with a character array member called argv.
And I have a function that takes a character array argument and I want it to initialize the struct with an array with the same values as the input array but I am required for this assignment to use strdup to copy the elements. So far I have something like this:

typedef struct {
  char  *argv[ARG_MAX+1]; //ARG_MAX being a defined constant
  ...
} cmd_t;

cmd_t *cmd_new(char *argv[]){
  cmd_t *cmd;
  for (int i = 0; i < ARG_MAX; i++){ //Last element must be NULL
    cmd->argv[i] = strdup(argv[i]);
  }
  ...
}

Though I am getting a warning which worries me.

warning: ‘cmd’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     cmd->argv[i] = strdup(argv[i]);

I assume my approach is rather naive and if I could get some pointers in the right direction it would be splendid.

Body:
  /* declared here as a pointer, but is not yet pointing to a valid object */
  cmd_t *cmd;
  for (int i = 0; i < ARGMAX; i++){

    /* cmd has not yet been initialised. It's pointing at garbage! */
    cmd->argv[i] = strdup(argv[i]);
  }

You possibly want to initialise the cmd pointer to some valid memory first...

  cmd_t *cmd = malloc(sizeof(cmd_t));


问:
Mongoose retrieve array of objects. For each object, I only want two properties
I am just practicing Mongoose with JavaScript.

I have this mongoose schema below:

```<code>const item = new mongoose.Schema({
  name: {
    type: String,
    required: true,
    unique: true
  },
  qty: {
    type: Number,
    required: true
  },
  costPrice: Number
});

const supplySchema = new mongoose.Schema({
  items: [item]
});

const Supply = mongoose.model("Supply", supplySchema);
</code>```

Right now I just want to retrieve an array of item using mongoose.

I wish my data to look like this:

```<code>[
  {
    "name" : "Lemon",
    "qty" : 5
  },
  {
    "name": "Sugar",
    "qty": 5
  }
]

</code>```

But right now the data I get back looks something like this:

```<code>[
  {
    "_id": "5e4df1c1d48926133879f650",
    "costPrice": 0.4,
    "name": "Sugar",
    "qty": 5
  }
]
</code>```

I tried writing such a code below but it does not work:

```<code>const supplyDoc = await Supply.findOne();
const supplies = await supplyDoc.items.select("-_id");
return supplies;
</code>```

I thought I could somehow use projection on the items and specify that I don't want the _id property for each object in the array. But my code does not work. Is there a mongoose or MongoDB method I can utilize? Or do I have to use javascript to manipulate the array?

Hope to hear some advice. thank you!

答:
Try to do in this way</p>

```<code>  let supplies= await models.Supplier.find( { }, { name:1,qty:1,_id: 0 } )
</code>```

Body:
I am just practicing Mongoose with JavaScript.

I have this mongoose schema below:

const item = new mongoose.Schema({
  name: {
    type: String,
    required: true,
    unique: true
  },
  qty: {
    type: Number,
    required: true
  },
  costPrice: Number
});

const supplySchema = new mongoose.Schema({
  items: [item]
});

const Supply = mongoose.model("Supply", supplySchema);

Right now I just want to retrieve an array of item using mongoose.

I wish my data to look like this:

[
  {
    "name" : "Lemon",
    "qty" : 5
  },
  {
    "name": "Sugar",
    "qty": 5
  }
]

But right now the data I get back looks something like this:

[
  {
    "_id": "5e4df1c1d48926133879f650",
    "costPrice": 0.4,
    "name": "Sugar",
    "qty": 5
  }
]

I tried writing such a code below but it does not work:

const supplyDoc = await Supply.findOne();
const supplies = await supplyDoc.items.select("-_id");
return supplies;

I thought I could somehow use projection on the items and specify that I don't want the _id property for each object in the array. But my code does not work. Is there a mongoose or MongoDB method I can utilize? Or do I have to use javascript to manipulate the array?

Hope to hear some advice. thank you!

Body:
Try to do in this way

  let supplies= await models.Supplier.find( { }, { name:1,qty:1,_id: 0 } )