SHOULD BSF.JAR BE IN CLASSPATH?

I am trying to call a java .class file from XSL. When I include the bsf.jar in classpath, it works fine for me. My question is, do we have to include this bsf.jar in classpath for calling java programs?. Some documents says bsf.jar is for other language scripts only and not for calling java code.
I could not find any relevent documentation in BEA site. Is there any other methods available?
I am using weblogic 6.0 sp2

Deploy the war and the jar files in a ear file. Deploy the ear application file
in the applications directory. Although you could deploy the WAR and JAR files
separately, deploying them together in an EAR file produces a classloader arrangement
that allows the servlets and JSPs to find the EJB classes.
"mark" <[email protected]> wrote:
>
Hi Everybody,
I developed an application consisting in a .war and a .jar
file I
deployed the two files into the weblogic applications directory . When
a run the
application it says that it doesn't find a class, The problem disappears
when
a put the jar file into the startweblogic script CLASSPATH variable.
Is there a better solution, I don't want to put the jar file in the weblogic
classpath
it looks pretty cumbersome.
Thanks
mark

Similar Messages

  • What jars should i put in my classpath?

    Hello
    I have installed the pack summer 02
    What jars should i put in my classpath to avoid the error I get every time i run this test program:
    import java.net.*;
    import java.io.*;
    import org.w3c.dom.*;
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.StreamResult;
    import javax.xml.transform.dom.DOMSource;
    public class XmlTester{
         public static void main ( String [] args ){
              try{
                   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   DocumentBuilder builder = factory.newDocumentBuilder();
                   Document document = builder.parse("Description.xml");
              }catch ( Exception e ){
                   System.out.println("Salto una excepcion");
              }//catch
              catch ( FactoryConfigurationError e ){
                   System.out.println(e.getMessage());
                   System.out.println(e.getException());
              }//catch
         }//main
    }//XmlTester
    ERROR:
    Provider org.apache.crimson.jaxp.DocumentBuilderFactoryImpl not found
    java.lang.ClassNotFoundException: org.apache.crimson.jaxp.DocumentBuilderFactoryImpl
    Thanks

    Whichever jars have the classes that you want to use (you should probably put all the jars that you got with this program)
    Also, try adding an import statement:
    import org.apache.crimson.jaxp.DocumentBuilderFactoryImpl;

  • Adding a jar to the classpath of an executable jar (mixing -jar and -cp)

    Hello,
    frankly I hesitated over posting this to "New to Java"; my apologies (but also, eternal gratefulness) if there is an ultra-simple answer I have overlooked...
    I integrate a black-box app (I'm not supposed to have the source) that comes packaged as an executable jar (with a Manifest.MF that specifies the main class and a bunch of dependent jars), along with a few dependent jars and a startup script. Long story short, the application code supports adding jars in the classpath, but I can't find a painless way to add a jar in its "classpath".
    The app's "vendor" (another department of my customer company) has a slow turnaround on support requests, so while waiting for their suggestion as to how exactly to integrate custom jars, I'm trying to find a solution at the pure Java level.
    The startup script features a "just run the jar" launch line:
    java -jar startup.jarI tried tweaking this line to add a custom jar in the classpath
    java -cp mycustomclasses.jar -jar startup.jarBut that didn't seem to work ( NoClassDefFound at the point where the extension class is supposed to be loaded).
    I tried various combination of order, -cp/-classpath, using the CLASSPATH environment variable,... and eventually gave up and devised a manual launch line, which obviously worked:
    java -cp startup.jar;dependency1.jar;dependency2.jar;mycustomclasses.jar fully.qualified.name.of.StartupClassI resent this approach though, which not only makes me have to know the main class of the app, but also forces me to specify all the dependencies explicitly (the whole content of the Manifest's class-path entry).
    I'm surprised there isn't another approach: really, can't I mix -jar and -cp options?
    - [url http://download.oracle.com/javase/6/docs/technotes/tools/windows/classpath.html]This document (apparently a bible on the CLASSPATH), pointed out by a repited forum member recently, does not document the -jar option.
    - the [url http://download.oracle.com/javase/tutorial/deployment/jar/run.html]Java tutorial describes how to use the -jar option, but does not mention how it could play along with -cp
    Thanks in advance, and best regards,
    J.
    Edited by: jduprez on Dec 7, 2010 11:35 PM
    Ahem, the "Java application launcher" page bundled with the JDK doc (http://download.oracle.com/javase/6/docs/technotes/tools/windows/java.html) specifies that +When you use [the -jar] option, the JAR file is the source of all user classes, and other user class path settings are ignored+
    So this behavior is deliberate indeed... my chances diminish to find a way around other than specifying the full classpath and main class...

    I would have thought that the main-class attribute of the JAR you name in the -jar option is the one that is executed.Then I still have the burden of copying that from the initial startup.jar's manifest. Slightly less annoying than copying the whole Class-path entry, but it's an impediment to integrating it as a "black-box".
    The 'cascading' behavior is implicit in the specification
    I know at least one regular in addition to me that would issue some irony about putting those terms together :o)
    Anyway, thank you for confirming the original issue, and merci beaucoup for your handy "wrapper" trick.
    I'll revisit the post markers once I've actually tried it.
    Best regards,
    Jérôme

  • Adding Classes to the JAR File's Classpath

    Ques 1- Can I use the wildcard * symbol in Manifest file to add classes/othes jar files to the JAR File's Classpath.I have folder named - Lib . where there are many jar files.Now,do I have to add each jar file by- Class-Path: Lib/jar1-name Lib/jar2-name . Instead, can I do this- Class-Path: Lib/*.jar OR Class-Path: Lib/*.class
    RIDICULOUS....105 views has been made but YET NO ANSWER. Isn't there anybody who knows the answer.
    Edited by: Tanvir007 on Apr 30, 2008 2:21 AM

    Ques 1- Can I use the wildcard * symbol in Manifest file to add ... other jar files ...?No. You could, however, place all your needed JARs in JavaHome/jre1.x.x/lib/ext - if this is a way for you.
    Ques 2 ??
    RIDICULOUS....105 views has been made but YET NO ANSWER.What hindered you to test it yourself?
    And the things we don't know far exceed the things we know. Why do you wonder?
    Have a nice day
    J�rg

  • Adapter jar file in classpath ?

    Hi All,
              Is it still a requirement to put the adapter jar file in classpath for the
              adapter developed using ADK in WLI2.1 and WLS6.1SP1 ?
              coz if I dont put it in the classpath, then its not able to find the message
              bundle files (.properties and .xml) !!
              Thanks
              Amit
              

    then i created a jar file named darshan.jar with following command :
    jar -xvf d:\darshan.jar darshan/*.classThat command doesn't create a .jar file, it extracts files from an existing one. You need to use c instead of x to create a new .jar file:
    jar -cvf d:\darshan.jar darshan/*.class

  • How do you add a jar to the classpath?

    I'm trying to load a driver for MySQL, but the program doesn't seem to find the driver. I get an exception everytime. I keep seeing references about adding the jar (mysql-connector-java-5.1.6-bin.jar) to the classpath, but I don't know how to do that. Also, do I only that the jar, because there are other files along with it (src, com, etc.). I'm running Windows XP and using Eclipse.
    import java.sql.*;
    public class Driver {
         public static void main (String[] args) {
              try {
                   // Step 1: Load the MySQL driver.
                   System.out.println("BP01");
                   Class.forName("com.mysql.jdbc.Driver");
                   System.out.println("BP02");
              } catch (Exception e) {
                   System.err.println("Got an exception! ");
                   System.err.println(e.getMessage());
    }

    In Windows Explorer or the Command Prompt, try changing your directory to what the message about not finding the JAR in the repository says (C:\Documents and Settings\xxx\Desktop\mysql-connector-java-5.1.6\) and verify that something called mysql-connector-java-5.1.6-bin.jar! exists there.

  • Help Nedded on how to add JavaMail.jar and JAF.jar to my classpath

    Hello.. please i want to add these two packages JavaMail.jar, and JAF.jar to my classpath.
    Can anyone show me how to do this?, if possible some example.
    Thanks.

    Hi!
    Just copy them into the %JAVA_HOME%/jre/lib/ext folder.
    Or...
    Add them to your classpath as:
    java -cp <path to your jar files>/mail.jar;<path to your jar files>/jaf.jar;. YourApp
    Hope this helps.

  • Did u use jar files as classpath for appletviewer?

    as tested, jar files can not be used as classpath for appletviewer.
    java command is bellow
    appletviewer -J-classpath -Jc:\folder00\some.jar; -Jc:\folder01\any.jar; MyAppletClass
    the jar files (or classpaths) above do not work.
    I am not sure about my test, so i post my Q here for confirming it.
    thx

    appletviewer needs HTML code to run an Applet similar to how the Applet would be run from a browser. It does not have a Classpath option.
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/appletviewer.html

  • Added JAWS.jar as external classpath

    But I am still getting an error on the JSObject class. I have import netscape.javascript.JSObject but it isnt finding it. Does JAWS.jar still contain the JSObject class. AARRRGGHHH !

    But I am still getting an error on the JSObject class.
    I have import netscape.javascript.JSObject but it
    isnt finding it. Does JAWS.jar still contain the
    JSObject class. AARRRGGHHH !I too am new to java. I installed sdk1.4.2_05 and all was well until I included an import for netscape.javascript. I determined I needed the JAWS.jar in the classpath but I can not find the file. I've reinstalled the SDK to be sure I didn't miss anything. Any ideas?

  • How to run jar file with classpath?

    Hi, all,
    I have some package in my project, with which I have a java help jar file as classpath, when I run my project, I need the jh.jar file in directory /jar/jh.jar.
    Now, I bundled all my class packages into a jar file, my.jar, together with the /jar directory. When i run my jar file with command:
    java -jar my.jar
    It tells me couldn't find javahelp class.
    What shall I do? How can I create my jar file with the jh.jar?
    Thanks in advance.

    Thanks, hjembaek,
    But it doesn't work for me. I am running in windows, it still generate the error:
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/help/HelpSet
    at own.gui.OwnMenuToolBar.getOwnHelpBroker(OwnMenuToolBar.java:560)
    at own.gui.OwnMenuToolBar.addHelpMenu(OwnMenuToolBar.java:327)
    at own.gui.OwnMenuToolBar.getOwnMenuBar(OwnMenuToolBar.java:188)
    at own.gui.OWNDPTool.initGui(OWNDPTool.java:55)
    at own.gui.OWNDPTool.<init>(OWNDPTool.java:39)
    at own.gui.OWNDPTool.main(OWNDPTool.java:100)
    Here is my command to generate the jar file:
    jar cfm Own.jar temp.txt help own log others
    temp.txt is the file including the main class and class path information
    I have help folder, log folder and own package, others is directory that has the jar file(others/jh.jar)

  • Execution from JAR files and Classpaths -- Help

    I am confused about how classes are resolved when running from within a JAR file, and why this is different than running a class that is not inside a JAR file.
    I have an application that uses classes from a third party library stored in a JAR file (biojava.jar) . If I run the app from the class file it works as expected and is capable of finding the external classes when the path to the biojava.jar is on my classpath. It also works if biojava.jar is instead placed in the extensions folder jre/lib/ext folder without an explicit path entry in my classpath.
    However when I package all my application classes up in a JAR file and try to execute the application from the JAR file it will ONLY work if I add a manifest entry to myApp.jar ... Class-Path: biojava.jar AND I place the file biojava.jar in the SAME directory as the Packaged JAR application. I would like to find a way to make this JAR file work for anyone who has biojava.jar in their classpath or ext directory. In other words I don't want my user community to have to copy the biojava.jar file when I email them myApp.jar. This community will already have biojava.jar on their CLASSPATH.
    How can I make my app within a JAR recognize either the user's CLASSPATH or ext folder? I have tried reading the documentation and many experiments but the only way it works is as described above.
    I am running Running Windows 2000.
    java version "1.4.1_01"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
    Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)
    Here are the results of my experimentations:
    The following Works:
    Manifest: Main-Class: org/biojava/app/SequenceSpiral
    Manifest: Class-Path: biojava.jar
    Place biojava.jar in the same directory as SequenceSpiral.jar
    java -jar SequenceSpiral.jar
    This works perfectly
    NONE of the following work
    0) Placing biojava.jar in my jre/lib/ext directory instead of the same dir as SequenceSpiral.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/biojava/bio/seq/FeatureFilter
    (this is the first class referenced from biojava.jar)
    1) Just see if it will find the proper jar on my classpath
    Manifest: Main-Class: org/biojava/app/SequenceSpiral
    I have biojava.jar on my classpath but not in same directory as SequenceSprial.jar
    java -jar SequenceSpiral.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/biojava/bio/seq/FeatureFilter
    2) Specify the name if the jar in the Manifest Classpath and see if it will find the proper jar on my classpath
    Manifest: Main-Class: org/biojava/app/SequenceSpiral
    Manifest: Class-Path: biojava.jar
    I have biojava.jar on my classpath but not in same directory as SequenceSprial.jar
    java -jar SequenceSpiral.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/biojava/bio/seq/FeatureFilter
    3) Specify the path of the jar in the Manifest Classpath
    Manifest: Main-Class: org/biojava/app/SequenceSpiral
    Manifest: Class-Path: d:/biojava/biojava.jar
    I have biojava.jar on my classpath (D;\biojava\biojava.jar) but not in same directory as SequenceSprial.jar
    java -jar SequenceSpiral.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/biojava/bio/seq/FeatureFilter
    (note that in this case it is not fnding my main even though the Main-Class is specified)
    4) Specify current directory and biojava.jar in the Manifest Class-Path
    Manifest: Main-Class: org/biojava/app/SequenceSpiral
    Manifest: Class-Path: .;biojava.jar
    I have biojava.jar on my classpath (D;\biojava\biojava.jar) but not in same directory as SequenceSprial.jar
    java -jar SequenceSpiral.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/biojava/bio/seq/FeatureFilter
    5)Specify current directory and the URL of biojava.jar in the Manifest Class-Path
    Manifest: Main-Class: org/biojava/app/SequenceSpiral
    Manifest: Class-Path: . d:/biojava/biojava.jar
    I have biojava.jar on my classpath (D;\biojava\biojava.jar) but not in same directory as SequenceSprial.jar
    java -jar SequenceSpiral.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/biojava/bio/seq/FeatureFilter.
    Thank you very much for any help or suggestions,
    David Maynard

    I did some more testing and I think I now understand what is going on.
    I don't like it, but at least I understand it.
    The problem: I have an app packaged into a JAR file, myApp.jar. It has a dependancy upon an external JAR file extern.jar.
    extern.jar is on my Classpath (and also in jre/lib/ext)
    1) For some reason (bug?) java -jar myApp.jar does NOT use the classpath or the jre/lib/ext mechanisms to find .jar files needed to resolve references to external classes. This seems to be true even if you add an explicit -classpath argument on the command line!
    thus
    java -jar -cp c:\\absolutePathToMy\extern.jar myApp.jar
    also fails as does
    java -cp c:\\absolutePathToMy\extern.jar -jar myApp.jar
    2) Inside the myApp Jar file you can specify a URL to an jar extension jar file but the URL IS RELATIVE TO THE PATH WHERE THE myApp.Jar is executed from! If I add the Manifest item Class-Path: ..\..\..\myexterndir\extern.jar then
    java -jar myApp.jar
    works correctly and resolves the external references.
    This is why several people have reported that this class-path mechanism works ONLY when the extern.jar file is in the SAME DIRECTORY as the myApp.jar file when they had added a Class-Path: extern.jar to the Manifest.
    However together these two items make it IMPOSSIBLE to distribute myApp.jar to others and have it work since the path names statically encoded inside the jar are relative to where the jar gets executed from. If I move myApp.jar to a different location on my hard drive it may also fail.
    In my case I know all my customers already have extern.jar (5MB) installed on their classpaths and I would like to just send them the myApp.jar ( .5MB ).
    However I don't see how to do this given the current specification of a JAR file, and the bug that makes all -jar file act like they have the Sealed=true property.
    I tried explicity setting Sealed=false in the manifest but this didn't seem to have any effect.
    I hope that this will save others the many hours of time it has taken be to determine that JARS are not well suited for deploying apps with dependenncies on external libs.
    I also hope that someone can show me how execute a JAR and specify a classpath that doesn't get IGNORED my the classloader used in loading the jar classes.
    This is using java version:
    java version "1.4.1_01"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
    Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)
    Does any one know this bug is fixed in a later release?
    David Maynard

  • Webapp: ejb jars on servlet classpath

              I have created a WebApplication (using WebLogic 5.1 sp8) that uses
              the directory structure documented in http://www.weblogic.com/docs51/classdocs/webappguide.html#dirstruct
              (with a web-inf/classes for servlet classes and web-inf/lib for
              ejb jars)
              According to http://www.weblogic.com/docs51/classdocs/API_ejb/EJB_deployover.html#1056431
              , the public interface of my ejb's should be exported to the weblogic
              classloader so that my servlet can use these classes when doing
              remote calls.
              When I run the weblogic console and check my web application's
              servlet classpath however, I see that all jar files in web-inf/lib
              have been included. So now my servlets have access to not only
              the remote interface, but the entire implementation of my ejb's!
              This is not what I want, or what should happen according to the
              documentation.
              Is there something I am doing wrong, is this a weblogic bug, or
              is the documentation just wrong?
              Luke Hutteman
              Bank of America
              

    In 5.1, ejb classloader will export public interfaces to weblogic
              classloader automatically. And servlet can access those classes since
              weblogic classloader is the parent of servlet classloader.
              So, you do not need to pack your ejbs in jar and put them in WEB-INF/lib.
              However, for application exception classes and other classes used by your
              ejb, you have to pack them, either put them in weblogic.class.path or
              WEB-INF/classes or WEB-INF/lib (as jar file)
              My 2 cents.
              Cheers - Wei
              "Luke Hutteman" <[email protected]> wrote in message
              news:[email protected]...
              >
              > I have created a WebApplication (using WebLogic 5.1 sp8) that uses
              > the directory structure documented in
              http://www.weblogic.com/docs51/classdocs/webappguide.html#dirstruct
              > (with a web-inf/classes for servlet classes and web-inf/lib for
              > ejb jars)
              >
              > According to
              http://www.weblogic.com/docs51/classdocs/API_ejb/EJB_deployover.html#1056431
              > , the public interface of my ejb's should be exported to the weblogic
              > classloader so that my servlet can use these classes when doing
              > remote calls.
              >
              > When I run the weblogic console and check my web application's
              > servlet classpath however, I see that all jar files in web-inf/lib
              > have been included. So now my servlets have access to not only
              > the remote interface, but the entire implementation of my ejb's!
              > This is not what I want, or what should happen according to the
              > documentation.
              >
              > Is there something I am doing wrong, is this a weblogic bug, or
              > is the documentation just wrong?
              >
              > Luke Hutteman
              > Bank of America
              >
              

  • Where should a ".jar" file be placed?

    Hey.
    I know there's a jar (java archives) forum, but things are kinda slow over there...
    I'm trying to run a simple JDBC application using Cloudscape (I've downloaded cloudscape.jar for that) and jdk1.3.1, on LINUX.
    The new .jar file isn't recognized and I keep getting a runtime ClassNotFoundException.
    I've changed several system-files (such as the root's .tcshrc and my own .bashrc), and copied the file almost everywhere, but just can't get it right :-(
    Where should the cloudscape.jar file go, and what are the exact changes needed in order to force (no more mister nice-guy) the system to acknowledge it?
    Thanx,
    Mike.

    just make sure your CLASSPATH includes cloudscape.jar. Not just the path, but also the jar filename.
    There is also a jre/lib/ext path in your java installation where you can dump your jar file so it will automatically be seen when you run your program.

  • Jar file and classpath problem

    I0m writing a program that use the kunststoff.jar Look&Feel.
    Now I would like to put all I'm writing into a jar file but I always have a NoClassFoundException when I try to start my application.
    here is a MANIFEST:ME I'm using:
    Manifest-Version: 1.0
    Created-By: 1.4.2-beta (Sun Microsystems Inc.)
    Main-Class: JListaR.JListaR
    Class-Path: kunststoff.jar img\ .why this don't work?

    Unfortunately you can't embed jars within a jar and
    expect them to be referencable for the classpath from
    outside the main jar. The "Class-Path" attribute in
    the manifest is used to refer to other jar files
    outside of your jar file.
    The usual approach to solve this problem is to unpack
    the jar files you want to embed and then rejar
    everything together in one big jar file again. This
    isn't always a great approach though, I know I'm
    looking for an alternative. So far my only alternative
    is dynamic class loading using a classloader, however
    this isn't great if you need to refer to several
    hundreds or even thousands of classes.thank you very mach...now I understand because it dosen't work correctly!

  • Classes+resources in JAR: have to add each single Jar file to CLASSPATH?

    Hello,
    For my application, I plan to easily embed plugins that can be added by the user by copying it into a subfolder "plugins".
    Now, I start my app from a shellscript and in order to load resources from within some of these Jars (e.g. using Class.getResourceAsStream() ), it only works if I explicitly add the specific Jar filename to the classpath from the shellscript.
    I read in a German Java book, that also just using folder names is enough, but it does not work for me:
    Works:
    $JAVA_HOME/bin/java -Djava.library.path="./lib" -classpath "./lib:./plugins/test.jar" test.AppFails:
    $JAVA_HOME/bin/java -Djava.library.path="./lib" -classpath "./lib:./plugins/" test.AppIs it really required to add Jars explicitly, so that e.g. my shellscript has to make a Jar listing of that folder in order to pass them as classpath files?
    Thanks and regards,
    Timo

    No, you don't have to do it that way. What you need
    to do is to have your progam create a URLClassLoader
    pointing to all the jars in the plugin directory.
    Then request your plugin classes from that, rather
    than Class.forName();
    You need to create an array of file URLs for the
    jars, use File.listFiles() and then File.toURL() on
    each ..jar you find.
    p.s. If you do it this way make sure your plugin
    classes are not on the classpath.
    Hmm. Cool. I had no idea. Thanks for correcting me.

Maybe you are looking for

  • Problem with GetLineData Method

    Hi I have a program to save each row of a A/R Invoice as one A/R Invoice document. In the program, I read each line of data from matrix with GetLineData Method, and set the data to business object, and add the document at a global transaction. Adding

  • Critical service type "ssl-accel" (not documented)

    I only found the documentation for critical services "scripted, redundancy uplink and local" in the advanced admin guide Rel 7.2 --snip--> scripted - the priority changes to 0 when one service in the scripted group goes down. redundancy uplink - the

  • ältere Datei nicht kompatibel mit Premiere Pro CS5?

    Hallo, mein Problem ist folgendes: ich habe ein Projekt mit einer älteren Premiere Pro Version angefertigt und wollte diese mit der CS5 Version öffnen und dran weiterarbeiten. Nun kommt folgende Fehlermeldung: --Dieses Projekt enthält eine Sequenz, d

  • Is it safe to run expdp on a live database?

    Can I run expdp on a live database? Will expdp take out any long-lasting locks that might hang normal application transactions (or does expdp just take a "snapshot" copy of the schema at a particular SCN)?

  • Oracle data provider not appearing in MS Business Intelligence reporting

    Oracle Data provider does appear is VS 2005 server explorer but NOT as a data source in the reporting project type. This is in oracle ODAC beta 11 Is this supported?