These are chat archives for spring-cloud/spring-cloud

3rd
May 2016
Dave Syer
@dsyer
May 03 2016 08:13
Weird but true. I guess I'll never understand the servlet request API.
Fixed now in master anyway
Bhuwan Prasad Upadhyay
@devbhuwan
May 03 2016 08:33
This message was deleted
nurgasemetey
@nurgasemetey
May 03 2016 10:00

Hello,
I am facing with strange issue.
I am using this guid -> https://github.com/spring-cloud/spring-cloud-dataflow-samples/tree/master/streaming/http-to-mysql
I created my database as shown in picture

alt

I get this error:

org.springframework.messaging.MessageHandlingException: error occurred in message handler [jdbcMessageHandler]; nested exception is 

org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [INSERT INTO names(name) VALUES (?)]; nested exception is 

java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: NAMES
Dave Syer
@dsyer
May 03 2016 10:12
I guess you didn't configure the database url properly

From the README:

If MySQL isn’t running on default port on localhost or if you need username and password to connect, use one of the following options...

nurgasemetey
@nurgasemetey
May 03 2016 10:13
Yeah I did it like this
stream create --name mysqlstream --definition "http --server.port=8787 | jdbc --includes='mysql:mysql-connector-java:5.1.37' --spring.datasource.url='jdbc:mysql://localhost:3306/test' --tableName=names --columns=name --spring.datasource.driverClassName=com.mysql.jdbc.Driver --initialize=false --spring.datasource.username=root " --deploy
Dave Syer
@dsyer
May 03 2016 10:14
I don't see a password
nurgasemetey
@nurgasemetey
May 03 2016 10:14
It has empty password
Dave Syer
@dsyer
May 03 2016 10:14
Also you would have to ensure that the mysql server is configured to accept JDBC connections.
Can you connect to it with a Java client, like H2 console?
nurgasemetey
@nurgasemetey
May 03 2016 10:15
Thanks, I will try it.
Dave Syer
@dsyer
May 03 2016 10:15
Also I don't think the default is empty, I think it's null
So you might have to set the password as well
nurgasemetey
@nurgasemetey
May 03 2016 10:16
Ok.
nurgasemetey
@nurgasemetey
May 03 2016 10:26
I was able to access my database via H2 console.
Also I set password to my database
Yet that stream gives the same error
The end of log:
Dave Syer
@dsyer
May 03 2016 10:29
Do you have up to date snapshots for everything?
nurgasemetey
@nurgasemetey
May 03 2016 10:31
Ok I will provide now

H2 console snapshot:

alt
Full error log

I added full error log at the end
Dave Syer
@dsyer
May 03 2016 10:35
It's not saying anything we don't know
"user lacks privilege or object not found"
So you haven't authenticated with that database
or you have and the table is not accessible
Did you grant read privileges to the "root" user?
Can you see the data in that H2 console?
nurgasemetey
@nurgasemetey
May 03 2016 10:38
Yeah I see root can read and insert
alt
Dave Syer
@dsyer
May 03 2016 10:38
I guess it might be a bug in the jdbc sink then
Please just raise an issue in github
nurgasemetey
@nurgasemetey
May 03 2016 10:38
I guess cloud data flow can't find driver on path or smth
Ok I will do it
Dave Syer
@dsyer
May 03 2016 10:39
The driver must be there or you wouldn't get that far
The dataflow server is running on localhost, right?
nurgasemetey
@nurgasemetey
May 03 2016 10:39
Yeah
nurgasemetey
@nurgasemetey
May 03 2016 10:50
This message was deleted
Matt Benson
@mbenson
May 03 2016 16:43
@dsyer confirmed ResourceController is WFM now. Thanks for opening that back up!
Dave Syer
@dsyer
May 03 2016 16:46
No prb
Donovan Muller
@donovanmuller
May 03 2016 19:07
@dsyer As discussed here, I've submitted spring-cloud/spring-cloud-bus#34 for @RemoteApplicationEventScan
Let me know if I'm on the right track and I'll add to the docs...
Dave Syer
@dsyer
May 03 2016 19:23
Thanks
KenavR
@KenavR
May 03 2016 19:39
Hi, I am trying to structure my app using microservices, I have a Eureka instance and register clients with @EnableDiscoveryClient. The eureka server endpoint tells me that the service is successfully registered, but when I try calling the service with a RestTemplate I get java.net.UnknownHostException: My-Service. Does anyone have an idea what could be the issue?
Jacques-Etienne Beaudet
@jebeaudet
May 03 2016 19:52
I'm trying to override the managed aws sdk version in my application, I have my own parent pom who's parent pom is spring-cloud-starter-parent Brixton.RC2. I tried to override aws-java-sdk.version in the properties of my parent pom but it doesn't seem to work. Is it possible to exclude a certain dependency pom?
I don't have any dependencyManagement in my parent pom
Dave Syer
@dsyer
May 03 2016 20:36
You need to provide your own bom and/or define that property in a parent Pom if you want to use property overrides
I don't think the cloud parent has properties like that
John G
@jgolubenko
May 03 2016 20:39
@KenavR how do you get your RestTemplate ? You using @Autowire straight out, or you configure it by hand in some way?
KenavR
@KenavR
May 03 2016 20:40
@Autowired @LoadBalanced protected RestTemplate restTemplate;
Jacques-Etienne Beaudet
@jebeaudet
May 03 2016 20:41
@dsyer thx again for the help
John G
@jgolubenko
May 03 2016 20:46
@KenavR and your eureka.client.service-url.defaultZone set to what?
as well as eureka.client.fetch-registry set to true?
KenavR
@KenavR
May 03 2016 20:54
default zone isn't set, fetchregistry ist false
This message was deleted
eureka:
  instance:
    hostname: localhost
  client:
    registerWithEureka: false
    fetchRegistry: false
  server:
    enable-self-preservation: false

