Jar Execution and Classpath problem
Well lets say i have two jar files. extra.jar main.jar
main.jar needs to have extra.jar in the class path when executed.
how do i run the Main class in main.jar in the main package (main.Main) and at same time put the extra.jar into the class path.
like:
java -jar main.jar
(but need to put a class path with extra.jar to this)
tried:
java -cp .;extra.jar;main.jar main.Main
But that did not work, still did not find the extra.jar. Looks like the program then runs inside the main.jar file or something too and not the dir where the command were executed...
Any ideas?
Well lets say i have two jar files. extra.jar
main.jar
main.jar needs to have extra.jar in the class path
when executed.
how do i run the Main class in main.jar in the main
package (main.Main) and at same time put the extra.jar
into the class path.
like:
java -jar main.jar
(but need to put a class path with extra.jar to this)
Not clear what your intention is. Will you be executing extra from Main?
tried:
java -cp .;extra.jar;main.jar main.Main
But that did not work, still did not find the
extra.jar. Looks like the program then runs inside the
main.jar file or something too and not the dir where
the command were executed...
Any ideas?
Similar Messages
-
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! -
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 MaynardI 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 -
JDBC and Classpath problems on OpenVMS
Hello,
I'm working on an OpenVMS server and I got a simpler Java application that needs to establish a connection to an Oracle database, the application works perfectly well on Windows but when I moved to OpenVMS I got some problems with the oracle driver.
I believe I�m using the correct driver, I already checked on the oracle site according to my java version (1.4.2) and my database version (oracle 9i 9.2.0.7.0)
This is the error:
$java -jar miss.jar "DnBProcess"
About to start loading parameters for the MISS Proxy.
Successfully load parameters for the MISS Proxy.
About to load interface settings for DnBProcess
Settings for DnBProcess succesffully loaded.
About to load interface DnBProcess
About to start loading parameters for DnB Interface.
Successfully load parameters for DnB Interface.
Interface DnBProcess succesffully loaded.
About to execute interface DnBProcess
Connecting to the database...
java.lang.NoClassDefFoundError: oracle/jdbc/OracleDriver
at miss.DnBProcess.ExecuteQueryToFile(DnBProcess.java:85)
at miss.DnBProcess.Execute(DnBProcess.java:178)
at miss.Proxy.ExecuteInterface(Proxy.java:160)
at miss.Proxy.main(Proxy.java:207)
I know is a classpath problem, and my classpath on VMS looks like this:
define JAVA$CLASSPATH .,SYS$COMMON:[JAVA$142.LIB]TOOLS.JAR,SYS$COMMON:[JAVA$142.LIB]DT.JAR,SYS$COMMON:[JAVA$142.JRE.LIB]RT.JAR, USER1:[MONTEALEGRE.TEST.LIBS]OJDBC14.JAR,USER1:[MONTEALEGRE.TEST.MISS.LIBS]OJDBC14.JAR,[]
As you can see I added the �ojdbc14.jar� in different folders but my application seems not to find it.
Does anyone know how to set the classpath properly on VMS? Or maybe give me some tips that could lead me to find a solution to this problem.
Thanks.
Ileana.I would try googling for OpenVMS classpath. Unfortunatley the first result is this thread but there are a bunch of resources from IBM and HP listed and maybe they can help you.
-
Hi,
I have created a jar file using jar cvmf manifest classes.jar *.* in a directory under wich I can have put all my class files.
When I run the class containing the main program, everything works fine. However, when I run the executable jar file, I get access to the main method (which calls a swing JFrame which shows a menu), but the classes called by the JButtons on the menu do not react. I seem to be having a problem in my classpath. I am working in NT4, and have included in my classpath the full pathname (d:\classes\classes.jar). Can anyone help please?Are you getting any error messages? Have you put debugging code in those classes to see what is happening?
-
Hello
i have built a console application in jbuilder which depend on some jar file as libraries (example log4j ....)
when i run it from jbuilder i have no problem... but when i try from console i get the following error
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Layout
at fluxpromo.clsMain.main(clsMain.java:45)
i know its a classpth issue but iam not able to fix it .. anyone can help me out with this
thxi did using java -classpath D:\log4j.jar -jar
app.jar
but still have the same error, any idea why?When you use the -jar option, the only classpath that is used in the Class-Path in the jar. So you need to use either -classpath or -jar, but not both. For example,
java -classpath d:\log4j.jar;app.jar;another.jar main.package.MainClass -
Dynamic class loading problem using unknown JAR archive and directory names
I read the following article, which enlightened me a lot:
Ted Neward: Understanding Class.forName().
However, it took me some while to understand that my problem is the other way around:
I know the name of the class, I know the name of the method,
but my program/JVM does not know where to load the classes from.
Shortly, my problem is that the server engine that I am writing
uses two different versions of the same library.
So I am trying out the following solution:
My program is named TestClassPathMain.java
Assume the two libraries are named JAR1.jar and JAR2.jar
and the class/instance method that should
be exposed to TestClassPathMain.java by them is named
TestClass1.testMethod().
As long as I was depending on just one library,
I put JAR1.jar in the classpath before starting java,
and I was happy for a while.
At the moment I got the need to use another version of
TestClass1.testMethod() packaged in JAR2.jar,
a call would always access JAR1.jar's
TestClass1.testMethod().
I then decided to remove JAR1.jar from the classpath,
and programmatically define two separate ClassLoaders, one for use
with JAR1.jar and the other for use with JAR2.jar.
However, the problem is only partly solved.
Please refer to the enclosed code for details.
(The code in the JAR1.jar/JAR2.jar is extremely simple,
it just tells (by hardcoding) the name of the jar it is packaged in
and instantiates another class packaged in the same jar using
the "new" operator and calls a method on it. I don't enclose it.)
The TestClassPathMain.java/UC1.java/UC2.java code suite was
successfully compiled with an arbitrary of JAR1 or JAR2 in the classpath,
however removed from the classpath at runtime.
(I know that this could have been done (more elegantly...?) by producing an Interface,
but I think the main problem principle is still untouched by this potential lack of elegancy(?))
1) This problem should not be unknown to you experts out there,
how is it generally and/or most elegantly solved?
The "*** UC2: Variant 2" is the solution I would like best, had it only worked.
2) And why arent "*** UC2: Variant 2" and
"*** static UC2: Variant 2" working,
while "*** Main: Variant 2" is?
3) And a mal-apropos:
Why can't I catch the NoClassDefFoundError?
The output:
*** Main: Variant 1 JAR 1 ***:
Entering TestClass1.testMethod() packaged in JAR1.jar
About to instantiate TestClass2 with the new operator
About to call TestClass2.testMethod()
Entering TestClass2.testMethod() packaged in JAR1.jar
*** Main: Variant 1 JAR 2 ***:
Entering TestClass1.testMethod() packaged in JAR2.jar
About to instantiate TestClass2 with the new operator
About to call TestClass2.testMethod()
Entering TestClass2.testMethod() packaged in JAR2.jar
*** Main: Variant 2 JAR 1 ***:
Entering TestClass1.testMethod() packaged in JAR1.jar
About to instantiate TestClass2 with the new operator
About to call TestClass2.testMethod()
Entering TestClass2.testMethod() packaged in JAR1.jar
*** Main: Variant 2 JAR 2 ***:
Entering TestClass1.testMethod() packaged in JAR2.jar
About to instantiate TestClass2 with the new operator
About to call TestClass2.testMethod()
Entering TestClass2.testMethod() packaged in JAR2.jar
*** UC1: Variant 1 JAR 1 ***:
Entering TestClass1.testMethod() packaged in JAR1.jar
About to instantiate TestClass2 with the new operator
About to call TestClass2.testMethod()
Entering TestClass2.testMethod() packaged in JAR1.jar
*** UC1: Variant 1 JAR 2 ***:
Entering TestClass1.testMethod() packaged in JAR2.jar
About to instantiate TestClass2 with the new operator
About to call TestClass2.testMethod()
Entering TestClass2.testMethod() packaged in JAR2.jar
*** static UC2: Variant 2 JAR 1 ***:
Exception in thread "main" java.lang.NoClassDefFoundError: TestClass1
at UC2.runFromJarVariant2_static(UC2.java:56)
at TestClassPathMain.main(TestClassPathMain.java:52)
TestClassPathMain.java
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
public class TestClassPathMain {
public static void main(final String args[]) throws MalformedURLException, ClassNotFoundException, InstantiationException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
// Commented out because I cannot catch the NoClassDefFoundError.
// Why?
try {
final TestClass1 testClass1 = new TestClass1();
System.out.println(
"\nThe class TestClass1 is of some unexplicable reason available." +
"\nFor the purpose of the test, it shouldn't have been!" +
"\nExiting");
System.exit(1);
} catch (NoClassDefFoundError e) {
System.out.println("\nPositively confirmed that the class TestClass1 is not available:\n" + e);
System.out.println("\n\nREADY FOR THE TEST: ...");
// Works fine
System.out.println("\n*** Main: Variant 1 JAR 1 ***:");
runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
System.out.println("\n*** Main: Variant 1 JAR 2 ***:");
runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
// Works fine
System.out.println("\n*** Main: Variant 2 JAR 1 ***:");
runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
System.out.println("\n*** Main: Variant 2 JAR 2 ***:");
runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
// Works fine
final UC1 uc1 = new UC1();
System.out.println("\n*** UC1: Variant 1 JAR 1 ***:");
uc1.runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
System.out.println("\n*** UC1: Variant 1 JAR 2 ***:");
uc1.runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
// Crashes
System.out.println("\n*** static UC2: Variant 2 JAR 1 ***:");
UC2.runFromJarVariant2_static("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
System.out.println("\n*** static UC2: Variant 2 JAR 2 ***:");
UC2.runFromJarVariant2_static("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
// Crashes
final UC2 uc2 = new UC2();
System.out.println("\n*** UC2: Variant 2 JAR 1 ***:");
uc2.runFromJarVariant2("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
System.out.println("\n*** UC2: Variant 2 JAR 2 ***:");
uc2.runFromJarVariant2("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
private static void runFromJarVariant1(final String jarFileURL)
throws MalformedURLException,
ClassNotFoundException,
InstantiationException,
IllegalArgumentException,
IllegalAccessException,
InvocationTargetException,
SecurityException,
NoSuchMethodException {
final URL url = new URL(jarFileURL);
final URLClassLoader cl =
new URLClassLoader(new URL[]{url},
Thread.currentThread().getContextClassLoader());
final Class clazz = cl.loadClass("TestClass1");
final Object testClass1 = clazz.newInstance();
final Method testMethod1 = clazz.getMethod("testMethod", null);
testMethod1.invoke(testClass1, null);
private static void runFromJarVariant2(final String jarFileURL)
throws MalformedURLException,
ClassNotFoundException,
InstantiationException,
IllegalArgumentException,
IllegalAccessException,
InvocationTargetException,
SecurityException,
NoSuchMethodException {
final URL url = new URL(jarFileURL);
final URLClassLoader cl =
new URLClassLoader(new URL[]{url},
Thread.currentThread().getContextClassLoader());
final Class clazz = cl.loadClass("TestClass1");
final TestClass1 testClass1 = new TestClass1();
testClass1.testMethod();
UC1.java
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
public class UC1 {
public void runFromJarVariant1(final String jarFileURL)
throws MalformedURLException,
ClassNotFoundException,
InstantiationException,
IllegalArgumentException,
IllegalAccessException,
InvocationTargetException,
SecurityException,
NoSuchMethodException {
final URL url = new URL(jarFileURL);
final URLClassLoader cl =
new URLClassLoader(new URL[]{url},
Thread.currentThread().getContextClassLoader());
final Class clazz = cl.loadClass("TestClass1");
final Object testClass1 = clazz.newInstance();
final Method testMethod1 = clazz.getMethod("testMethod", null);
testMethod1.invoke(testClass1, null);
UC2.java
import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
public class UC2 {
public void runFromJarVariant2(final String jarFileURL)
throws MalformedURLException,
ClassNotFoundException,
InstantiationException,
IllegalArgumentException,
IllegalAccessException,
InvocationTargetException,
SecurityException,
NoSuchMethodException {
final URL url = new URL(jarFileURL);
final URLClassLoader cl =
new URLClassLoader(new URL[]{url},
Thread.currentThread().getContextClassLoader());
final Class clazz = cl.loadClass("TestClass1");
final TestClass1 testClass1 = new TestClass1();
testClass1.testMethod();
* Identic to the "runFromJarVariant2" method,
* except that it is static
public static void runFromJarVariant2_static(final String jarFileURL)
throws MalformedURLException,
ClassNotFoundException,
InstantiationException,
IllegalArgumentException,
IllegalAccessException,
InvocationTargetException,
SecurityException,
NoSuchMethodException {
final URL url = new URL(jarFileURL);
final URLClassLoader cl =
new URLClassLoader(new URL[]{url},
Thread.currentThread().getContextClassLoader());
final Class clazz = cl.loadClass("TestClass1");
final TestClass1 testClass1 = new TestClass1();
testClass1.testMethod();
}2. i need to load the class to the same JVM (i.e. to
the same environment) of the current running
aplication, so that when the loaded class is run, it
would be able to invoke methods on it!!!
ClassLoader(s) do this. Try the URLClassLoader.
(I was talking about relatively esoteric "security"
issues when I mentioned the stuff about Class objects
"scope".) You might use the URLClassLoader kind of
like this.
Pseudo-code follows:
// setup the class loader
URL[] urls = new URL[1];
urls[0] = new URL("/path/to/dynamic/classes");
URLClassLoader ucl = new URLClassLoader(urls);
// load a class & use make an object with the default constructor
Object tmp = ucl.loadClass("dynamic.class.name").newInstance();
// Cast the object to a know interface so that you can use it.
// This may be used to further determine which interface to cast
// the class to. Or it may simply be the interface to which all
// dynamic classes have to conform in your program.
InterfaceImplementedByDynamicClass loadedObj =
(InterfaceImplementedByDynamicClass)tmp;It's really not as hard as it sounds, just write a little test of
this and you will see how it works. -
Problem with Class and Classpath
Hello ME Windows Users, now before you place a wry smile on your face, I have a problem with path and classpath. Stop it, I can see you smiling!
By visiting the the last 10 pages of the forum and reading Sun installation notes, some tooldocs and by given some answers by some nice people, I have become an expert in turning off my computer, about 10 times/hr. I still am trying to make my first cup of java.
With the ME computer,
I'm unable to right click on the desktop and go to properties, advanced,
I'm unable to go go start, run, sysedit,
I'm unable to change the ms-dos window of autoexec.bat, it just shuts down.
Now before you tell me, I should of bought a different computer, the only place I can find to modify the path and classpath is in the environment which is in system configuration under tools. Here I have placed numerous configurations, like
C:\java>set path=%path%;c:\j2sdk1.4.2\bin
C:\java>set classpath=%classpath%;.;
;java_dir\bin where ;java_bin is c:\j2sdk1.4.2
.; java_dir\bin; %path% where ;java_bin is c:\j2sdk1.4.2 and the list goes on.
But, I know you are still smiling, the % signs comes up in a dialog box, saying too many, and will not convert the text to the environment to be saved when I close down for the tenth time in the last hour.
Can someone help me before I make a real cup of coffee and accidentally drop it on the ME box.
Have a laugh on me Mik.C:\java>set path=%path%;c:\j2sdk1.4.2\binGood
But it is no good because it has to many % and a dialog box appears, saying you have too many parameters.
Are you saying I have to shutdown again to answer your ?
From the HELP menu-
To confirm startup commands line by line
Click Start, and then click Shut down.
Click Restart, click OK, and then press and hold the CTRL key until the Windows Startup Menu appears.
Enter the number for Step-by-step confirmation, and then press ENTER.
For each command you want to run, press Y.
If the command runs successfully, you are prompted with the next command.
If the command does not run successfully, you receive an error message.
To skip a command, press N.
Mik -
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 -
Ears, wars, support jars, and CLASSPATH
I am trying to migrate an application from WLS 5.1 to 6.1. There are 25
EJB jars with an equal number of support jars, most of which are referenced
by multiple EJBs. There are also a large number of jsps, and html pages.
I have tried packaging an ear that contains the 25 ejb jars, a war file
containing the web pages. I have attempted to include the support jars in
the ear as well.
In all attempts, the only way I get class references sastisfied is to
include all the jars on the system CLASSPATH. But this defeats the purpose
of packaging, since none of the components referenced in the system
CLASSPATH will be re-deployable.
The online documents refer to separate class loaders and classpaths for the
war and ejbs, but no detail as to how classes are found by the loaders.
Unless I put all the jars into the CLASSPATH, jsp pages cannot reference the
EJBs, and EJBs are unable to reference other EJBs.Thanks,
Now if I could just get Webgain Visual Cafe to allow me to include the
Classpath entries in the generated manifests for the EJB jars.
"Gregory Gerard" <[email protected]> wrote in message
news:3ba24da1$[email protected]..
You need to mangle all the Manifest files within the EAR and EJB-JARs and
WAR to get the right thing to happen. Check out this PDF on Sun's site:
http://java.sun.com/j2ee/j2ee-1_3-pfd4-spec.pdf
section 8.1.1.2
I don't entirely understand all the restrictions and formatting -- Ihaven't
found an example ear file out there that implements a non-trivial case.
greg
"Carl Lawstuen" <[email protected]> wrote in message
news:3ba21d8e$[email protected]..
I am trying to migrate an application from WLS 5.1 to 6.1. There are
25
EJB jars with an equal number of support jars, most of which arereferenced
by multiple EJBs. There are also a large number of jsps, and htmlpages.
I have tried packaging an ear that contains the 25 ejb jars, a war file
containing the web pages. I have attempted to include the support jarsin
the ear as well.
In all attempts, the only way I get class references sastisfied is to
include all the jars on the system CLASSPATH. But this defeats thepurpose
of packaging, since none of the components referenced in the system
CLASSPATH will be re-deployable.
The online documents refer to separate class loaders and classpaths forthe
war and ejbs, but no detail as to how classes are found by the loaders.
Unless I put all the jars into the CLASSPATH, jsp pages cannot referencethe
EJBs, and EJBs are unable to reference other EJBs. -
Hi All,
I have a command line program which access database and somehow connects to a servlet running in Tomcat.
Originally, the root directory has 2 sub-directories: the classes and the lib. The classes directory contains config files, like database name, port no... The lib dir contains all the jar files needed by my program to run.
Honestly, it run using: java -cp /path/to/dir/jar1.jar;/path/to/dir/jar2.jar,....
But the program uses many jar files, more or less 20 jar files, and many config files. And Its not convenient to run the program using the command above.
So, I made a manifest file, manifest.mnf, and saved it under the classes dir:
Manifest-Version: 1.0
Main-Class: ManualSend
Class-Path: ..\lib\bsiclient.jar
..\lib\msh.jar
..\classes\dbojects.properties
..\classes\config.xml
..\classes\jndi.properties
..\classes\log4j.properties
..\classes\msh_client.properties.xml
..\classes\sql.properties
..\lib\activation.jar
..\lib\avalon-framework-4.1.4.jar
..\lib\batik.jar
..\lib\bsi.jar
..\lib\bcmail-jdk13-115.jar
..\lib\commons-beanutils.jar
..\lib\commons-codec-1.2.jar
..\lib\commons-collections-3.1.jar
..\lib\commons-logging.jar
..\lib\commons-configuration-1.0.jar
..\lib\commons-digester.jar
..\lib\commons-lang-2.0.jar
..\lib\cos.jar lib\dom.jar
....etc.
The ManualSend class is in bsiclient.jar. It used the default package.
I run it in classes dir: jar -cvfm test.jar
java -jar test.jar
I got an error, saying:
Error in building: \classes\test.jar!\msh_client.properties.xml (The filename, directory name, or volume label sntax is incorrect).
I can't figure it out, so for the meantime, i just changed the '..\classes\' part of my manifest to '.\'
I'm not happy with that. I want it to run from my root directory, using /lib and /classes subdirectories.
Is there a way to do that? Really i'm confused with these classpath thing.
Please, any comments, opinions, suggestions.... even violent reactions are greatly appreciated. I haven't received any feedbacks with any of my previous post in all of forums.
Thanks,thanks Peter,
I've attempted that approach before. But as i've said my program needs a lot of jar files, plus a number of config files. If i write them on one single Class-Path line, i got an error saying 'commands too long lines', or something like that.
The manifest works fine. I am able to run the program using that manifest. But I'm not happy with that. Actually the program was based on a Tomcat webapp. I am actually doing a command-line version of it.
So it Tomcat WEB-INF, classes and lib directories were separated. I am looking for a way to use these 2 separate directories. What I would like to find out is how to run my program, outside of the WEB-INF classes and lib directories, and at the same time could access all the jars and config files in them.
As of the moment I had no luck of doing that. I had to run the program inside classes folder, and make a copy of lib folder inside the classes folder.
Do you have any more suggestions, opinions? Please. -
Problems with signed jar, HTTPS and forms 10.1.2.3
I have been facing a hard problem for some days concerning jar signed and HTTPS. The server can be accessed both internally, on our intranet, by a local ip address, and externally, on the internet. The first access doesn't require https,as hosts are under our domain. Externally, however, we use https. That's de logic:
A local server , a proxy server (on our DMZ) and externals hosts (internet). The proxy server is responsible for getting the information on our local forms server, applying the https security and connection to the external reequests.
Concerning my application, it uses some signed jars. All of them were signed by using 'sign_webutil.bat', located in java bin directory.
When the access is made internally, everything works fine. The jar files are downloaded correctly on the user machine and the applets run well. On the other hand, when we the access is made on internet, we get many errors concerning the classes inside frwebutil:
network: Connecting https://200.253.113.26/forms/java/oracle/forms/webutil/clientInfo/GetClientInfo.class with cookie "JSESSIONID=4D4A8E49A46D4134112177FBACABE7B4"
java.lang.ClassNotFoundException: oracle.forms.webutil.clientInfo.GetClientInfo
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:https://200.253.113.26/forms/java/oracle/forms/webutil/clientInfo/GetClientInfo.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
I don't know what to do.Hi, Michael!
Thanks for your reply. I read the article you suggested and I signed ther many jar files I use with the same certificate, however the problem remais the same. Without HTTPS, all works fine. With HTTPS:
network: Cache entry not found [url: https://200.253.113.26/forms/java/oracle/forms/webutil/clientInfo/GetClientInfo.class, version: null]
network: Connecting https://200.253.113.26/forms/java/oracle/forms/webutil/clientInfo/GetClientInfo.class with proxy=DIRECT
network: Connecting https://200.253.113.26/forms/java/oracle/forms/webutil/clientInfo/GetClientInfo.class with cookie "JSESSIONID=08AA4CF07F761424418619C068213911"
java.lang.ClassNotFoundException: oracle.forms.webutil.clientInfo.GetClientInfo
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:https://200.253.113.26/forms/java/oracle/forms/webutil/clientInfo/GetClientInfo.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 20 more
network: Cache entry not found [url: https://200.253.113.26/lib/oracle/forms/webutil/file/FileFunctions.class, version: null]
network: Connecting https://200.253.113.26/lib/oracle/forms/webutil/file/FileFunctions.class with proxy=DIRECT
network: Cache entry not found [url: https://200.253.113.26/forms/java/oracle/forms/webutil/file/FileFunctions.class, version: null]
network: Connecting https://200.253.113.26/forms/java/oracle/forms/webutil/file/FileFunctions.class with proxy=DIRECT
network: Connecting https://200.253.113.26/forms/java/oracle/forms/webutil/file/FileFunctions.class with cookie "JSESSIONID=08AA4CF07F761424418619C068213911"
java.lang.ClassNotFoundException: oracle.forms.webutil.file.FileFunctions
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:https://200.253.113.26/forms/java/oracle/forms/webutil/file/FileFunctions.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 20 more
network: Cache entry not found [url: https://200.253.113.26/lib/oracle/forms/webutil/host/Host.class, version: null]
network: Connecting https://200.253.113.26/lib/oracle/forms/webutil/host/Host.class with proxy=DIRECT
network: Cache entry not found [url: https://200.253.113.26/forms/java/oracle/forms/webutil/host/Host.class, version: null]
network: Connecting https://200.253.113.26/forms/java/oracle/forms/webutil/host/Host.class with proxy=DIRECT
network: Connecting https://200.253.113.26/forms/java/oracle/forms/webutil/host/Host.class with cookie "JSESSIONID=08AA4CF07F761424418619C068213911"
java.lang.ClassNotFoundException: oracle.forms.webutil.host.Host
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:https://200.253.113.26/forms/java/oracle/forms/webutil/host/Host.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 20 more
network: Cache entry not found [url: https://200.253.113.26/lib/oracle/forms/webutil/session/SessionFunctions.class, version: null]
network: Connecting https://200.253.113.26/lib/oracle/forms/webutil/session/SessionFunctions.class with proxy=DIRECT
network: Cache entry not found [url: https://200.253.113.26/forms/java/oracle/forms/webutil/session/SessionFunctions.class, version: null]
network: Connecting https://200.253.113.26/forms/java/oracle/forms/webutil/session/SessionFunctions.class with proxy=DIRECT
network: Connecting https://200.253.113.26/forms/java/oracle/forms/webutil/session/SessionFunctions.class with cookie "JSESSIONID=08AA4CF07F761424418619C068213911"
java.lang.ClassNotFoundException: oracle.forms.webutil.session.SessionFunctions
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:https://200.253.113.26/forms/java/oracle/forms/webutil/session/SessionFunctions.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 20 more
network: Cache entry not found [url: https://200.253.113.26/lib/oracle/forms/webutil/fileTransfer/FileTransfer.class, version: null]
network: Connecting https://200.253.113.26/lib/oracle/forms/webutil/fileTransfer/FileTransfer.class with proxy=DIRECT
network: Cache entry not found [url: https://200.253.113.26/forms/java/oracle/forms/webutil/fileTransfer/FileTransfer.class, version: null]
network: Connecting https://200.253.113.26/forms/java/oracle/forms/webutil/fileTransfer/FileTransfer.class with proxy=DIRECT
network: Connecting https://200.253.113.26/forms/java/oracle/forms/webutil/fileTransfer/FileTransfer.class with cookie "JSESSIONID=08AA4CF07F761424418619C068213911"
java.lang.ClassNotFoundException: oracle.forms.webutil.fileTransfer.FileTransfer
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:https://200.253.113.26/forms/java/oracle/forms/webutil/fileTransfer/FileTransfer.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 20 more
network: Cache entry not found [url: https://200.253.113.26/lib/oracle/forms/webutil/ole/OleFunctions.class, version: null]
network: Connecting https://200.253.113.26/lib/oracle/forms/webutil/ole/OleFunctions.class with proxy=DIRECT
network: Cache entry not found [url: https://200.253.113.26/forms/java/oracle/forms/webutil/ole/OleFunctions.class, version: null]
network: Connecting https://200.253.113.26/forms/java/oracle/forms/webutil/ole/OleFunctions.class with proxy=DIRECT
network: Connecting https://200.253.113.26/forms/java/oracle/forms/webutil/ole/OleFunctions.class with cookie "JSESSIONID=08AA4CF07F761424418619C068213911"
java.lang.ClassNotFoundException: oracle.forms.webutil.ole.OleFunctions
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:https://200.253.113.26/forms/java/oracle/forms/webutil/ole/OleFunctions.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 20 more
network: Cache entry not found [url: https://200.253.113.26/lib/oracle/forms/webutil/cApi/CApiFunctions.class, version: null]
network: Connecting https://200.253.113.26/lib/oracle/forms/webutil/cApi/CApiFunctions.class with proxy=DIRECT
network: Cache entry not found [url: https://200.253.113.26/forms/java/oracle/forms/webutil/cApi/CApiFunctions.class, version: null]
network: Connecting https://200.253.113.26/forms/java/oracle/forms/webutil/cApi/CApiFunctions.class with proxy=DIRECT
network: Connecting https://200.253.113.26/forms/java/oracle/forms/webutil/cApi/CApiFunctions.class with cookie "JSESSIONID=08AA4CF07F761424418619C068213911"
java.lang.ClassNotFoundException: oracle.forms.webutil.cApi.CApiFunctions
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:https://200.253.113.26/forms/java/oracle/forms/webutil/cApi/CApiFunctions.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 20 more
network: Cache entry not found [url: https://200.253.113.26/lib/oracle/forms/webutil/browser/BrowserFunctions.class, version: null]
network: Connecting https://200.253.113.26/lib/oracle/forms/webutil/browser/BrowserFunctions.class with proxy=DIRECT
network: Cache entry not found [url: https://200.253.113.26/forms/java/oracle/forms/webutil/browser/BrowserFunctions.class, version: null]
network: Connecting https://200.253.113.26/forms/java/oracle/forms/webutil/browser/BrowserFunctions.class with proxy=DIRECT
network: Connecting https://200.253.113.26/forms/java/oracle/forms/webutil/browser/BrowserFunctions.class with cookie "JSESSIONID=08AA4CF07F761424418619C068213911"
java.lang.ClassNotFoundException: oracle.forms.webutil.browser.BrowserFunctions
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:https://200.253.113.26/forms/java/oracle/forms/webutil/browser/BrowserFunctions.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 20 more
network: Connecting https://200.253.113.26/forms/lservlet;jsessionid=08AA4CF07F761424418619C068213911 with proxy=DIRECT
network: Connecting https://200.253.113.26/forms/lservlet;jsessionid=08AA4CF07F761424418619C068213911 with cookie "JSESSIONID=08AA4CF07F761424418619C068213911"
network: Connecting https://200.253.113.26/forms/lservlet;jsessionid=08AA4CF07F761424418619C068213911 with proxy=DIRECT
network: Connecting https://200.253.113.26/forms/lservlet;jsessionid=08AA4CF07F761424418619C068213911 with cookie "JSESSIONID=08AA4CF07F761424418619C068213911"
basic: Applet started -
How to Add JAR files and Config files to CLASSPATH at runtime?
QUERY:
During runtime, I need to load the JAR files and relevant config files( .cfg files and .properties file) into CLASSPATH and run a specific java program from one of the JAR which is available in CLASSPATH.
Please advise me any relevant Java API details or a sample java program to implement the above use case.
Thanks in advance.During runtime, I need to load the JAR files and relevant config files( .cfg files and .properties file) into CLASSPATH and run a specific java program from one of the JAR which is available in CLASSPATH.
Please advise me any relevant Java API details or a sample java program to implement the above use case.
You don't add to YOUR classpath once your app is launched.
You create a NEW process for the app you want to run and provide the proper environment for it to run in - including any PATH or CLASSPATH environment variables.
The Java API for the ProcessBuilder class has a simple example that shows how to create the arguments and launch an external application.
ProcessBuilder (Java Platform SE 7 )
There are also PLENTY of other examples of using ProcessBuilder; just search the net. -
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. -
Problem in setting path and classpath for java in RedHat linux 9
Hi ,
i am not able to set the PATH and CLASSPATH for j2sdk1.4.2_06
I have tried with export PATH=$PATH:/usr/j2sdk1.4.2_06/bin
and export CLASSPATH=$CLASSPATH:/usr/j2sdk1.4.2_06/lib
in terminal
but i want to configure it as permenant way for the jre and jdk
and we should only type java or javac according to the requirement
regards mihir...type those in .bashrc ... save and exit
then at prompt, type 'source .bashrc'
this is the permanent solution ...
bhalo thakun
Maybe you are looking for
-
In Billing Base Price should be in grey mode and in Sales order Change mode
Hi I have one requirenment the Base price (ZPR0) should pick automatically from condition records and system should allow to change ZPR0 in Sales Order item level , where as it should be Grey mode in billing document item level. 1. In the condition t
-
How do I create an object with code?
I have a flash cs3 file in which I have created a simple movieclip (square) by drawing a rectangle on the stage of that movieclip. When I drag that into another movieclip (clip) I am able to set properties for it such as x and y position by adding a
-
ESS - SAP ECC 6.0/EP7 - Personal Info/Control Record
Hi, During configuration for ESS on SAP ECC 6.0/EP7 , I received an error for 'Control Record XX not found' when selecting the Address and Personal Data services under Personal Information area on the portal side. This occurred for one of our countr
-
RMI over different subnets causing TCP BAD CHECKSUM
I have a customer that is trying to run my system over different subnets and is getting large performance hits due to a TCP BAD CHECKSUM error that they have been able to monitor when they have the RMI server on one subnet and the RMI client on anoth
-
Does allowing adobe flash player plug in on safari give access to websites the ability to upload and transfer documents and files(on the computer) without permission? Perhaps to their online server or somewhere where they designated them to transfer