Adam Bien's Weblog

Sunday Nov 13, 2011

"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 :-)".



*NEW* Workshop: "Real World Java EE 6/7 Bootstrap" and book: Real World Java EE Night Hacks--Dissecting the Business Tier

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
Meta
My Recent Book
Java One 2009/2011
...the last 150 posts
...the last 10 comments
Links
License