An overview of Locke's problem with the inconsistency of the notion of substance. Locke claims we are like "little children" when we speak of substance; we have no idea what we are talking about. In this, I think Locke is essentially correct. However, rather than embrace the idea that substance is nonsensical, Locke agonizes over what he sees as its indispensibility, in spite of its incoherence and inconsistency, and in the end he stickes with it, even though he does not consider it a coherent idea.
If asked to explain the nature of this substratum, most people will be unable to say much more than something like: "You know, its the matter, the stuff." But just what is this "stuff"? Can we define it? Understand it? Know it? Locke says no to all these questions, calling the idea of substance "obscure" (II.23.1-3). Yet, he ends up using this confused notion himself, insisting that we can know that there must be some substance underneath it all, though we can have no further knowledge of it at all (II.23.15,29). So how can Locke claim that an idea is obscure and undefinable, and then go ahead and unabashedly help himself to it? To evaluate Locke's position, we need to take a closer look at what an "idea" and a "quality" are.
Complex ideas are combinations of simple ideas (II.2.2). My idea of apple includes the simple idea of redness, but also many other simple ideas of taste, et cetera. We can combine simple ideas by simply conjoining several together; we can compare ideas and form relations between them; we can compare ideas and sort similar ones into groups, each of which is a "kind" or "species" of thing. This last way of forming complex ideas is "abstraction", and this is what we are doing when we give a name to a substance, like "apple" or "gold" (II.12.1-2,III.6.1).
One might think that if primary qualities cause simple ideas, then "secondary qualities" ought to cause complex ideas, but this is not what Locke is saying at all. Only primary qualities are really out there. Most simple ideas, like colour, do not correspond to a single primary quality. Colour, although it is uniform and immediate in perception, is not caused by anything in the real world bearing any resemblance to it. One has to go below the level that our senses can deal with (for instance, the level of atoms) to find the primary qualities that act together to form the simple idea of colour. Acting together, these objectively existing primary qualities can be called a "secondary quality". Secondary qualities do not exist out there in the world: they are subjective, not objective. Both primary and secondary qualities act on our senses to produce in us simple ideas, which can then be built up through reflection into complex ideas.
There are relatively few primary qualities. Most qualities of an object are secondary, and built up from a relatively small set of primary qualities. The important ones that Locke mentions are: extension, solidity, shape and motion (although I do not think he was trying to be especially dogmatic about it--if he were alive today, I suspect he would do away with some of these and replace them with things like electric charge). Some secondary qualities are colour, taste and smell, but there are many more. Why Locke chooses the particular qualities he does as primary, and whether he is justified in his choices, is debatable, but this question is not important for our concerns. What is important to us is that Locke does believe that there are some qualities that are primary and that real substances out in the world really do have them--they are not just constructions in our minds.
Most of us suppose there to be some kind of something, a substratum, that underlies this collection of qualities, since we cannot imagine how these qualities could subsist in the world all on their own (II.23.1). This is the idea of "pure substance", which seems, at first blow, like a very common-sensical idea. There must be something that is yellow and hard out there, not just yellowness and hardness floating about by themselves. What would it even mean, we can imagine Locke asking himself, for there to be qualities out there without something that has them? It seems nonsensical, so Locke assumes there must be pure substance. But, says Locke, this is actually a completely empty idea (II.23.2). How, in fact, would you define such a thing? Any description you could come up with would have to be in terms of things understandable to the mind (i.e., ideas), which must be based on experience, via sensation and reflection. So any comprehensible description of pure substance must be in terms of primary qualities: external "powers" to produce ideas in us. But of course this cannot work, since the whole idea of "pure" substance is that it is the thing itself that has all these qualities in the first place. Hence, we seem doomed in any attempt to define the notion. We are speaking, says Locke, like little children when we talk about pure substance. We have no idea what we are talking about.
Motion and duration, like existence, are also simple ideas that apply to substances and that we experience directly (II.23.17-18). But neither existence nor motion nor duration can be understood any further than this. Their true natures--the primary qualities that conspire to generate them in us--remain completely mysterious.
It is existence, however, not motion or duration, that seems essential to substance. Locke contrasts complex ideas of substances (i.e., existing things) with "modes", complex ideas that do not include any supposition of existence: such as beauty, triangle and gratitude (II.12.4-6). One could imagine having a substance that cannot move, but it is hard to imagine what a substance would be that did not exist. It is not clear to me the extent to which substance and existence are supposed to be distinct ideas for Locke; the way he describes them, they seem to amount to the same thing. Existence proves substance, and a substance is defined as that which includes existence.
Perhaps Locke talks about existence as a simple idea apart from substance because he wants to use it as a proof of substance. First, he tells us that the idea of pure substance cannot be had by sensation or reflection, which are the ultimate sources of all our ideas (I.4.18). This is why it is confused, and not really an idea at all. Then he turns around and tells us that existence is directly known though sensation and reflection, and this proves that there is substance, which is defined as that which has existence (II.12.6). We know there are substances, though substance is not a coherent idea, because of our direct perception of the idea of existence. If this is what Locke is up to, it will not help him out of his dilemma one whit. For if a substance is defined as an existing thing, pure substance and existence are the same idea, or at the very least, if the idea of pure substance is empty and confused, then so must be the idea of existence.
So why assume they exist in the first place? If a thing can be completely described in terms of its power to affect us, without reference to underlying substance, why assume that the underlying substance exists? Locke's justification seems weak: that existence is evident to us. But what if this existing "thing" is simply the collection of qualities and nothing more? Locke does not seriously consider this possibility. Why could an external object not simply be a collection of qualities? He says that we cannot imagine these things subsisting by themselves (II.23.1). But if substance is an incoherent idea, or not even an idea at all, then we might as well imagine the qualities by themselves as to imagine this something we-know-not-what that Locke himself admits is nothing.
This essence is the "nominal essence", since it is only in our perceptions and not the world. But it is the only essence of anything that we can ever know. Any "real essence" in terms of insensible primary qualities is completely unknowable by us, if there is any such thing (perhaps God knows of it). It is the grouping of qualities into essential and accidental that gives us abstract ideas. Without abstraction, each object would just be an individual with all its qualities essential. There would be only individuals in the world, no kinds of things. But it is even worse than this. Locke points out that it is more correct to say that the qualities would all be accidental, not essential, since without the ability to sort qualities into groups, we cannot even have individual substances. There is no way to individuate an apple from a lump of gold unless we suppose that the apple is an instance of the species apple and the lump of gold is an instance of the species gold (again, this would be so even if there were only one apple in the universe). Without abstraction, which is purely in the mind, there is nothing left to justify grouping the qualities of the apple together, unless it be some unknown "real essence". All we can know of the real essence, says Locke, is its being: that it exists. So "real essence" turns out to be another name for whatever it is "existence" applies to (i.e., pure substance). They are all alike unknowable and undefinable.
So this is the world Locke is facing if he does not posit substance: a world full of accidental properties. The best we can do is list them all in a huge unsorted list. We cannot group them or make any structure or order out of them at all. Without some unknown thing we-know-not-what, we cannot know anything at all. It is a classic metaphysical dilemma that Locke does not really tackle head on. He seems to simply accept that the idea of substance is a necessary evil.
Locke, as we have seen, recognizes the problem. Yet he tries to say that there must nonetheless be pure substance. Perhaps Locke was more or less aware of the disturbing consequences of accepting the logical conclusion of his argument against substance. He could take approach #2 and declare there is no such thing as substance, but then he would be left with no world at all. He could take approach #1 and declare that qualities exist out there in the world, but that substances are nothing more than these qualities. But, as we saw in the previous section, without substance (of type #3), there are no individual, separate things nor kinds of things--only one big soup of accidental qualities. This means, as Parmenides recognized, that in fact there is only one existing thing, one substance (of type #1) consisting of all qualities. This erases all structure or order to the world, and no doubt would seem to Locke no better than approach #2, where there are no substances at all. Approach #1 yields one solitary unstructured substance (which is hardly consonant with Locke's, or most anybody's, idea of substance). Approach #2 yields no substances at all. Approach #1 is absurd, approach #2 unthinkable, so Locke is forced to take approach #3, in seeming contradiction to his many statements of the utter meaninglessness of substance.
But Parmenides himself chose approach #1. How did he explain the ideas of existing things in his mind? Parmenides' explanation was that the apparent existence of individuated substances is only a subjective illusion. It is a feature of our minds (which are themselves part of the huge soup of accidental qualities and so are not objectively individual substances either). So-called external objects "exist" only subjectively (at least as individual things apart from all the other possible groupings of qualities). My point here is not to defend Parmenides at any length, but to simply point out that a defence of approach #1 is possible, and Locke may have been too hasty in dismissing it. The position Parmenides took is often called "idealism", since it views everything in terms of ideas, rather than some underlying substance. Berkeley , for instance, dispensed with material substance, although his "idealism" was impure, as he maintained spiritual substance. But the Absolute Idealists (such as Fichte, Hegel and Bradley) took a hard-line Parmenidean position, maintaining that only ideas are real, and dispensing with independent material and spiritual substances. In the twentieth century, idealism fell out of favour, but recently seems to be making a comeback .
Idealism seems in accord with Locke's ideas of secondary qualities, which he says do not exist in the objects themselves (i.e., they are merely subjective). So Parmenides and his modern-day equivalents, beginning with Berkeley, are essentially eliminating Locke's notion of primary qualities. With only secondary qualities, there is no reason to wonder about real essences or pure substance. But before you criticize Locke too thoroughly, consider the consequences of the alternatives. Unless you are prepared to defend the idea that the real world either does not exist or has no particular structure, do not criticize Locke's inconsistency too loudly, for you may quickly find that you are trapped in one of your own.
Locke argues that the essence of a person does not include substance. A person is not a substance. The essence of a person is the consciousness, and only the consciousness, of that person (II.27.7-10). The consciousness depends on the "organization" of the thing, and not one bit on its matter or substance. A "man" Locke defines as organization plus a complex of material and spiritual substance (rather arbitrarily defining it so, as he himself admits). He defines man-made machines similarly. So the "man", or the "watch", depends on a material substratum  (II.27.4-7). But the "person"--that which includes one's identity--is completely independent of the particular substance: it is nothing but a certain organization that is consciousness. This means that the same body (i.e., substance) could potentially house different persons at different times, and the same person could theoretically be housed by different bodies at different times (II.27.10). This was probably shocking in Locke's time, but it is widely held by many today, some of whom would apply the same "organization-only" definition to what have been traditionally thought of as substances.
So is Locke not creating a new substratum, of which there are now three: matter, spirit and organization? Perhaps some twentieth century idealists would interpret it that way, but Locke would never view it like that. The organization that makes a person the person they are is a nominal essence, not a real one. While the idea of personhood relying exclusively on nominal essence is itself perhaps a radical thing for Locke to be claiming, it does not require him to declare that substances like "man" are also nominal in the same way. "Person" may be nominal, but it is always instantiated in some kind of body with a material substratum. But perhaps Berkeley was influenced by Locke's "subjectification" of personhood, and it spurred him on to subjectify everything.
In other places, Locke really seems to want to dispense with substance as a total non-idea. In the end, we can only say that Locke saw the basic problem in outline, but did not explore it in full. Perhaps he had some inkling of the horrors of Parmenides' alternatives, and just decided it was acceptable to admit substance, yet declare it as utterly unknowable. Perhaps he even recognized it as inconsistent, but just figured that it would have to do, at least for now. After all, his primary concern was to explore the limits and nature of human knowledge, not to judge how the world ultimately is. That, declares Locke, we must leave to God and the Angels.
 I use Locke's term "subsist" here instead of "exist", since Locke reserves existence for material and spiritual things, and not "modes" (collections of qualities without substance), which do not have existence.
 If mental phenomena are ultimately just caused by material things, we can say that what Locke calls "spirits" are just another example of "matter" and it will not seriously affect this discussion, since Locke himself states that, for all we know, mental phenomena could be caused by matter, since both kinds of substance are equally unknowable (II.23.5,16). For the purposes of this paper, I will often just say "matter" as short for "matter and/or spirit".
 I am converting Parmenides' language into Locke's terms, but it is easily converted back into Eleatic terminology. It was Parmenides who first laid out the basic issues of metaphysics. The history of metaphysics is largely a history of the attempt to coherently defend one of the three approaches, usually but not always #3. See: Parmenides. On Nature, A.F. Randall (Ed.). http://www.io.org/ ~randall/Parmenides, c. 475 BC, 1996.
 George Berkeley. A Treatise concerning the Principles of Human Knowledge. Three Dialogues between Hylas and Philonous. Open Court, La Salle, Illinois, 1710, 1713, 1962.
 For an example of contemporary anti-realism, see: Hilary Putnam. "Why There Isn't A Ready-Made World," In: Reality in Focus, P.K. Moser (Ed.), pp. 34-49, 1983. A lot of current anti-realist and idealist positions are motivated by results from quantum physics. For an excellent introduction, see: N. Herbert. Quantum Reality. Anchor Press/Doubleday, Garden City, New York, 1985.
 Of course, the particles in a man's body are gradually being replaced, but Locke feels the existence of the man is still dependent on the particles of matter so long as they are in the "same successive body not shifted all at once" (II.27.8).