- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我在使用 Spring Batch 时遇到了一些麻烦。我处于这种情况:我必须分析文件中的数据并将所有内容插入数据库(Oracle)。我面临的问题是,当我尝试配置用于保存数据的数据库时,应用程序崩溃并关闭。我收到此错误消息:
:: Spring Boot :: (v2.0.0.RELEASE)
2018-03-28 17:21:25.033 INFO 9912 --- [ main] c.e.demo.SpringMultiprocessApplication : Starting SpringMultiprocessApplication on XXXel with PID 9912 (C:\Users\......\target\classes started by XXXEl in C:\Users\......)
2018-03-28 17:21:25.037 INFO 9912 --- [ main] c.e.demo.SpringMultiprocessApplication : No active profile set, falling back to default profiles: default
2018-03-28 17:21:25.094 INFO 9912 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@5af97850: startup date [Wed Mar 28 17:21:25 CEST 2018]; root of context hierarchy
2018-03-28 17:21:25.491 INFO 9912 --- [ main] o.s.b.f.xml.XmlBeanDefinitionReader : Loading XML bean definitions from class path resource [batchjob.xml]
2018-03-28 17:21:25.879 WARN 9912 --- [ main] o.s.c.a.ConfigurationClassEnhancer : @Bean method ScopeConfiguration.stepScope is non-static and returns an object assignable to Spring's BeanFactoryPostProcessor interface. This will result in a failure to process annotations such as @Autowired, @Resource and @PostConstruct within the method's declaring @Configuration class. Add the 'static' modifier to this method to avoid these container lifecycle issues; see @Bean javadoc for complete details.
2018-03-28 17:21:25.889 WARN 9912 --- [ main] o.s.c.a.ConfigurationClassEnhancer : @Bean method ScopeConfiguration.jobScope is non-static and returns an object assignable to Spring's BeanFactoryPostProcessor interface. This will result in a failure to process annotations such as @Autowired, @Resource and @PostConstruct within the method's declaring @Configuration class. Add the 'static' modifier to this method to avoid these container lifecycle issues; see @Bean javadoc for complete details.
2018-03-28 17:21:25.897 INFO 9912 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Replacing scope 'step' from [org.springframework.batch.core.scope.StepScope@388ba540] to [org.springframework.batch.core.scope.StepScope@47605f2f]
2018-03-28 17:21:25.899 INFO 9912 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean 'itemReader' with a different definition: replacing [Generic bean: class [com.example.demo.step.Reader]; scope=step; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=false; primary=false; factoryBeanName=null; factoryMethodName=reader; initMethodName=null; destroyMethodName=null; defined in class path resource [batchjob.xml]] with [Root bean: class [org.springframework.aop.scope.ScopedProxyFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in BeanDefinition defined in class path resource [batchjob.xml]]
2018-03-28 17:21:25.899 INFO 9912 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean 'itemProcessor' with a different definition: replacing [Generic bean: class [com.example.demo.step.Processor]; scope=step; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=false; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [batchjob.xml]] with [Root bean: class [org.springframework.aop.scope.ScopedProxyFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in BeanDefinition defined in class path resource [batchjob.xml]]
2018-03-28 17:21:25.899 INFO 9912 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean 'itemWriter' with a different definition: replacing [Generic bean: class [com.example.demo.step.Writer]; scope=step; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=false; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [batchjob.xml]] with [Root bean: class [org.springframework.aop.scope.ScopedProxyFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in BeanDefinition defined in class path resource [batchjob.xml]]
2018-03-28 17:21:26.210 INFO 9912 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2018-03-28 17:21:26.225 INFO 9912 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-03-28 17:21:26.225 INFO 9912 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.28
2018-03-28 17:21:26.229 INFO 9912 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jre1.8.0_161\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_161/bin/server;C:/Program Files/Java/jre1.8.0_161/bin;C:/Program Files/Java/jre1.8.0_161/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;C:\Program Files\PuTTY\;C:\Program Files\Git\cmd;C:\Users\XXXel\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\maven3.2.5\apache-maven-3.2.5\bin;;C:\Program Files (x86)\eclipse\eclipse;;.]
2018-03-28 17:21:26.285 INFO 9912 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-03-28 17:21:26.286 INFO 9912 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1196 ms
2018-03-28 17:21:26.397 INFO 9912 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2018-03-28 17:21:26.417 INFO 9912 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-03-28 17:21:26.417 INFO 9912 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-03-28 17:21:26.417 INFO 9912 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-03-28 17:21:26.417 INFO 9912 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-03-28 17:21:26.478 INFO 9912 --- [ main] o.s.j.d.DriverManagerDataSource : Loaded JDBC driver: oracle.jdbc.OracleDriver
2018-03-28 17:21:26.942 INFO 9912 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@5af97850: startup date [Wed Mar 28 17:21:25 CEST 2018]; root of context hierarchy
2018-03-28 17:21:27.005 INFO 9912 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/runjob]}" onto public java.lang.String com.example.demo.controller.WebController.handle() throws java.lang.Exception
2018-03-28 17:21:27.009 INFO 9912 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-03-28 17:21:27.010 INFO 9912 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-03-28 17:21:27.038 INFO 9912 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-03-28 17:21:27.038 INFO 9912 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-03-28 17:21:27.069 INFO 9912 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-03-28 17:21:27.396 INFO 9912 --- [ main] o.s.b.c.r.s.JobRepositoryFactoryBean : No database type set, using meta data indicating: ORACLE
2018-03-28 17:21:27.409 INFO 9912 --- [ main] o.s.b.c.l.support.SimpleJobLauncher : No TaskExecutor has been set, defaulting to synchronous executor.
2018-03-28 17:21:27.595 INFO 9912 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-03-28 17:21:27.633 INFO 9912 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2018-03-28 17:21:27.635 INFO 9912 --- [ main] c.e.demo.SpringMultiprocessApplication : Started SpringMultiprocessApplication in 2.845 seconds (JVM running for 3.316)
2018-03-28 17:21:27.638 INFO 9912 --- [ main] o.s.b.a.b.JobLauncherCommandLineRunner : Running default command line with: []
2018-03-28 17:21:27.745 INFO 9912 --- [ main] o.s.b.f.xml.XmlBeanDefinitionReader : Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
2018-03-28 17:21:27.771 INFO 9912 --- [ main] o.s.jdbc.support.SQLErrorCodesFactory : SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase, Hana]
2018-03-28 17:21:27.809 INFO 9912 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-03-28 17:21:27.816 ERROR 9912 --- [ main] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalStateException: Failed to execute CommandLineRunner
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:793) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:774) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:335) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1234) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at com.example.demo.SpringMultiprocessApplication.main(SpringMultiprocessApplication.java:18) [classes/:na]
Caused by: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [SELECT JOB_INSTANCE_ID, JOB_NAME from BATCH_JOB_INSTANCE where JOB_NAME = ? order by JOB_INSTANCE_ID desc]; nested exception is java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:235) ~[spring-jdbc-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) ~[spring-jdbc-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1402) ~[spring-jdbc-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:620) ~[spring-jdbc-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:657) ~[spring-jdbc-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:688) ~[spring-jdbc-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:700) ~[spring-jdbc-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.batch.core.repository.dao.JdbcJobInstanceDao.getJobInstances(JdbcJobInstanceDao.java:230) ~[spring-batch-core-4.0.0.RELEASE.jar:4.0.0.RELEASE]
at org.springframework.batch.core.explore.support.SimpleJobExplorer.getJobInstances(SimpleJobExplorer.java:173) ~[spring-batch-core-4.0.0.RELEASE.jar:4.0.0.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_161]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_161]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_161]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:338) ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197) ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$PassthruAdvice.invoke(SimpleBatchConfiguration.java:127) ~[spring-batch-core-4.0.0.RELEASE.jar:4.0.0.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at com.sun.proxy.$Proxy80.getJobInstances(Unknown Source) ~[na:na]
at org.springframework.batch.core.JobParametersBuilder.getNextJobParameters(JobParametersBuilder.java:254) ~[spring-batch-core-4.0.0.RELEASE.jar:4.0.0.RELEASE]
at org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner.execute(JobLauncherCommandLineRunner.java:162) ~[spring-boot-autoconfigure-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner.executeLocalJobs(JobLauncherCommandLineRunner.java:179) ~[spring-boot-autoconfigure-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner.launchJobFromProperties(JobLauncherCommandLineRunner.java:134) ~[spring-boot-autoconfigure-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner.run(JobLauncherCommandLineRunner.java:128) ~[spring-boot-autoconfigure-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:790) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
... 5 common frames omitted
Caused by: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445) ~[ojdbc6-11.2.0.3.jar:11.2.0.3.0]
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396) ~[ojdbc6-11.2.0.3.jar:11.2.0.3.0]
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879) ~[ojdbc6-11.2.0.3.jar:11.2.0.3.0]
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450) ~[ojdbc6-11.2.0.3.jar:11.2.0.3.0]
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192) ~[ojdbc6-11.2.0.3.jar:11.2.0.3.0]
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531) ~[ojdbc6-11.2.0.3.jar:11.2.0.3.0]
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207) ~[ojdbc6-11.2.0.3.jar:11.2.0.3.0]
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:884) ~[ojdbc6-11.2.0.3.jar:11.2.0.3.0]
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1167) ~[ojdbc6-11.2.0.3.jar:11.2.0.3.0]
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1289) ~[ojdbc6-11.2.0.3.jar:11.2.0.3.0]
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3584) ~[ojdbc6-11.2.0.3.jar:11.2.0.3.0]
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3628) ~[ojdbc6-11.2.0.3.jar:11.2.0.3.0]
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1493) ~[ojdbc6-11.2.0.3.jar:11.2.0.3.0]
at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:666) ~[spring-jdbc-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:605) ~[spring-jdbc-5.0.4.RELEASE.jar:5.0.4.RELEASE]
... 27 common frames omitted
2018-03-28 17:21:27.817 INFO 9912 --- [ main] ConfigServletWebServerApplicationContext : Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@5af97850: startup date [Wed Mar 28 17:21:25 CEST 2018]; root of context hierarchy
2018-03-28 17:21:27.818 INFO 9912 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
我是 Spring 的新手,但据我所知,Spring Batch 正在尝试访问我的数据库并查询它的元数据(SpringBatch 的东西)。现在的问题是:如何告诉 Spring Batch 使用其嵌入式数据库来保存其数据(元数据)而不是尝试访问我的数据库?
application.properties
spring.batch.job.enabled=true
spring.batch.initialize-schema=EMBEDDED
spring.datasource.url=jdbc:oracle:thin:@localhost:1521:ASDF
spring.datasource.username=USERNAME
spring.datasource.password=PASSWORD
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
MultipleDBConfig.java 用于配置数据库的Bean
@Configuration
public class MultipleDBConfig {
@Autowired
private Environment env;
@Bean
public DataSource customDataSource() {
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName(env.getProperty("spring.datasource.driver-class-name"));
dataSource.setUrl(env.getProperty("spring.datasource.url"));
dataSource.setUsername(env.getProperty("spring.datasource.username"));
dataSource.setPassword(env.getProperty("spring.datasource.password"));
return dataSource;
}
}
最佳答案
我以前就是这样解决的。这是非启动和旧的 Spring,但它可能仍然适用于您所处的任何环境。默认情况下,setDataSource()
将与您的 Oracle ds 一起注入(inject),但如果您阻止它被注入(inject)注入(inject)后,Spring Batch 只会将这些细节存储在内存中。
如果您想要使用不同的数据源(即,如果您希望批处理元数据仍然保留),您可以使用 @Qualifier
指定不同的数据源 bean 并调用 super.setDataSource(dataSource);
.可能还有其他方法可以做到这一点,几年没碰过这段代码了。
@Configuration
@EnableBatchProcessing
public class BatchConfig extends DefaultBatchConfigurer {
@Override
@Autowired
public void setDataSource(DataSource dataSource) {
// If we don't provide a datasource, an in-memory map will be used.
}
}
关于Java Spring Batch 使用嵌入式数据库存储元数据,使用第二个数据库存储其他数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49550523/
这个问题困扰了我几天。 这是我的相关 Storyboard布局: 我已经将阳光下的每个布局都设置为所有三个 View Controller ,并且仍然得到一个在横幅 View 上方有一个“间隙”的结果
我正在我的 C++ 程序中嵌入一个网页。我遇到的问题是,在嵌入式页面的 javascript 中,我可以捕获 onkeypress,但不会触发 onkeydown 和 onkeyup。 如果我在非嵌入
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 想改进这个问题?将问题更新为 on-topic对于堆栈溢出。 5年前关闭。 Improve this qu
我有一个 java web 应用程序。我想创建一个嵌入式 LDAP 服务器,当 web 应用程序运行时,我将向 LDAP 插入一些记录,并且有另一个 web 应用程序将访问此 LDAP 以获取信息。可
我正在尝试通过 tomcat maven 插件将 war 部署到嵌入式 tomcat 服务器。控制台显示服务器启动正常。 看来 war 还没有展开。当我访问 http://localhost:9090
假设我有如下函数: bigrams=[(k,v) for (k,v) in dict_bigrams.items() if k[:pos_qu]==selection[:pos_qu
我读过一些关于 python 嵌入式 C++ 的教程。我曾引用过 python 对象。 https://docs.python.org/3/c-api/function.html Python 脚本:
我正在使用嵌入式应用程序,在调试期间,调试器无法解析宏符号(我的理论:因为宏在预处理中丢失了)。我最终不得不先在源代码中找到宏,然后使用定义来监视变量。 我的问题是:有没有办法将宏定义合并到 elf
首先我要说的是我开发的是基于cortex m4的嵌入式设备应用。 我有引导加载程序和主应用程序通用的功能。现在我为引导加载程序和应用程序编译源文件 2 次。但是我的双库 dfu 空间不足,我想在 RO
作为嵌入式 C 编程的初学者,我很好奇每个(根据我的经验)程序执行是如何从 main() 函数开始的?这就像链接器识别 main() 并将那个“特殊” 函数的地址放入重置 vector 指向的地址。
在我的实时嵌入式处理器固件中,我需要十进制数字的格式化打印。标准 printf/sprintf 在工具链中不可用,所以我需要自己实现它。 我使用了除以十并取余的天真方法。但是我的目标处理器本身不支持除
我有编程经验,但在软件开发方面了解不多。我目前正在为我工作的公司编写一个软件,我开始挑战自己代码的可读性。 我想知道这是否是嵌入式 if 语句的“有效”替代方案,或者我是否可以使用更好的方法。 假
我有一个运行嵌入式 Linux 的嵌入式目标,我想计算以下时间: 1) 高速缓存读/写时序2) uncache 内存读/写时序 Linux 中是否有任何标准测试来计算上述时间? 我已经编写了自己的测试
大多数嵌入式设备都是为了在通常资源受限或低规格的设备上执行特定任务而构建的。 因此,大多数嵌入式开发人员需要去除不必要的库和模块,并为其特定设备和用例创建自定义分发。我们先来了解一下嵌入式 Linu
我正在嵌入式处理器上编写一个简单的裸机应用程序。作为此应用程序的一部分,它必须使用 malloc 在大约 256kB 的堆上分配一些内存。注意:最初这是在 main 中静态分配的,但在一定的大小限制下
我正在尝试为我 friend 的婚礼建立一个网站。我使用的是 Bootstrap 5,嵌入的视频没有填满屏幕大小。这是一个 live test page HTML: 您还需要代码吗?我想让视频的全宽
我有一个项目,我尝试为微 Controller 构建固件并尝试更好地控制所使用的优化标志。我想,而不是使用 -O flag 分别指定不同的优化标志。不幸的是,-O 似乎发生了一些优化魔法。我无法使用单
我正在使用双核设备,并且要求核心 A 创建一个数据结构,其中包含在核心 B 上运行的函数列表的参数,定期更新它并通知核心 B。参数和类型的数量可以改变在运行期间。 我的计划如下.. 创建一个 Para
我们有一个 Microsoft.Phone.Controls.WebBrowser内嵌控件 StackPanel , 在 PivotItem 内在 Windows Phone 8 上。以简化的形式,它
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭 2 年前。 Improve this ques
我是一名优秀的程序员,十分优秀!