5 Replies Latest reply on Jul 21, 2014 3:33 PM by pferraro

    Wildfly 8.1 and Infinispan class path during start up (multi module ear) - Class not found

    javapapo

      Hello I have the following issue. I am trying to deploy a multi-module ear application

       

      MyAppEAR

      • ejb-jar-cache.jar
      • ejb-services.jar
      • common-services.jar
      • rest-war.war

       

      My ejb-jar-cache is a top level ejb jar deployment that actually uses Infinispan to initialize a cache manager , currently using a @Startup EJB

       

      @Singleton
      @Startup
      @Lock(LockType.READ)
      public class CacheInitializer {
      
      
          private static final Logger logger = LoggerFactory.getLogger(CacheInitializer.class);
      
          private EmbeddedCacheManager manager;
      
          private BasicCache<String,Object> environmentCache;
        
          @PostConstruct
          private void createManager(){
      
              try{
                  manager = new DefaultCacheManager("infinispan-config.xml");
        
      
      
      
      
      
      

       

      I am not not bundling any Infinispan jars along, my dependency is set to provided

       

      <dependency>
                  <groupId>org.infinispan</groupId>
                  <artifactId>infinispan-core</artifactId>
                  <scope>provided</scope>
      </dependency>
      
      
      
      
      
      

       

      I am also bundling within the ejb-jar-cache.jar (within the META-INF) a jboss-deployment-structure.xml


      <jboss-deployment-structure>
            <deployment>
                <dependencies>
                    <module name="org.infinispan.commons" export="TRUE" />
                    <module name="org.infinispan" export="TRUE" />
                </dependencies>
            </deployment>
      </jboss-deployment-structure>
      
      
      
      
      
      

       

      Question1: It is the following xml right? I am not sure if the meta-inf property or the export="TRUE" should be used

       

      Question 2: It seems that Wildfly 8.1 does not pick this up.

       

      Error getting reflective information for xxxx.impl.CacheInitializer with ClassLoader ModuleClassLoader for Module \"deployment.eBanking-ear.ear.eBanking-cache.jar:main\" from Service Module Loader
          Caused by: java.lang.NoClassDefFoundError: org/infinispan/manager/EmbeddedCacheManager
          Caused by: java.lang.ClassNotFoundException: org.infinispan.manager.EmbeddedCacheManager from [Module \"deployment.eBanking-ear.ear.eBanking-cache.jar:main\" from Service Module Loader]"},
          "JBAS014771: Services with missing/unavailable dependencies" => [
      
      
      
      
      
      

       

      Any help or tips would be greatly appreciated? I am actually trying to port from Websphere to Wildfly so..it is for a good cause . Eventually the above setup in Websphere (but with infinispan bundled in the ear) works.

       

       

      UPDATE (could not add reply)

      The jboss-deployment-descriptor did not work unfortunately, either placing it in the EAR level or in the EJB-jar level. Only by updating the generated MANIFEST of the ejb-cache, using the following maven config, I was able to make Wildfly during deployment to pick up my infinispan class /config

       

      <plugins>
                          <plugin>
                              <groupId>org.apache.maven.plugins</groupId>
                              <artifactId>maven-ejb-plugin</artifactId>
                              <configuration>
                                  <archive>
                                      <manifestEntries>
                                          <Dependencies>org.infinispan export</Dependencies>
                                      </manifestEntries>
                                  </archive>
                              </configuration>
                           </plugin>
                      </plugins>
      
      

      Is the jboss-deployment-descriptor fully supported in Wildfly81 or my xml was sort of invalid? There are a lot of references out there about it. has anything changed with the latest version of the server?