2018-10-22         Gavin

Access all templates on classpath in spring

i am trying to get all templates i have saved in template folder in spring resources/templates . below is what i am trying , i am trying to access using /getTeamplateList , but it is not giving anything @RequestMapping(value = "/getTemplateList", produces = "application/json")public List getTemplates() throws IOException { List s = new ArrayList(); File[] resourceFolderFiles = getResourceFolderFiles("classpath:/templates/"); s.addAll(Arrays.asList(resourceFolderFiles)); return s;}private static File[] getResourceFolderFiles (String folder) { ClassLoader loade...

 spring                     1 answers                     52 view
 2018-10-22         Lisa

Spring boot not finding template when deployed on docker

My app works just fine if I run the application on my host using themvn spring-boot:runbut when I deploy it on docker, it does not work and I get this error: SEVERE: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: Error resolving template "/store/index", template might not exist or might not be accessible by any of the configured Template Resolvers] with root cause org.thymeleaf.exceptions.TemplateInputException: Error resolving templat...

 spring                     1 answers                     52 view
 2018-10-22         Harriet

if we have transaction management at database level than why we put the transaction management in our code

I was going through the transaction management provided by Spring , but just for curiosity want to know if we transaction management is provided by Database than why we are using the transnational management provide by JTA, Spring etc. Indeed, you can completely avoid using transactional annotations in your code (and basically you should stick this approach). Because every transaction will be committed on each successful DB call implicitly.But sometimes you have to make several operations (queries) in a single transaction: withdraw money (from account table) and ship go...

 spring                     1 answers                     52 view
 2018-10-22         Moses

Return hazelcast data as json if read from REST

I implemented session replication using hazelcast on my spring boot app. And also exposed hazelcast data through rest by enabling 'hazelcast.rest.enabled' property.I am saving some java objects with Portable serialization on to session as attributes. Session attributes saved under SessionState object, this object is returned if I query hazelcast map using cookie id.If I access hazelcast using REST client:http://member IP address:port/hazelcast/rest/maps/mapName/keyI get data back that is not in json format. Is it possible to return this data in json? I think that current...

 spring                     1 answers                     75 view
 2018-10-22         Egbert

How do I use application written in Corda in writing my Spring Boot middleware?

Recently I started with Corda blockchain and Spring Boot and I have some doubts.I have created a simple cordapp to create and retrieve the details on Corda. I have written the flow and everything. This application is working fine and I am getting the desired output on terminal.Now I want to write a SpringBoot application for middleware which can interact with this Cordapp. But how do I use my Cordapp in SpringBoot project as lot of things would be inaccessible like Transactions, flows etc. and will show the error while writing the spring Application.I am sorry if it sounds ...

 spring                     1 answers                     30 view
 2018-10-22         Broderick

Spring Kafka 1.2.0.Relase.Jar,Spring-boot-starter 1.5.3 and spring-messaging 4.2.0

I am trying to run spring-kafka intergration.I am getting below error message when I try to launch Spring boot.https://github.com/spring-projects/spring-kafka/issues/172As per above link,4.3 is compatible with Kafka 1.1 onwards.Has any one tried this combination.Remember ,if you use spring-messaging (version 4.3) code won't compile and Eclipse complains maven config is<dependency> <groupId>org.springframework.kafka</groupId> <artifactId>spring-kafka</artifactId> <version>1.2.0.RELEASE</version><!--$NO-MVN-MAN-VER$-->&...

 spring                     2 answers                     48 view
 2018-10-22         Salome

Spring Kafka Template implementaion example for seek offset, acknowledgement

I am new to spring-kafka-template. I tried some basic stuff in it and they are working fine. But I am trying to implement some concepts mentioned at Spring Docs like : Offset SeekingAcknowledging listenersI tried to find some example for it over net but was unsuccessful. The thing only I found is its source code.We have a same issue as mentioned in this post Spring kafka consumer, seek offset at runtime.But there is no example available to implement the same.Can someone give any example on how to implement them?Thanks in advance. You should use ConsumerSeekAware for that...

 spring                     1 answers                     48 view
 2018-10-22         Fanny

spring-kafka snapshot builds exist somewhere?

I'm in need of code that only exists in the master at the moment, and the docs specifically mention a version called 2.0.0.BUILD-SNAPSHOT, but I'll be damned if I can figure out which repository is hosting such a build. Anyone have any clues?Also, is there any information published about release schedules? I'm loath to develop against the 1.x API because I want the retry and recovery functionality (which doesn't work in either of the 2.0.0 milestone builds, hence my need for a snapshot), but I don't want to commit to an unreleased library without some sense of when a rele...

 spring                     1 answers                     48 view
 2018-10-22         Prima

Send a message to Kerberized Kafka. from kafka template (spring-kafka) version 1.15 (not using Spring boot)

