Where to put utility jar (used by EJB's and war)

Hello all,
In many cases when you create a web application including EJB's and a WAR file packaged together in an EAR file, you need some utility classes that are used in the EJB's as wel as in the servlets in the WAR. The utility classes might for example be value object classes that servlets use to exchange data with te EJB's.
My question is: What is the best place to put the utility class files?
There is a new article on JDC: http://developer.java.sun.com/developer/technicalArticles/J2EE/build/ that gives some tips. For example, it proposes to put the utility JAR in the EAR file and then add a "Class-Path:" entry to the MANIFEST.MF of the EJB's that use the utility classes.
However, this approach does not work on BEA Weblogic 6.0. Weblogic's classloader just seems to ignore the "Class-Path:" in the EJB JAR's manifest.
Any thoughts?
regards
Jesper

The "CLASS-PATH" mechanism in that article is a new
requirement in J2EE 1.3 (final draft 4). Therefore
right now Weblogic does not support it yet. Now you
need to put those utility classes in both the WAR (in
WEB-INF/lib) and EJB JAR files. If you really want
only 1 copy of the jar file deployed, you can manually
add that jar file to weblogic server classpath in the
start script under config/yourdomain.HI all,
I have some Utility jar file for EJB and Web Application,
In the second solution about one copy in weblogic,
I tried it in the WLS60 it's ok
But it didn't work in WLS61
Anyone could give me any good suggestion?
Moen

Similar Messages

  • Using external util JAR from Session EJB

    I have a Stateless Session EJB that uses some classes packaged in a utility jar. How do I package the EJB jar with this util jar, and get the app server to recognize this utility jar? including a /lib dir with the utils jar in it, like you would with a WAR, doesn't work.
    I've temporarily got this to work by modifying the startup scripts for my app server to ensure my jar is included in the -classpath arg, but this cannot be the intended way. (cannot find details on this in the tutorial).
    Thanks in advance!

    Well, the answer depends a lot on which appserver you're using, because it obviously depends on how the vendor implemented the containers' ClassLoaders. What usually works is dependent upon a portion of the JVM spec regarding the MANIFEST.MF file. If you package your ejb.jar and library.jar in an .ear file, you can put the following in the ejb.jar MANIFEST.MF:
    ClassPath: library.jarNote that there must be at least one blank line at the end of the MANIFEST.MF file.
    This works on WebLogic, but, as an example, JBoss uses a single ClassLoader, so I'm not entirely sure how you'd go about the same thing there.
    And you're quite right - putting it in the JVM ClassPath is not a good idea...

  • Including utility jar when packing ejb in weblogic

    Hi,
    I am new to j2ee programming. I have an ejb which uses some utility jars. I followed the bea documents to structure the directory. The directory structure is, like,
    EjbProject
    - classes
    --com
    ---mine
    ----projectTracking --> has the class files of the ejb and supporting java files
    - src
    --com
    ---mine
    ----projectTracking --> contains the source files of the ejb and the supporting java files
    META-INF > contains ejb-jar.xml and weblogic-ejb-jar.xml
    The source java files are dependent on an utility jar file.
    so when I try the java weblogic.appc src, it throws me exception saying the utility file is missing. My question , is where should I put this utility jar file. Please send me your thoughts.
    Thanks in advance

    Hi,
    you can put your utility jar in the ear file along with the EJBs and make a classpath entry to these files in the EJB jar's META-INF\Manifest.mf file. As you said if you are working with weblogic you can put these files any where in the directory structure and place the entry in the startWeblogic.cmd file. But i recomend first option.
    Ashok.

  • Where to put files in using runtime.exec(run.exe)?

    I try to use the following program in EJB to call my EXE program in the J2EE server:
    runtime.exec("c:\\j2ee\\public\\exe\\run.exe temp.txt");
    In the execution of mill_turn.exe, it will open several files for read and write.
    So where to put the file temp.txt and other files the run.exe need to read?
    Looks like the J2EE server can not find them?
    Thanks!

    I got it in Java SE1.4.
    File dir=new File("c:\\j2ee\\public_html\\Mill_turn\\exe\\");
    Process proc = rt.exec(cmd,null,dir);Use above codes, I really got the right output from my external program for the first time. But , after that, the output keeps same when I change the filename in the following code:
    cmd="c:\\..\\run.exe temp.prt"
    to
    cmd="c:\\..\\run.exe Abc1.prt" , which must have different output.
    The codes for calling external program are implemented in the SessionBean of J2EE.

  • Urggggent...where to put xmlparserv2.jar

    hi guys i want to use DOM and i dont know where to put this file so when i import it JDev recognize it;

    Go to your project's settings dialog and look under the libraries item. You'll be able to define a new library there (which uses your jar file) that your project can use.

  • Where to put custom .jar-files in order to use them in scripting QPAC?

    Hi,
    For testing purposes, I wrote a simple class and put it in a .jar-file to use in scripting QPAC. Unfortunately, I get the following error message in JBOSS:
    Class: FooBar not found in namespace
    Where do I have to put custom library (jar-)files in order for JBOSS to find them? I already tried
    [...]\jboss\lib as well as
    [...]\jboss\server\all\lib.
    Regards,
    Steve

    Hi Steve
    You need to put them in two places:
    1. In the server classpath, so that they can be found at runtime. jboss\server\all\lib should work, or you can even drop them into the server/all/deploy directory. I think if you put them in the lib directory, you need to restart Jboss, whereas if you put them in the deploy directory, they should be dynamically picked up.
    2. For testing purposes, the extra jars need to be in the classpath of the Workflow Designer. Please download our SQLPlus QPAC from:
    http://www.avoka.com/avoka/qpac_library.shtml
    It includes a document that describes a technique for adding extra jars to the classpath.
    Regards,
    Howard
    http://www.avoka.com

  • Where to put property files used by XSLT extensions?

    Still fighting with Java XSLT extensions. I have narrowed the
    problem down: my XSLT extension cannot find its property file,
    which I use to store JDBC connect strings etc.
    What is the proper directory to put this file so the XSLT
    extension class can find it? I am using Oracle HTTP Server with
    XDK 9.0.

    Thanks for the answer, Steve!
    Depends on what call you're using in your extension function to
    read your properties.Maybe I tried a too simplistic approach. I'm just using this:
    Properties props = new Properties();
    try {
    props.load(new FileInputStream("/foo.properties"));
    etc.
    This (with the slash) works if the properties file is in the root
    directory of the filesystem, but it's a kludge.
    If you read your properties as a resource using
    getResourceAsStream(), then where the classloader expects to
    find your file depends on the resource name that you specify.So maybe I should use getResourceAsStream() then? What if I put
    the properties file inside the JAR with the extension classes?
    Or is there any way to reference the web root?
    --Jere

  • OWSM: Where to put additional jars for a custom step

    I'm in the process of creating a custom step for OWSM. The step relies on some additional libraries that are not found on the server at the moment. Where do I put them so that my custom step will find them?
    I'd like to avoid packaging them into the steps jar file if possible.

    You can put anywhere and probably create shared library in your server.xml and import them in following shared libraries:
    oracle.wsm.policymanager
    oracle.wsm.gateway
    oracle.wsm.coreman
    oracle.wsm.ccore
    HTH,
    Chintan

  • Where to put RXTXcomm.jar so NetBeans can find it?

    I am trying to write a program for the RPi in Java, that will read and write a serial port.  I have downloaded RXTXcomm.jar and the appropriate so file.  So far I have benn unable to find the right place to put the RXTXcomm.jar file so that NetBeans can find it.  I have tried Java_ME_platform_SDK_8.0/lib/ext and jre1.8.0_20\lib\ext.  I have also gone into the project properties and specifically told it to look in the  Java_ME_platform_SDK_8.0/lib/ext director but NetBeans still does not find the classes.  I have also imported the gnu.io.* package in my program but NetBeans doesn't find the package.  Any help would be greatly appreciated.

    Hi!
    To read/write serial port you don't' need any side libraries. Simply use either Device IO API or MEEP GCF.
    /Sergey

  • Where to put maps when using navigation software, ...

    anyone with a mobile navigator for symbian, and particulary n95 8gb, where do you put the maps? my navigon navigator 6 cant find any maps, but i have a .map file in the navigon map in the mass storage of the phone, what do you do?

    I have a suggestion where you can store them, but I don't think the moderators would find it as funny as I might.
    Seriously, either wrap them around the case with the iPod inside, or coil them up and store them in another pocket. It's really up to you.
    Cheers!
    -Bryan

  • Using J2EE EJB Container and Oracle 8.1.7

    I am trying to setup the J2EE EJB container to use and Oracle 8.1.7 database instead of Cloudscape. So far I have done the following
    0. Created the table for the Savings Account tutorial in the Oracle Database.
    1. Added the Classes12.jar (Oracle's latest JDBC thin drivers) to my CLASSPATH
    2. Under "Server Configuration" I added the standard/jdbc drivers value: "oracle.jdbc.driver.OracleDriver".
    3. Under "Server Configuration" I added the standard/datasource value: JNDI name "jdbc/Oracle" and JDBC URL "jdbc:oracle:thin:@10.1.1.254:1521:DEV".
    4. For the savings account tutorial, when deploying I specified "jdbc/Oracle" for the reference "jdbc/SavingsAccountDB".
    I have gotten this tutorial to work using the Cloudscape database. After I did the previous steps and tried to run the client, I get no valid driver available, unable to connect to Oracle.
    What else to I need to do?
    My setup is:
    Windows 2000 Professional
    J2EE (JDK 1.3.1)
    Oracle 8.1.7
    Thank you in advance.

    Exactly which classpath did you add the Oracle JDBC library jar to ?
    The thing that works for me is to have the following line in the file %J2EE_HOME%\bin\userconfig.bat
    set J2EE_CLASSPATH=D:\DownLoad\Oracle\classes12_01.zip;

  • Where to put in the Wiki: problems with chromium and gecko-mediaplayer

    Hej,
    I had some problems to  watch embedded wmv files in chromium.
    The gecko-mediaplayer plugin did not work, but complained about not being able to load the windows media plugin, although it was correctly installed in the lib-dirs.
    Seems this is a common problem on a lot of *nixes, although I did not find a lot regarding arch.
    Solution was to use the totem-plugin instead of gecko-mediaplayer.
    I wonder what is the correct place to add this to the wiki. Should I just put a note on the browser plugin page (https://wiki.archlinux.org/index.php/Browser_Plugins)?
    Zane

    It's fairly old, but have you tried https://bbs.archlinux.org/viewtopic.php?id=113548 ?
    However https://wiki.archlinux.org/index.php/Browser_Plugins can be a good place indeed, it already has a troubleshooting entry for gecko mediaplayer.
    EDIT: typo
    Last edited by kynikos (2013-08-19 10:49:47)

  • For UFT 12.5 trail version, where to put Locking ID in HP License Portal and generate License Key?

    I tried installing UFT 12.5 version. While launching UFT, it was asking me to generate License Key file. In the License portal->Activation->Certificates tab, when I put Locking ID and searched, it was throwing "No activation certificates were found for the search criteria you entered. Please search again." error message. Please help.

    I am not able to post any queries in this site: http://h30499.www3.hp.com/t5/Functional-Testing-QTP-Support/tkb-p/sws-Fun_TEST_SF%40tkb Please help.

  • Where to put jar files reachable for ejb:s?

    Hello!
    I have a ejb that use some jar files.
    But I can not figure out where to put the jar files that I use from my ejb in Weblogic 8.1.3.
    Until now I have extracted all jar files and put them inside my ejb with my own class files. But this seems odd.
    So please help me out here.
    Best regrads
    Fredrik

    Dear,
    You might have downloaded either tar.gz or zip file. when you extract this file you will find a jar file and also some demos nad docs(api+help). place the poifs api jar file in 'WEB-INF\lib" folder and restart the server.
    In general any api jar files for web applications should be placed in WEB-INF\lib folder then only they are accesible. If you extracted the jar, then place entire package structure in WEB-INF\classes directory
    Regards,
    Nishant Kulkarni
    Software Engineer
    Bangalore
    [email protected]

  • How to use utility jars without -cp

    I am trying to use a 3d loader from starfire research to load .3ds files. I currently have the jar in /lib/ext and netbeans sees this and uses it, and everything works perfectly fine. When I use this on other machines for a test, I put the 3d loader jar in to the client /lib/ext folder, but my program cannot find it. Any suggestions on where to put this jar without me having to use -cp every time?
    Thanks in advance.

    I'll try to explain better. The 3DS Loader I'm using is called StarfireExt.jar. I have two computers that I am using right now: a custom built desktop with Windows XP 32 bit that runs Netbeans, and a Dell laptop that I'm using to test my software. On the desktop, I have JDK1.6u18 with Java3D also installed. StarfireExt.jar is in my C:/Program Files/Java/jdk1.6.0_18/lib/ext/ folder, and Netbeans allows me to import and use StarfireExt. On the laptop, I have JRE1.6u20, Java3D, and StarfireExt in the lib/ext/ folder. When I'm on the desktop in Netbeans and press F6, it runs fine and the 3DS files load and are displayed. When I clean and build the JAR and move all of the models and JAR to my laptop, the program seems not able to find StarfireExt. The models don't load; no error windows that I've coded pop up.
    P.S. I'm sorry if I'm kind of a Java newbie. I don't know all those awesome developer tricks yet.

Maybe you are looking for

  • Download to Excel with Column Headings.

    Hi All, I have a very small issue.I want to download the Data from an internal table to an Excel Sheet Along with the Column heading of the corresponding Field... I tried with ws_excel and gui_download... not reached to any conclusion,,,I cant go for

  • Credit exposure is missing after billing doc

    Hi all i maintain $ 20000 Credit limited in FD32 and i raised few sales order , delivery ,billing accounting document not clear when i check in FBL5N customer line balances it showing due as $ 25000 when i check in FD32 credit exposer is taking in to

  • Where is HELP key on new Aluminum Keyboard?

    Instructions for Boot Camp tells me to use the HELP key for the INSERT command in Windows. The aluminum keyboard has no HELP key. Where is the HELP key the aluminum keyboard??

  • Recently added songs disappear or are lost

    Starting recently, when I add songs to my itunes library (songs found from blogs, not purchased on iTunes) a day or two later the pops up next to them and says that iTunes cannot find the songs. When I search for them, they have disappeared from the

  • Powerbook G3 Woes - PDQ 266 - Installation Headaches...

    Hello people. I have just acquired a PB G3 "PDQ" which has a 20GB HDD along with 512MB of RAM, Model M5473. I cannot install an OS on it to save myself and I'm pulling my hair out. I've reset the machine with the key combo stated at the rear, along w