joseph Williams

Greenhorn
+ Follow
since Jul 14, 2014
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by joseph Williams

Thank you very Much! That should work!
8 years ago
Hey!

So I am having a slight issue with my restful webservice taking Json. It takes the Java object as a good request but every time I use Json it gives me a 400 bad request.

Here is my test class:


You can see in the comments that I tried the object with a "createUser()" and that gave me no problems and put something in the DB. But Json just wont work.

Below is the Webservice Object:


Here is the webservice endpoint:


Here is the Jsons I have tried:

{"Users":["position": 2, "formula": "sadasd","userId": 3 ,
"firstName": "", "lastName": "", "userName": "",
"password": "", "userSocialAccounts": true, "userPrivacy": "",
"email": "", "bio": "", "profilePicUrl": ""]}

and

{"Users":{"position": 2, "formula": "sadasd","userId": 3 ,
"firstName": "", "lastName": "", "userName": "",
"password": "", "userSocialAccounts": true, "userPrivacy": "",
"email": "", "bio": "", "profilePicUrl": ""}}

and

{"position": 2, "formula": "sadasd","userId": 3 ,
"firstName": "", "lastName": "", "userName": "",
"password": "", "userSocialAccounts": true, "userPrivacy": "",
"email": "", "bio": "", "profilePicUrl": ""}
8 years ago
The Application Context wasn't working for Jack so I just used a java bean class to get it to map correctly.
8 years ago
I can't for the life of me get my maven project to create my bean for mongoTemplate for Autowiring. Can someone help this poor soul of a programmer?
Here is the error I keep getting:


Here is the applicationContext that is stored in my src>main>resources>Meta-inf folder:



Below is the class that I am trying to autowire this bad boy in. Pretend that It says MongoTemplate instead of MongoOperations. I tried two ways...
one to autowire and the other to just get it through a context and neither are working:



I even tried to do a application config java class to get the mongotemplate set. Which explains the MongoOperations I was trying to use:


On last thing I was going to try but stopped because I didn't know how to set the host and all the stuff doing it this way:


^I looked at so many examples and still can't get this thing to autowire in so I can connect to my mongodb. If you have any questions please ask. I can autowire everything else in my project but I can't seem to get this mongoTemplate to follow suit.
8 years ago