I have troubles to use `NLsolve`

package for solving the following simple scalar example:

```
0 = cos(x)
```

for `x`

initialized to, say, 1.5 (the anticipated solution is thus pi/2, that is, something like 1.57). The code is

```
julia> using NLsolve
julia> function f!(r,x)
r = cos.(x) # x (and r) are expected to be vectors, hence the broadcasting
end
f! (generic function with 1 method)
julia> function j!(J,x)
J = -sin.(x)
end
j! (generic function with 1 method)
julia> sol = nlsolve(f!,j!,[1.5])
Results of Nonlinear Solver Algorithm
* Algorithm: Trust-region with dogleg and autoscaling
* Starting Point: [1.5]
* Zero: [1.5]
* Inf-norm of residuals: 0.000000
* Iterations: 0
* Convergence: true
* |x - x'| < 0.0e+00: false
* |f(x)| < 1.0e-08: true
* Function Calls (f): 1
* Jacobian Calls (df/dx): 1
julia> sol.zero
1-element Array{Float64,1}:
1.5
```

Not even a single iteration is run. What am I doing wrong? Thanks in advance.