It sounds like a charge can be justified as the police probably have probable cause to believe the drugs were yours. The trespassing/breaking and entering sounds less justifiable if the homeowner asserted you were a guest. You certainly have defenses to the drug charge and the facts as you describe would probably lead to the drugs being suppressed or put on another person other than you. You must find a lawyer to assert your defenses. Call for more info. Good luck.
Much more information is needed to fully answer the questions. You need an experienced criminal defense attorney ASAP. From your post the State will have a hard time proving a case against you. But they certainly may try. The search of the roommates area and the search (other than looking around) of the apartment are unconstitutional base on your post. But the cops may say they didn't know who you where, you could be a burglar, and they were checking for signs of burglary. Why they looked in the box may depend on where it was located. Call with more information.
Based on your facts, the State would have a difficult time proving its case against you. However, that often does not prevent them from trying. The best thing you can do is hire a lawyer ASAP to begin asserting your defenses and protecting your interests. There are steps that should be taken sooner rather than later to strengthen your defense and to try to resolve your case.
Consult a New Jersey lawyer. From your account, it sounds as though the search may have been unlawful.
IMPORTANT: Mr. Murray's response is NOT legal advice and does NOT create an attorney-client relationship. You should NOT rely on this response. Mr. Murray's response was generated without conducting a full inquiry as would occur during an attorney-client consultation. It is likely that the response above may be made less accurate, or become entirely inaccurate, as you, i.e. the questioner, disclose additional facts that should only be discussed during a private attorney-client consultation. I strongly recommend that you consult an attorney who is licensed to practice law in your state (or, in the case of immigration law, an attorney in ANY state), whereupon all relevant facts will be discussed. All responses posted by Mr. Murray on Avvo.com are intended as general information for the education of the public, and not for any specific individual. For persons located in New Jersey: To the extent that Mr. Murray's profile can be considered an advertisement in New Jersey, which is denied, be advised that NO ASPECT OF THIS ADVERTISEMENT HAS BEEN APPROVED BY THE SUPREME COURT OF NEW JERSEY. Furthermore, the selection methodology for the SuperLawyers' "Rising Stars" awards is set forth at length at this website: http://www.superlawyers.com/about/selection_process.html.
Because they searched without a warrant or permission, Iyou have a very good defense. Plead "not guilty" and get yourself an attorney or public defender.
Please be advised my answers to questions does not constitute legal advise and you should not rely on it, due to the fact that we have never met, I have not been aprised of the facts in you case nor have I reviewed any documents.
They can charge you with these offenses but from your version of the facts you have valid defenses to all the charges. You need to hire a criminal defense attorney right away.
This answer does not constitute legal advice, create an attorney-client relationship, or constitute attorney advertising.