Using this kafka integration project version 1.15 due to compatible issues.How to use send message to Kerberized kafka ,we are not using spring boot .how to set the properties to send the message to kafka?i tried to look for the documentation but couldnt find properties related to kerberos in ProducerConfig. See the kafka documentation.Set the sasl.jaas.config property as described there:sasl.jaas.config=com.sun.security.auth.module.Krb5LoginModule required \ useKeyTab=true \ storeKey=true \ keyTab="/etc/security/keytabs/kafka_client.keytab" \ principal="ka...

 spring                     2 answers                     48 view
 2018-10-22         Lucy

Filter-Interceptor-Kafka topics

Hi am trying to build a analytical engine to determine realtime analysis of urls\events being used by client as well as to log the performance of api.Following is the logic I am planning to implement:1. Create a filter to intercept urls2. Code filter as a reusable jar which have the logic to intercept themusing mvc-interceptors.3. The interceptor will produce and publish events into kafka streams if url pattern is matched. My confusion is this is the best approach to achieve this. Or is there any alternative better approach, keeping in mind high traffice flow into apis. ...

 spring                     1 answers                     51 view
 2018-10-22         Augus

Spring Kafka Client unable to get messages from a Kerberos enabled Kafka Broker topic

We recently have our Kafka cluster kerberized and we started having issues reading messages from the topic on the broker.We are using spring kafka 1.1.2.RELEASE and kafka client 0.10.0.1.I have made the following changes in the project after going through the suggestions from Apache Kafka's documentation.Added security.protocol SASL_PLAINTEXT in the consumer properties.Added the appropriate JAAS file and provided the path in the VM arguments.Added the KRB5.conf and provided the path in VM arguments.I have the appropriate keytab entry created and supplied in the JAAS file as...

 spring                     1 answers                     55 view
 2018-10-22         Arno

Spring Kafka listener infinite loop on error

I have Spring Kafka listener initialized as @Beanpublic Map<String, Object> consumerConfig() { final HashMap<String, Object> result = new HashMap<>(); result.put(BOOTSTRAP_SERVERS_CONFIG, bootstrapServers); result.put(GROUP_ID_CONFIG, groupId); result.put(KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); result.put(VALUE_DESERIALIZER_CLASS_CONFIG, MyKafkaJacksonRulesExecutionResultsDeserializer.class); return result;}@Beanpublic ConsumerFactory<Long, MessageResult> consumerFactory() { return new DefaultKafkaConsumerFacto...

 spring                     1 answers                     53 view
 2018-10-22         Elvira

kafka Message driven adapter not working

Would like to consume messages using kafka:message-driven-channel-adapter.producing the message in below channels:headers['topic'] = inMsge_topic,emailMesge_topicDidn't find good example for the same in the internet either.Please suggest.Working fine when usingint-kafka:inbound-channel-adapter but it requires polling.(want to do without polling)Below is the configuration using: <int-kafka:outbound-channel-adapter id="kafkaOutboundChannelAdapter" kafka-producer-context-ref="kafkaProducerContext" auto-startup=...

 spring                     1 answers                     58 view
 2018-10-22         Arlene

Spring Cloud Config Client - Java Configuration HashMap or properties

Im newbie in MicroServicies, euereka and spring... I want to start my Eureka client, getting the values from a HashMap that I created before starting the application in which the cloud information is.HashMap config = new HashMap ();config.put ("spring_cloud_config_enabled", "true");config.put ("spring_application_name", "MicroService");config.put ("spring_profiles_active", "default");config.put ("spring_cloud_config_uri", "http://myHost:8888");If it were empty, access the bootstrap.properties information.Does anyone know how could i do it?Thank you! Following is the orde...

 spring                     1 answers                     48 view
 2018-10-22         Matthew

@NotNull is not validating and not Producing correct Result in Spring Framework

I have created a simple Application that checks whether the given first name and lastname is null or not . i have used @NotNull annotation to check The code for the Student.java is @NotNull(message = "Name must not be null") private String firstName; @NotNull(message = "Name must not be null") private String lastName;i have also created StudentController.java public String processForm(@Valid @ModelAttribute("student") Student student,BindingResult bindingResult){ //bindingResult is not an annotation if(bindingResult.hasErrors()) { return "error"...

 spring                     2 answers                     76 view
 2018-10-22         Adam

WebClient doesn't read response until request write is completed.

I'm trying to implement streaming proxy.I faced with the issue with WebClient from spring reactive.Could anyone help me to understand Do I some wrong way or it's just a bug from WebClient side?Stack:reactor-netty 0.7.8.RELEASEspring-boot 2.0.4.RELEASEDesc:I want to proxy a long stream to external service and then forward stream of responses to the requester.Streaming is happening using chunks (HTTP 1.1 Transfer-Encoding : chunked).External service processes every chunk and sends to the response result.Expected behaviour:WebClient should read every received part of response ...

 spring                     1 answers                     68 view

Page 1 of 449  |  Show More Pages:  Top Prev Next Last