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

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

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

Similar Messages

  • Why can't my code see annotations in a class file?

    So I have a JAR file with some classes in it. I have used DJ Java Decompiler to inspect the class in question and I can definitely see the annotations in it.
    I'm working on a Maven MOJO that reads the JAR files to find the annotations, but for some reason my code does not find any annotations at all. Does anyone have any ideas what the problem might be?
    The StreamLoader seems to be working because when I load the classes, their names get logged properly. Could there be something in the StreamLoader that is stripping off the annotations?
    Cheers, Eric
    try
        JarFile jarFile = new JarFile(artifact.getFile());
        Enumeration<JarEntry> jarEntries = jarFile.entries();
        while (jarEntries.hasMoreElements())
            JarEntry jarEntry = jarEntries.nextElement();
             if (!jarEntry.isDirectory() && jarEntry.getName().endsWith(".class"))
                getLog().info("jarEntry.getName() = " + jarEntry.getName());
                try
                 Class<?> entry = streamLoader.loadClass(jarFile.getInputStream(jarEntry));
                 getLog().info("entry " + entry.getName());
                 if (entry.isAnnotationPresent(DotNet.class))
                     getLog().info("including " + entry.getName());
                 DotNet dotNet = entry.getAnnotation(net.sf.jni4net.annotations.DotNet.class);
                 if (dotNet == null)
                     Annotation [] annotations = entry.getAnnotations();
                     for (Annotation annotation : annotations)
                         getLog().info("annotation " + annotation.toString());
                 else
                     getLog().info("including " + entry.getName());
             catch (Throwable t)
                 getLog().warn("can't find class " + jarEntry.getName());
    catch (IOException e)
        getLog().error(e.getMessage(), e);
    class StreamLoader extends ClassLoader
        public StreamLoader(ClassLoader parent)
            super(parent);
        public Class<?> loadClass(InputStream input) throws ClassNotFoundException
            try
                ByteArrayOutputStream buffer = new ByteArrayOutputStream();
                int data = input.read();
                while(data != -1)
                    buffer.write(data);
                    data = input.read();
                input.close();
                byte[] classData = buffer.toByteArray();
                return defineClass(null, classData, 0, classData.length);
            catch (MalformedURLException e)
                e.printStackTrace();
            catch (IOException e)
                e.printStackTrace();
            return null;
    }

    Yes.
    @Retention(value=java.lang.annotation.RetentionPolicy.RUNTIME)
    public @interface DotNet { }I am assuming that if it were not set that way then it would not show up in the class file at all - but I could be wrong.
    There are also other annotations with RetentionPolicy.RUNTIME, i.e. @ThreadSafe, but my code cannot see them either, even though the disassembler can see them.
    Cheers, Eric

  • Why can't anyone else see my Edge Animate html files in their browsers?

    I create this awesome file with bells and whistles and looks and runs great on mY computer and in mY browsers but when I send a client(s) the HTML file to view in their browser it NEVER works! Do I need to send them all the files? The image folder...the JS files and the HTML? I think I did that once and it still diodn't work...I understand that the browsers all dont play nice and that m os need to be updated on the client end but is there a good way to save the Animate file so that my clients can use the file to place in a website. I am creating small web ads.
    Thanks for all your help!
    Maria

    Do you have a website? If yes, you can load all your files at the root level and then you can send the link to your clients.
    It would go like this:
    http://www.yourWebsiteName.com/yourEdgeFolderName
    (I would name the edge files index rather than something else because most web server prefer that.)
    You could also create an html file with all your samples and iframes to load them. Then you need to put each edge folder at the root of your website.

  • Why can I no longer see CS6 in creative cloud

    Why can I no longer see CS6 to download in Creative Cloud?

    HI Intro,
    Once you will launch Creative Cloud Desktop you will get the option "Find new apps" and a drop down in front of it.
    On the Drop down menu you need to select "Previous Version".
    Once you do that you will get the option to download the Creative Cloud applications.
    Please check and let me if it works or not.
    Thanks,
    Ratandeep Arora

  • Why can I no longer see my img numbers on iphoto 9.4.1?  I need these numbers.  How do I get them back?

    Why can I no longer see my img numbers on iphoto 9.4.1?  I need these numbers.  How do I get them back?

    Under the view menu chech show title?
    LN

  • Why can't my computer see or find my ipod when i plug it in?

    why can't my computer see or find my ipod when i plug it in?
    so frustrating...

    See Here...
    Device Not Recognised
    For PC
    http://support.apple.com/kb/TS1538
    And Here
    iPhone, iPad, or iPod touch not appearing in iTunes

  • Reading an external text file in WAR file

    Greetings,
    I have a question. I have an web application that writes a text message and 0's and 1's based on checkboxes. Then I have a JSP that reads this text file and prints the message and enables/disables links based on the 1's and 0's. I don't have any problems with this when testing from localhost, but when I deploy to a server the application isn't reading the file. The text file and WAR file are in the same folder, same directory. I've tried using both relative and absolute paths to read the file, but to no avail. Is there an easy way to read an external file from a WAR file or is there an easier solution. Thanks
    Nick

    You should not try to force your text file to live in the same directory as the WAR file. Instead, you should remove that kind of dependency and instead be using something like System.getProperty("java.io.tmpdir") to use the temporary directory to create and delete these files.
    Edit: I also bet you don't even need to create & read a file here. You could probably store the information in one of the contexts of the web app, such as in a Session. I'll assume you know what that means.
    By creating a file, you are also running the risk of multiple threads (simultaneous users) vying for the same file name, thus walking on each other's data.
    Message was edited by:
    warnerja

  • Why can't i open my Panasonic Lumix FZ45 RAW files in CS3?

    why can't i open my RAW files?
    I have photoshop CS3 with camera raw plug-in 4.6.0.30 on MacBook Pro OS X Lion 10.7.5 (11G63) and a Panasonic Lumix FZ45
    I have checked the list of supported cameras and mine appears to be there.
    I have no available updates in photoshop so assume that I am up to date with those.
    Anyone have any ideas?
    thanks

    I have checked the list of supported cameras and mine appears to be there.
    Yes, the Panasonic FZ45 is listed but it was first supported by Adobe Camera Raw (ACR) 6.2.
    http://helpx.adobe.com/creative-suite/kb/camera-raw-plug-supported-cameras.html
    Then go to this table to see which versions of Photoshop are compatible with ACR 6.2: CS5 and later. Not CS3.
    http://helpx.adobe.com/x-productkb/global/camera-raw-compatible-applications.html
    So your options are to upgrade to CS6 or subscribe to CC (check out the Photoshop Photography Program: PS CC + Lightroom 5).
    Or download the free DNG converter, convert all your FZ75 Raw files to DNGs then open the DNGs in CS3
    http://www.adobe.com/products/photoshop/extend.displayTab2.html

  • Why can't I create a PDF from a Word file with your $9.99 monthly plan. I have done so before.

    Why can't I change a Word file to a PDF file with your $9.99 monthly plan? I have done so before.

    Firefox is a good browser, but it comes with its own PDF viewer, which may not display PDF files correctly.  See http://forums.adobe.com/thread/1158136
    If you want to continue to use Internet Explorer, you may want to lower its security settings; see http://windows.microsoft.com/en-us/Windows7/Change-Internet-Explorer-Security-settings

  • Why can my reciever not see my emoji symbols on the message that I send

    Why can people not see the emoji symbols on my texts that I send

    Are you using the standard emoji keyboard on the iPhone, or are you using some type of 3rd party application? Are the receivers of your message iPhone users? If they are not, it could be their phone cannot decode and display the emoji from the phone.

  • Why can't I hear the sound on a wmv file someone sent me?

    I can't hear the sound when playing a wmv file. Anyone know how to fix this?

    I would use VLC - http://www.videolan.org/vlc/download-macosx.html.
    Good luck,
    Clinton

  • Were can i found the bo sdk (i.e .war files) for java

    were can i found the bo sdk  code

    i think first of all i need to deploy the webservices on tomcat, and then i need to follow these steps i think
    To set up your web application
    Create the following directory structure in the web applications directory of your web application server:
    web_application_name
          WEB-INF
             lib
             classes
          crystalreportviewers
    Note: Replace web_application_name with the name of your web application. Your web application will be stored in the web_application_name directory. This is the root directory for the web application and contains all of the files that the web application needs. Your web application directory (web_application_name) should be located in the main web application's directory for your web application server (for Tomcat, this directory is typically called webapps).
    Directory Contents:
    The WEB-INF directory contains all of the support files required for your web application.
    The WEB-INF\lib directory contains all of the JAR files required by your web application.
    The crystalreportviewers directory contains all of the support files required by the viewers.
    Copy the support and library JAR files required for your web application into the WEB-INF\lib directory.
    For details on which JARs to deploy, see JAR files needed for deployment of Business Objects Software.
    Note: Copy the jar files from java\lib\external into WEB-INF\lib; do not copy to WEB-INF\lib\external.
    If you are using scheduling components or a report viewer in your application, deploy the CrystalReports.war file (\Program Files\Business Objects\BusinessObjects Enterprise 12.0\java\applications on Windows) with your web application.
    Create a web.xml file for your web application and save it in the WEB-INF directory (or modify an existing web.xml file if you are adding viewing capability to an existing web application).
    To learn how to set up the web.xml file, see Configuring your web.xml file.

  • Why can't I log onto a link inside my college website, for my online class

    Why can't I long onto to MoodleRooms through the Henry Ford Community College website link. I have an online class and I can't get in. I have logged on to this site on four different laptops, one including a public library and it's still not letting me log in. I thought it was my old laptop, but bought a brand new one two hours ago, and it's still not allowing me to log on. I can access all other links to other online classes through Ucompass link but not Moodlerooms.Please Help!

    Thanks Tyler, but today I learned from IT at the school, that it is a user authentication issue that's system wide. Thanks for your help

  • "Search in Files" inside .ini files

    I use the site search and search in file features in Dreamweaver quite often but I just discovered that if I have a folder full of .ini files and I need to search globally inside those files Dreamweaver returns no results.
    Apparently, DW is unable to search inside files other than HTML, PHP, CSS, JS, etc. But it won't search in .ini files or any weird (for DW) file extensions.
    I once was able to set up my DW to look inside PHTML files (Used by Magento) as well as applying code coloring to them as it would on PHP files.
    I suspect this is a similar process but I wanted to make sure I was not seeing things. Is DW really that dense that will not search inside a file with an extension it doesn't know?
    By the way, I did add .ini to the recognizable files in preferences, but obviously that's not enough to have DW search inside them.
    OFF TOPIC COMMENT
    Another weird thing I just noticed is that the "asset" and other modules will only work in WYSIWYG view. Meaning that if I save a color in my assets I cannot use it to insert it in a CSS file. Not even in code view. I have to be in the visual editor for it to work, but then it's useless to me.
    Incidentally, some time ago I found that the visual editor in DW is actually very useful when working with dynamic websites like Drupal or wordpress. Especially when dealing with very large pages with lots of CSS files.
    However, no one IO know would or should build their sites in the visual editor. It's simly a bad way to work. Why would adobe limit the use of the "assets" pane (and the "History pane too now that I remember)  to the visual editor is beyond me in this day and age.
    I do a lot of tasks where it would be greast to copy a procedure like a substiotution and have DW repeat the same procedure on other pages or similar code snippets. Yet, it won't alow me.
    I love Dreamweaver and I am actually writing a book on how to use it with the likes of wordpress, drupal, etc. It cuts dowen development and design time by less than a third. If those things worked everywhere instead of just in the visual editor it would cut down even more on the time it ntakes to design dynamic website templates.
    Sorry about the rant.
    Thank you for any help.

    Hi David, I too have worked closely on a lot of software projects and I am well aware of the limitations. In fact, that's one of the reasons I lioke to work on open source projects because of the vast talent pool they can utilize. Private companies, no matter how big, neet to triage new development according to their resources.
    By the way, adding the .ini files to the extension.txt files in Dreamweaver is pretty easy. Since code coloring is not an issue that's really the only change I need to make. When I integrated the PHTML file extension for Magento I had to make a lot more changes (still manageable though).
    One of your comments, about DW keeping its legacy features in a changing web development world, made me think that it may be time for Adobe to spawn a different IDE or start thinking about a more modular approach to the application.
    I am writing a book on Dreamweaver integration for Open Source web scripts and when talking to other open source developers, one thing that comes up often is that Dreamweaver is a "bloated" program  (this is not my complaint, by the way).
    Part of the issue is that it needs to keep a lot of quasi-obsolete features so that long time users won't abandon the platform. Which featrures are obsolete is really up to each user. For me the WYSIWYG view is certainly not something I would use to design web sites, but should Adobe get rid of it,  it would absolutely destroy my workflow since I use it to rapidly target HTML, CSS and even Core PHP code in the template and the file system of the scripts I work with.
    The new "Live view" in CS4 was a welcome addition, especially since the basic page rendering in DW leaves a lot to be desired (Incidentally Microsnot "Expression" page rendering is a lot better, making the live view feature less exceptional except when troubleshooting JS based effects).
    Anyway, that said, DW is an extensible program and there are a lot of thrid party utilities written for Dreamweaver. Couldn't the Adobe team use this extensibility to make improvements to the interface and even use it to add or subctract features from the main application?
    I think they are mising an opportunity here to capture a wider audience. DW could ship with a minimal set of features and the team could choose to release their own add-ons so that users could build their own application.
    I think that approach would silence a lot of critics, since the basic app would now be a lot slimmer, while still giving power and legacy users the features they need a-la-carte.
    I am actually hioping that once my book comes out (if it ever does: the publishing world moves at a snail's pace) it may give the DW team a new perspective on how to use Dreamweaver in a modern web development enviroment, but honestly my biggest hope is for one of the current open source projects like Eclipse to look at my development system and maybe add some Dreamweaver-like features so that finally there would be a real open source alternative to Dreamweaver. In turn, I believe that will make DW move a bit more quickly in adding new features and shedding the obsolete ones.
    Anyway, thank you again for the links, I did submit my suggestions. I am not holding my breath but we'll see.
    Take care

  • OAS 10.1.3 isn't detecting /WEB-INF/lib jar files within WAR file

    Hello,
    I have been developing and testing a simple non-EJB web application on Tomcat 5.5 with no class loading difficulties for the past several months. All of the needed JARs for my app are located under the WEB-INF/lib directory. My next task is to deploy the WAR file containing my webapp on the Oracle 10g (10.1.3) application server.
    The problem I am having when trying to do this is that when I deploy the WAR file from Oracle Enterprise Manager, the WAR file will expand correctly but at runtime OAS doesn't appear to be detecting the JAR files in the WEB-INF/lib folder of my WAR file. I have confirmed that the JAR files are indeed being expanded in the directory that OC4J expands the WAR file into:
    appserver/j2ee/home/applications/appEARFile/MyWebApp/WEB-INF/lib.
    But when I run the application, from the Firefox browser I immediately get the following 500 Internal Server Error:
    "Servlet error: Error instantiating servlet 'reports'. Servlet class org.springframework.web.servlet.DispatcherServlet not found in web-application MyWebApp"
    (The IE browser just gives me the 500 error without additional elaboration.)
    But my spring.jar where that class is located is in the WEB-INF/lib directory. Does anyone have an idea what the solution is--how can I get OC4J to read the spring.jar (or any jar) in that lib folder? (Or is there a way I can configure logging to better pinpoint the problem if that isn't it?)
    Thanks,
    Glen

    Glen,
    You said:
    IE browser just gives me the 500 error without
    additional elaborationTry unsetting the "Show friendly HTTP error
    messages".
    From the "Tools" menu of Microsoft Internet Explorer,
    choose "Internet Options".
    (You should then see another window entitled
    "Internet Properties" displayed.)
    Select the "Advanced" tab and search for "Show
    friendly HTTP error messages".
    Excellent--that worked. Thanks! I was afraid that I would have to be debugging on Firefox exclusively.
    I also suggest setting the
    "search-local-classes-first" attribute, of the
    "web-app-class-loader" element, in your
    "orion-web.xml" file to 'true' (if it isn't
    already).
    That did it. My orion-web.xml file was of the old DTD-based version, I believe that was causing the problem.
    The following document:
    Oracle® Containers for J2EE
    Developer’s Guide
    10g Release 3 (10.1.3)
    Part No. B14433-01
    has a chapter (3) entitled Utilizing the OC4J
    Class Loading Framework which contains a section
    entitled Troubleshooting Class Loading-Related
    Problems in OC4J.
    Thanks for the link, I went through it thoroughly in trying to fix my problem.
    Glen

Maybe you are looking for

  • Speakers not working. please help!

    When i plug my ipod into the speakers, it doesn't read the ipod. Could the contacts be broken?

  • I just installed itunes on my pc.  Can't find Store menu or authorize my computer.  Help!

    I have itunes on my ipad and just bought a new PC laptop with Windows 7.  I have already downloaded itunes on my comuter, but need to authorize it.  Support says to go to Stores menu and choose authorize my computer.  Problem is....I can't find the S

  • ITunes 11 for Mac "Update All Apps" grayed out, requiring relaunch to update again

    On iTunes 11.2.1 (1) "Update All Apps" grays out after I update once. I need to relaunch iTunes to get it to be clickable again. I am definitely logged in, etc., so it seems like a bug with iTunes, yes?

  • Oversized Image in iDVD

    Hi all. I have created a DV Stream using QT Pro (it was orig. from FCE)... When I bring it into iDVD, it's cropped significantly on all sides. Is there a setting I ought to change in order for it to play properly? - Either in FCE or QT? Thanks, Chris

  • Cleaning up old FrontPage files

    Am converting over from FP to DW and am starting to clean up (delete) old FP files in the site. Folders like Borders and Themes and FPClass were the first to go. What else can I just get rid of? Also, I notice that there are folders called _vti_cnf t