1 Reply Latest reply: Aug 29, 2012 10:50 AM by 958805 RSS

    Why can't my EJB see common files inside war file?

    920906
      My DataProcessorBean packaged in an ear file can't find a local class(JDomUtils) during runtime.
      It compiles fine, it's accessible in my IDE, and I can see it also in the war file contained in the ear but getting this error.

      Caused by: java.lang.NoClassDefFoundError: Lcom/app/util/xpath/JDomUtils;

      Any suggestions?
      -----------------------------------------------------------------------
      DataProcessorBean.java
      import com.app.util.xpath.JDomUtils;
      public class DataProcessorBean implements SessionBean {

      SessionContext sessionContext;
      private JDomUtils domUtils;

      -----------------------------------------------------------------------
      JDomUtils.java Found inside: app.war\WEB-INF\classes\com\app\util\xpath\JDomUtils
      package com.app.util.xpath;

      public class JDomUtils {
      public JDomUtils() {
      }

      Edited by: 917903 on Aug 16, 2012 2:18 PM
        • 1. Re: Why can't my EJB see common files inside war file?
          958805
          If I got you right your EJB is packaged in the jar which is in ear.
          Your util-class is in war which is in ear too.

          In such case you can't get access from Bean to Util class because of classloaders rule.

          Possible solution is to move your Util class to APP-INF\lib. In such case it will be shared by all the modules that you have in your ear.

          Edited by: 955802 on Aug 29, 2012 8:50 AM