Skip to content

Instantly share code, notes, and snippets.

@Override
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException {
String username = null,
password = null;
if (request.getMethod().equals(HttpMethod.OPTIONS.toString())) {
response.setStatus(HttpStatus.OK.value());
return null;
} else if (request.getMethod().equals("POST")) {
if (verifyHeaderContentType(request) || request.getHeader("Accept") != null)
response.addHeader("Content-Type", request.getHeader("Accept"));
eyJhbGciOiJSUzI1NiIsImtpZCI6IjFlOWdkazcifQ.ewogImlzcyI6ICJodHRw
Oi8vc2VydmVyLmV4YW1wbGUuY29tIiwKICJzdWIiOiAiMjQ4Mjg5NzYxMDAxIiw
KICJhdWQiOiAiczZCaGRSa3F0MyIsCiAibm9uY2UiOiAibi0wUzZfV3pBMk1qIi
wKICJleHAiOiAxMzExMjgxOTcwLAogImlhdCI6IDEzMTEyODA5NzAKfQ.ggW8hZ
1EuVLuxNuuIJKX_V8a_OMXzR0EHR9R6jgdqrOOF4daGU96Sr_P6qJp6IcmD3HP9
9Obi1PRs-cwh3LO-p146waJ8IhehcwL7F09JdijmBqkvPeB2T9CJNqeGpe-gccM
g4vfKjkM8FcGvnzZUN4_KSP0aAp1tOJ1zZwgjxqGByKHiOtX7TpdQyHE5lcMiKP
XfEIQILVq0pc_E2DzL7emopWoaoZTF_m0_N0YzFC6g6EJbOEoRoSK5hoDalrcvR
YLSrQAZZKflyuVCyixEoV9GfNQC3_osjzw2PAithfubEEBLuVVk4XUVrWOLrLl0
nx7RkKU8NXNHq-rvKMzqg
@jhiemer
jhiemer / manifest.yml
Created June 20, 2014 06:28
Wrong handling of services in manifest.yml of CloudFoundry Bamboo Plugin.
---
# This is a minimal manifest
applications:
- name: broker
instances: 1
memory: 1024M
path: target/broker.war
buildpack: https://github.com/cloudfoundry/java-buildpack.git
services:
- cs-mongodb
[INFO] +- org.springframework.data:spring-data-jpa:jar:1.5.0.M1:compile
[INFO] | +- org.springframework.data:spring-data-commons:jar:1.7.0.M1:compile
[INFO] | +- org.springframework:spring-context:jar:4.0.0.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:4.0.0.RELEASE:compile
[INFO] | +- org.springframework:spring-tx:jar:4.0.0.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:3.2.5.RELEASE:compile
dadsadsddsaads
LOGBACK:11:44:36.644 [localhost-startStop-1] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default'
LOGBACK:11:44:36.651 [localhost-startStop-1] ERROR o.s.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'notificationRepository': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/data/querydsl/QSort
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553) ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java
LOGBACK:09:30:04.308 [tomcat-http--4] DEBUG o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver - Resolving exception from handler [public org.springframework.hateoas.Resources<?> org.springframework.data.rest.webmvc.RepositoryEntityController.listEntities(org.springframework.data.rest.webmvc.RepositoryRestRequest,org.springframework.data.domain.Pageable,org.springframework.data.domain.Sort) throws org.springframework.data.rest.webmvc.ResourceNotFoundException]: java.lang.NullPointerException
LOGBACK:09:30:04.309 [tomcat-http--4] DEBUG o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver - Invoking @ExceptionHandler method: public org.springframework.http.ResponseEntity<?> org.springframework.data.rest.webmvc.AbstractRepositoryRestController.handleNPE(java.lang.NullPointerException)
LOGBACK:09:30:04.309 [tomcat-http--4] DEBUG o.s.web.servlet.DispatcherServlet - Null ModelAndView returned to DispatcherServlet with name 'rest-exporter': assuming HandlerAdapter completed request handling
LOGBACK:09:30:04.309 [tomcat-http
VirtualMachineTemplates.Expand(Function(vmt) vmt.GlobalProfiles)
.Where(Function(vmt) vmt.virtualMachineTemplateName = "Desktop - RedHat 5 U5 x64")
.SelectMany(Function(vmt) vmt.GlobalProfiles.GlobalProfileID.toString()).toArray()
/**
* VirtualMachineTemplates manyToMany - GlobalProfiles
*
**/
Error occured processing XML 'tried to access method org.springframework.context.annotation.AnnotationConfigUtils.processCommonDefinitionAnnotations(Lorg/springframework/beans/factory/
annotation/AnnotatedBeanDefinition;)V from class org.springframework.data.repository.config.RepositoryComponentProvider'. See Error Log for more details
<jpa:repositories base-package="de.model.repositories">
<repository:exclude-filter type="aspectj" expression="de.model.nosql.repositories.*"/>
</jpa:repositories>
@jhiemer
jhiemer / bla.java
Last active December 26, 2015 02:59
public class CustomRepositoryRestMvcConfiguration
extends RepositoryRestMvcConfiguration {
@Override
protected void configureJacksonObjectMapper(ObjectMapper objectMapper) {
SimpleModule longModule = new SimpleModule("LongDeserializerModule", new Version(1, 0, 0, null));
longModule.addDeserializer(Long.class, new LongJsonDeserializer());
SimpleModule bigIntegerModule = new SimpleModule("BigIntegerDeserializerModule", new Version(1, 0, 0, null));