2 Replies Latest reply on Apr 13, 2015 7:46 AM by Stefan Nägele

    EJB Packaging ModeShape

    Stefan Nägele Newbie

      Hi,

       

      currently, I try to package my JCR ModeShape functionality into an EJB .jar archive to upload it into my nexus and reuse the functionality in other (.war) applications via Maven.

       

      First of all, I used my JCR Modeshape calls within a usual .war application, as described in https://docs.jboss.org/author/display/MODE/Using+Repositories+with+JCR+API+in+EAP#UsingRepositorieswithJCRAPIinEAP-DeployingJCRwebapplications,

      Deploying JCR web applications. 

      I created a jboss-deployment-structure.xml in webapp/WEB-INF and everything worked fine.


      Now, when I changed my packaging to EJB and removed my webapp folder (because it is no longer a web module), added it to my separate .war project (with a jboss-deployment-structure.xml), getting a Repository throws an error.


      Repository repository = (Repository) context.lookup(jcrRepository);

      java.lang.ClassCastException: org.modeshape.jcr.JcrRepository cannot be cast to javax.jcr.Repository

       

      What kind of deployment descriptor or other meta data could be missing, to reuse my ModeShape calls from an external EJB .jar within a separate .war application?

       

      Kind regards,

      Stefan