我已经在网站(example.com)上实现了Google oAuth。除了我站点上子域的auth(我有成千上万个子域)的授权外,其他一切都正常。例如,当用户尝试通过子域进行授权时
fr.example.com
product1.example.com
product2.de.example.com
Run Code Online (Sandbox Code Playgroud)
我收到来自Google的错误-
The redirect URI in the request did not match a registered redirect URI
Run Code Online (Sandbox Code Playgroud)
如何解决?
我使用Spring 4.1.6.RELEASE和Spring Boot 1.2.3.RELEASE.现在,我无法顺利地从Neo4j 2.1.7和SDN 3.2.2.RELEASE迁移到Neo4j 2.2.0和SDN 3.3.0.RELEASE
首先,Neo4jHelper
课程缺席......那么应该使用什么呢?
此外,我的测试崩溃,但有以下例外:
org.springframework.dao.InvalidDataAccessApiUsageException: nested exception is org.neo4j.graphdb.NotInTransactionException
at org.springframework.data.neo4j.support.Neo4jExceptionTranslator.translateExceptionIfPossible(Neo4jExceptionTranslator.java:51)
at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:59)
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:147)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
Run Code Online (Sandbox Code Playgroud)
但在以前的版本中一切正常(我的DAO和服务都注释了@Transactional
).
如何在我的Spring Boot应用程序中为Neo4j配置适当的TX管理器?
现在NullTransactionManager
使用,我认为这是问题的原因:
2015-04-03 11:40:36 [main] INFO o.s.c.a.AnnotationConfigApplicationContext - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@12db5286: startup date [Fri Apr 03 11:40:36 EEST 2015]; root of context hierarchy
2015-04-03 11:40:37 [main] INFO o.s.b.f.a.AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2015-04-03 11:40:38 [main] INFO o.s.t.jta.JtaTransactionManager - Using JTA UserTransaction: …
Run Code Online (Sandbox Code Playgroud) 在我的Spring Boot 1.3.3.RELEASE
应用程序中,Actuator的Health端点返回以下JSON:
{"status":"UP","diskSpace":{"status":"UP","total":120031539200,"free":109277069312,"threshold":10485760}}
Run Code Online (Sandbox Code Playgroud)
我想要返回漂亮的打印JSON而不是单个字符串.
我已将以下配置添加到我的application.yml
:
spring:
jackson:
serialization:
INDENT_OUTPUT: true
Run Code Online (Sandbox Code Playgroud)
但输出仍然返回相同的单个字符串.
如何正确配置我的应用程序以返回漂亮的JSON?
更新
这是我的 application.yml
server:
port: @server.port@
contextPath: /dashboard
management:
contextPath: /actuator
spring:
jackson:
serialization:
INDENT_OUTPUT: true
jmx:
enabled: false
aop:
proxy-target-class: @spring.aop.proxy-target-class@
security:
bcryptPasswordEncoder:
strength: @spring.security.bcryptPasswordEncoder.strength@
datasource:
driverClassName: @spring.datasource.driverClassName@
url: @spring.datasource.url@
username: @spring.datasource.username@
password: @spring.datasource.password@
jpa:
database: @spring.jpa.database@
database-platform: @spring.jpa.database-platform@
hibernate.ddl-auto: @spring.jpa.hibernate.ddl-auto@
show-sql: @spring.jpa.show-sql@
ok:
client:
clientSecret: @ok.client.clientSecret@
clientPublicKey: @ok.client.clientPublicKey@
Run Code Online (Sandbox Code Playgroud)
这是父pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>example</artifactId>
<version>0.0.1</version> …
Run Code Online (Sandbox Code Playgroud) 在我的 PostgreSQL 中,我有两个表board
和它们之间cards
有OneToMany
关系的表(一个board
可以有多个cards
)。
用户可以在板上放置几张卡片。为了实现这个功能,我通常会创建另一个表,例如cards_on_hold
用OneToMany
关系调用,并将卡放在这个表中。为了获取板的这些数据,我会在board
和之间使用 JOIN cards_on_hold
。
PostgreSQL 中是否有更有效的方法来存储卡的 ID?例如,也许某些功能可以将此列表内联存储在board
表中?稍后我将需要在IN
SQL 子句中使用此 ID 列表来过滤卡片集。
在我的Spring Boot应用程序中,我有以下静态文件:
\src\main\resources\static\images\social\facebook\f_logo.jpg
Run Code Online (Sandbox Code Playgroud)
这是我的application.properties
server.port: 8080
server.contextPath: /api
Run Code Online (Sandbox Code Playgroud)
我正在尝试通过以下网址访问此文件:
http:// localhost:8080 / api / images / social / facebook / f_logo.jpg
但是服务器返回 404 Not Found.
我在做什么错以及如何解决?
更新
我的pom文件:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>example</artifactId>
<version>0.0.1</version>
<packaging>pom</packaging>
<name>example</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jackson.version>2.8.0</jackson.version>
<spring.version>4.3.5.RELEASE</spring.version>
<spring.boot.version>1.4.3.RELEASE</spring.boot.version>
<cdi-api.version>2.0-EDR1</cdi-api.version>
<slf4j.version>1.7.18</slf4j.version>
<logback.version>1.1.6</logback.version>
<junit.version>4.12</junit.version>
<log4j.version>1.2.17</log4j.version>
<commons-lang3.version>3.4</commons-lang3.version>
<commons-validator.version>1.5.0</commons-validator.version>
<commons-io.version>2.4</commons-io.version>
<jacoco-maven-plugin.version>0.7.4.201502262128</jacoco-maven-plugin.version>
<maven-surefire-plugin.version>2.19</maven-surefire-plugin.version>
<lifecycle-mapping.version>1.0.0</lifecycle-mapping.version>
<java.source.version>1.8</java.source.version>
<java.target.version>1.8</java.target.version>
</properties>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>neo4j-release-repository</id>
<name>Neo4j Maven 2 release repository</name>
<url>http://m2.neo4j.org/content/repositories/releases</url>
<releases> …
Run Code Online (Sandbox Code Playgroud) 我可以使用以下Maven命令运行Spring Boot应用程序:
mvn spring-boot:run
Run Code Online (Sandbox Code Playgroud)
但我不知道如何正常关闭以这种方式启动的应用程序。请指教。
在我的Spring应用程序中,我有一个带有org.springframework.transaction.annotation.Transactional
注释的类。
是否可以丢弃此类的特定单个方法的事务而无需@Transactional
从类级别的声明中删除?如果是这样,请举一个例子
我使用以下逻辑重新启动未完成的 Spring Batch(例如应用程序异常终止后)作业:
public void restartUncompletedJobs() {
LOGGER.info("Restarting uncompleted jobs");
try {
jobRegistry.register(new ReferenceJobFactory(documetPipelineJob));
List<String> jobs = jobExplorer.getJobNames();
for (String job : jobs) {
Set<JobExecution> runningJobs = jobExplorer.findRunningJobExecutions(job);
for (JobExecution runningJob : runningJobs) {
runningJob.setStatus(BatchStatus.FAILED);
runningJob.setEndTime(new Date());
jobRepository.update(runningJob);
jobOperator.restart(runningJob.getId());
LOGGER.info("Job restarted: " + runningJob);
}
}
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
}
}
Run Code Online (Sandbox Code Playgroud)
这工作正常,但有一个副作用 - 它不会重新启动失败的作业执行,而是创建一个新的执行实例。如何更改此逻辑以便从失败的步骤重新启动失败的执行并且不创建新的执行?
更新
当我尝试以下代码时:
public void restartUncompletedJobs() {
try {
jobRegistry.register(new ReferenceJobFactory(documetPipelineJob));
List<String> jobs = jobExplorer.getJobNames();
for (String job : jobs) {
Set<JobExecution> jobExecutions …
Run Code Online (Sandbox Code Playgroud) 在 Apache Spark API 中,我可以使用startsWith
函数来测试列的值:
myDataFrame.filter(col("columnName").startsWith("PREFIX"))
Run Code Online (Sandbox Code Playgroud)
是否可以在 Spark SQL 表达式中执行相同的操作,如果可以,请举例说明?
铸造DecimalType(10,5
) 例如99999.99999
到DecimalType(
5,4) 在 Apache Spark 中静默返回null
在这种情况下,是否可以更改此行为并允许 Spark 抛出异常(例如某些 CastException)并使作业失败而不是静默返回null
?
spring-boot ×5
spring ×3
apache-spark ×2
scala ×2
casting ×1
google-oauth ×1
json ×1
maven ×1
neo4j ×1
oauth ×1
oauth-2.0 ×1
postgresql ×1
spring-batch ×1
transactions ×1