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.
<dependencies>
<dependency>
<groupId>org.glassfish.extras</groupId>
<artifactId>glassfish-embedded-all</artifactId>
<version>3.1.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
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 :-)".
Posted at 12:22PM Nov 13, 2011 by Adam Bien in Real World Java EE Patterns - Rethinking Best Practices | Comments[4] | Views/Hits: 4405
NEW Workshop: "JPA, NoSQL, Caching, Grids and Distributed Caches with Java EE 7", May 7th, 2013, Airport Munich
A book about rethinking Java EE Patterns
Tweet Follow @AdamBien

Perfect solution, thanks a lot! :)
Posted by Al on May 22, 2012 at 12: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 08:07 AM CEST #
Hi,
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 02:55 PM CEST #
hi
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 11:01 AM CEST #