Following the documentation at Boundary Value Problems · DifferentialEquations.jl your implementation should probably look like
using DifferentialEquations
E = 200e9 # Pa
A = (0.01)^2 # m^2
L = 2 # m length beam
b = 1000 # N/m
P = 250 # N
EE(x) = E
AA(x) = A
bb(x) = b
function diffeq!(dy,y,p,x)
dy[1] = y[2]/(EE(x)*AA(x))
dy[2] = -bb(x)
end
function bc!(residual,y,p,x)
residual[1] = y[1][1] - 0
residual[2] = y[end][2] - L
end
bvp = BVProblem(diffeq!, bc!, [0,0], (0.0,L))
sol = solve(bvp, GeneralMIRK4(), dt=0.05)