Yes, you can, but since Infinispan uses different JGroups jar libraries to the ones shipped by these application servers, you need to make sure that the code using Infinispan, and the Infinispan libraries, are deployed in an isolated WAR/EAR. Information on how to isolate deployments can be found in:
Apart from isolating your deployment, you can use Maven's Shade plugin to build Infinispan and all its dependencies in a single jar, and then shade the library that might clash with the one in the app server. For example, to shade org.jgroups, you'd build Infinispan with:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>org.jgroups</pattern>
<shadedPattern>org.shaded.jgroups</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>