I'm assuming you've tried the other battery and charger in the one that doesn't charge to eliminate that too.
Press and hold the connector into the laptop socket to see it it starts to charge. A common fault on some laptops is that the DC socket isn't secured by anything other than the soldered connections. Over time, these can get stressed and snap. The fact that it starts charging could be due to an intermittent connection. If this is the case, you would need to replace the socket, which isn't the easiest of tasks.