server:
  port: 1111
ups
that's the server config
fetchregistry sin't set on the clients, will try it with true
defaultzone is defaultZone: http://localhost:1111/eureka/ which is correct
John G
@jgolubenko
May 03 2016 20:58
If I remember correctly @EnabeLoadBalanced underneath will use Ribbon auto-configuration?
So if you havigate to http://localhost:1111 you see both your application registered and your client (that is using RestTemplate) registered there?
also is server: port: 1111 in Eureka config?
KenavR
@KenavR
May 03 2016 21:03
yes, localhost:1111 shows me the service that uses the resttemplate
John G
@jgolubenko
May 03 2016 21:04
While you are looking at Eureka's default page http://localhost:1111/ you should see your service registered and you should be able to click on the link on the right-hand side and go to that application w/o errors.
KenavR
@KenavR
May 03 2016 21:04
the class that uses the resttemplate is a mvc controller
John G
@jgolubenko
May 03 2016 21:05
localhost:1111 should show your default Eureka page.
KenavR
@KenavR
May 03 2016 21:05
it does, and if I click the RPC links to the registered services I see an empty json object
John G
@jgolubenko
May 03 2016 21:07
Alright, so far so good. Now, have you tried your client with fetch-registry : true ?
KenavR
@KenavR
May 03 2016 21:08
does it matter if I use "fetchRegistry" or "fetch-registry"?
Dieter Hubau
@Turbots
May 03 2016 21:08
it should not matter, Spring boot can handle fetchRegistry or fetch-registry or fetch_registry IIRC
KenavR
@KenavR
May 03 2016 21:09
I used "fetchRegistry" and sadly it doesn't work
John G
@jgolubenko
May 03 2016 21:09
Another thing I'd try is to get rid of @LoadBalanced annotation and try w/o it.
KenavR
@KenavR
May 03 2016 21:09
ok. I tried @autowired the constructor in the past and that didn't work, but I will try it again
John G
@jgolubenko
May 03 2016 21:09
fetchRegistry/fetch-registry/fetch.registry/FeTCH_REGISTRY all the same to spring, it tries them all
KenavR
@KenavR
May 03 2016 21:15
sadly the exception remains
John G
@jgolubenko
May 03 2016 21:16
I'll send you bare minimum app that uses RestTemplate like you want, give it a shot
KenavR
@KenavR
May 03 2016 21:16
amazing thanks
@KenavR launch eureka first, then date service and then hello world client app that has RestController which has @Autowired RestTemplate
it's a bare minimum app really, you should be able to compare with what you have and figure out what is different between the two as far as config goes.
KenavR
@KenavR
May 03 2016 21:31
thanks will take a look at it
KenavR
@KenavR
May 03 2016 22:04
I won't get that working today (past midnight), but thanks will come back if I can't get it working