Adam Bien's Weblog

"Sniffers with type [connector] and type [ejb] should not claim…" And Solution

The error:

"java.lang.IllegalArgumentException: Sniffers with type [connector] and type [ejb] should not claim the archive at the same time. Please check the packaging of your archive"

happens, when GlassFish doesn't know how to interpret a content of a deployment archive. The error is usually caused by wrong packaging of your archive.

I usually forget to set the scope (see bold tag below) in the pom.xml of the glasssh-embedded-all (needed because of Maven / Java EE 6 trouble), what causes the deployment of the whole embedded GlassFish with the WAR and the error above.


I would provide a error message like: "Deployment of servers inside WARs is unusual in Java EE 6 context and may result in not portable applications :-)".

NEW dates, new workshop: Java EE 7 Workshops: Bootstrap, Effective, Architectures, JavaScript Bootstrap and HTML 5 December, 7th-11th
NEW: Effective Java EE 7 -- Available For Streaming


A book about rethinking Java EE Patterns


Perfect solution, thanks a lot! :)

Posted by Al on May 22, 2012 at 02:09 PM CEST #

Thank you! I had updated my pom to pull the latest version of a glassfish jar rather than use the one on my machine and of course left out the "provided". Your blog has been very useful to me as I try to catch up with what Java has been up for the last 10 years....

Posted by Greg Cooper on August 14, 2012 at 10:07 AM CEST #

I am getting the below error :
" java.lang.IllegalArgumentException: Sniffers with type [connector] and type [web] should not claim the archive at the same time. Please check the packaging of your archive. ", while i am trying to deploy spring and Hibernate Application in Galssfish 3.1.2. My current project is not a Maven Project and its just a Java Web Application. Please help me in resolving this issue. If needed i can Post my Project.

Posted by Hemachandra on April 15, 2013 at 04:55 PM CEST #

In my case wht happend is i accidently embeded glassfish-jes.jar[im wrking for embeded servers] in my lib path .Once i remove the glassfish*.jar it is wrking fine

Posted by raju on April 23, 2013 at 01:01 PM CEST #

Thanks a lot! :-)

Posted by Laura on December 12, 2013 at 05:04 PM CET #

Thanks, solved my problem in no time!

Posted by jer on September 30, 2015 at 01:37 PM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
Online Workshops
...the last 150 posts
...the last 10 comments