Class loader problem in 10.1.0.2.0
I am using oracle.jar version 9.0.2.0.0 in my product, this oracle.jar don't have the classes like oracle/jdbc/driver/DatabaseError. In our new release of the same product we are decided to use 10.1.0.2.0, this is also works fine. When I upgrade my product from old version to new one. It throws the following error in our log file
java.lang.NoClassDefFoundError: oracle/jdbc/driver/DatabaseError
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:306)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:271)
at oracle.jdbc.driver.T4C7Ocommoncall.receive(T4C7Ocommoncall.java:125)
at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:384)
at oracle.jdbc.driver.PhysicalConnection.close(PhysicalConnection.java:1035)
If any one know, the solution of this problem, pls give me the suggestion
user469244,
I assume you are referring to Oracle's JDBC driver. I am unfamiliar with the "oracle.jar" file. I use the "ojdbc14.jar" file and it does contain the "oracle.jdbc.driver.DatabaseError" class. What is this "oracle.jar" file you mention?
Perhaps you could post the entire error message (and stack trace) you are getting, as well as the section of your code that is causing the error?
Good Luck,
Avi.
Similar Messages
-
Application Class Loader problem calling virtual function
Hello everyone
I have run in to very strange behavior of JVM
I have created a class loader which allows my to load classes from
jar file, regardless that URLClassLoader supplies this functionality.
I am using this class loader to load some classes and call their virtual functions. The class diagram looks like that:
public interface I {
public void init();
public class AAA implements
public void init(){
public class BBB extends AAA{
public void init(){
//here comes implementation
}Interface I and class AAA are loaded with System Class loader and Class BBB is loaded using my class loader from jar file.
ByteStreamClassLoader classLoader = new ByteStreamClassLoader ();
Class cl = classLoader. loadClass(�com.product.BBB�,true);
I myInterface = cl.newInstance();
myInterface.init();The problem is that from some unknown reason java class AAA.init() instead of BBB.init().
Can somebody help me what am I doing wrong?
Class Loader code attached below
public class ByteStreamClassLoader extends ClassLoader {
protected HashMap m_cache = new HashMap();
public void clearCashe() {
m_cache = new HashMap();
private String definePackage(String className) {
StringBuilder strB = new StringBuilder();
//Class name must be removed from the URI in order to define a package
String[] packageArray = className.split("\\.");
for (int i = 0; i < packageArray.length - 1; i++) {
strB.append(packageArray).append(".");
String packageName = strB.toString();
packageName = packageName.substring(0, packageName.length() - 1);
if (getPackage(packageName) == null) {
m_logger.log(Level.FINEST, "Defining package '" + packageName + "'");
definePackage(packageName, null, null, null, null, null, null, null);
return packageName;
public synchronized Class loadClass(String name, boolean resolve) throws
ClassNotFoundException {
name = name.replaceAll("/", ".").replaceAll(".class", "");
//Try to locate the Class in cashe
Class c = (Class) m_cache.get(name);
//Try to locate the Class in the System Class Loader
if (c == null) {
try {
c = ClassLoader.getSystemClassLoader().loadClass(name);
catch (Exception ex) {}
else {
m_logger.log(Level.FINEST, "Class '" + name + "' found in cache");
//Load the class from byte array
if (c == null) {
String resourceName = name;
if (!resourceName.endsWith(".class")) {
resourceName = resourceName.concat(".class");
//Retrieve class byte representation
if (resourceName.indexOf(".") != -1) {
resourceName =
resourceName.replaceAll("\\.", "/").replaceAll("/class", ".class");
//Use the ByteStreamClassLoader to load the class from byte array
byte[] classByteArray = null;
try {
classByteArray = getResourceBytes(resourceName);
catch (IOException ex1) {
throw new ClassNotFoundException(
"Could not load class data." + ex1.getMessage());
m_logger.log(
Level.FINEST, "Loading class '" +
name + "' Byte Length: " + classByteArray.length);
String p = definePackage(name);
c = defineClass(
name,
classByteArray,
0,
classByteArray.length,
ByteStreamClassLoader.class.getProtectionDomain());
m_cache.put(name, c);
if (resolve) {
resolveClass(c);
return c;Hello everyone
I have run in to very strange behavior of JVM
I have created a class loader which allows my to load classes from
jar file, regardless that URLClassLoader supplies this functionality.
I am using this class loader to load some classes and call their virtual functions. The class diagram looks like that:
public interface I {
public void init();
public class AAA implements
public void init(){
public class BBB extends AAA{
public void init(){
//here comes implementation
}Interface I and class AAA are loaded with System Class loader and Class BBB is loaded using my class loader from jar file.
ByteStreamClassLoader classLoader = new ByteStreamClassLoader ();
Class cl = classLoader. loadClass(�com.product.BBB�,true);
I myInterface = cl.newInstance();
myInterface.init();The problem is that from some unknown reason java class AAA.init() instead of BBB.init().
Can somebody help me what am I doing wrong?
Class Loader code attached below
public class ByteStreamClassLoader extends ClassLoader {
protected HashMap m_cache = new HashMap();
public void clearCashe() {
m_cache = new HashMap();
private String definePackage(String className) {
StringBuilder strB = new StringBuilder();
//Class name must be removed from the URI in order to define a package
String[] packageArray = className.split("\\.");
for (int i = 0; i < packageArray.length - 1; i++) {
strB.append(packageArray).append(".");
String packageName = strB.toString();
packageName = packageName.substring(0, packageName.length() - 1);
if (getPackage(packageName) == null) {
m_logger.log(Level.FINEST, "Defining package '" + packageName + "'");
definePackage(packageName, null, null, null, null, null, null, null);
return packageName;
public synchronized Class loadClass(String name, boolean resolve) throws
ClassNotFoundException {
name = name.replaceAll("/", ".").replaceAll(".class", "");
//Try to locate the Class in cashe
Class c = (Class) m_cache.get(name);
//Try to locate the Class in the System Class Loader
if (c == null) {
try {
c = ClassLoader.getSystemClassLoader().loadClass(name);
catch (Exception ex) {}
else {
m_logger.log(Level.FINEST, "Class '" + name + "' found in cache");
//Load the class from byte array
if (c == null) {
String resourceName = name;
if (!resourceName.endsWith(".class")) {
resourceName = resourceName.concat(".class");
//Retrieve class byte representation
if (resourceName.indexOf(".") != -1) {
resourceName =
resourceName.replaceAll("\\.", "/").replaceAll("/class", ".class");
//Use the ByteStreamClassLoader to load the class from byte array
byte[] classByteArray = null;
try {
classByteArray = getResourceBytes(resourceName);
catch (IOException ex1) {
throw new ClassNotFoundException(
"Could not load class data." + ex1.getMessage());
m_logger.log(
Level.FINEST, "Loading class '" +
name + "' Byte Length: " + classByteArray.length);
String p = definePackage(name);
c = defineClass(
name,
classByteArray,
0,
classByteArray.length,
ByteStreamClassLoader.class.getProtectionDomain());
m_cache.put(name, c);
if (resolve) {
resolveClass(c);
return c; -
Plz help me out with class loader problem
hai forum members,
I have a code which loads class files from local disk.
It works fine with some classes ,
But i get this exception when i am selecting certain other class files
I am using jdeveloper.
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Filter (wrong name: project1/Filter)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at com.jutframe.JavaUnitTester.selectClass_actionPerformed(JavaUnitTester.java:449)
at com.jutframe.JavaUnitTester$7.actionPerformed(JavaUnitTester.java:338)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1766)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
JFileChooser jfilechooser=new JFileChooser();
Filterclass filter=new Filterclass();
//Set selection mode for file chooser
jfilechooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
//set file filter
jfilechooser.setFileFilter(filter);
int returnVal = jfilechooser.showOpenDialog(this);
if(returnVal == JFileChooser.APPROVE_OPTION)
try
String str = jfilechooser.getSelectedFile().getName();
String parent=jfilechooser.getSelectedFile().getParent();
// Create a File object on the root of the directory containing the class file
File file = new File(parent);
// Convert File to a URL
URL url = file.toURL();
URL[] urls = new URL[]{url};
// Create a new class loader with the directory
ClassLoader cl = new URLClassLoader(urls);
StringTokenizer st = new StringTokenizer(str,".");
String s = st.nextToken ();
Class c = cl.loadClass(s); //ERROR IS SHOWN IN THIS PARTICULAR LINE
Object instance=c.newInstance();
--------------------------------------------please help me trace my mistake.
thank you all.i think the problem that i have set a particular class path for my class files and my application loads files from that alone.
So plz tell me if theres any way to access the class path of a particular file dynamically?
regards -
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. -
Help Needed on a similar but not same class loader problem
Hi,
Please help...
There is a ClassLoader called MyLoader that overrides default findClass() method to decrypt already encrypted class files available in a separate jar file.
MyClass also contains a public static method launchMe() method that starts off with a call similar to loadClass("ApplicationMainClass");
The MyLoader class is also encrypted
I modified the default launcher (c) code to:
First find the encrypted MyLoader file then decrypt it and create a byte array.
The byte array, along with the system class loader and other required arguments, is passed to DefineClass native method (defined in jvm.dll)
Note: The system class loader class has been instantiated using static method ClassLoader.getSystemClassLoader() through Java's invocation API.
The DefineClass succeeds and I'm able to instantiate MyLoader and later call launchMe() to start application.
Now i come to the problem:
I'm not able to use any class other that those in rt.jar (i.e.standard classes) in MyLoader class. I end up with a runtime error ClassDefNotFoundError while trying to load any third party jar.
The classes i need are present in class path and also in the local jre's ext that i use to launch my app.
Although i can avoid using third party jar in MyLoader but if there is any way...
Piyushmake sure that third party jar resides in your library.....
or else put rt.jar and external jars under same folder
this is matter of path.... no else than this.......
cheers
Rajesh42 -
Dynamic class load problem..
Hello all,
I am rather new to this concept of creating class loaders.
I started on a simple test and landed into a problem right away. I have a Java class file stuffed away somewhere on m machine (at a location not on my CLASSPATH) . I just want to load that class dynamically. Here is my humble code :
import java.io.*;
public class DynamicClassLoadTest extends ClassLoader {
String classFileName;
String pathToClassFile;
public static void main(String[] args) {
try {
if(args.length != 2) {
System.out.println("Usage : java DynamicClassLoadTest <path to class file> <name of class file>");
System.exit(0);
System.out.println("MISSION: To dynamically load class " + args[1] + " from path : " + args[0]);
DynamicClassLoadTest dcl = new DynamicClassLoadTest();
Class cls = dcl.loadClass(args[1], args[0], true);
catch(Exception e) {
System.out.println("Mission failed with error : " + e);
e.printStackTrace();
public Class loadClass(String name, String path, boolean resolve)
throws ClassNotFoundException
this.pathToClassFile=path;
this.classFileName= name;
return (loadClass(name, resolve));
public Class loadClass(String name, boolean resolve)
throws ClassNotFoundException
try {
File f = new File(pathToClassFile, name + ".class");
if(!f.exists())
throw new ClassNotFoundException("Specified class not found");
FileInputStream fis = new FileInputStream(f);
long fileSize = f.length();
System.out.println("Size of class file = " + fileSize);
byte[] classBytes = new byte[(int) fileSize];
int r = fis.read(classBytes);
System.out.println("Bytes read is " + r + " and file size is " + fileSize + " and byte array length is " + classBytes.length);
Class c = defineClass(name, classBytes, 0, classBytes.length);
System.out.println("CLASS created..");
return c;
catch(Exception e) {
throw new ClassNotFoundException(e.getMessage());
When I execute as :
java DynamicClassLoadTest /Users/user1 JustTest
the below is printed on execution :
MISSION: To dynamically load class JustTest from path : /Users/user1
Size of class file = 421
Bytes read is 421 and file size is 421 and byte array length is 421
Exception in thread "main" java.lang.NoClassDefFoundError: java/lang/Object
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at java.lang.ClassLoader.defineClass(ClassLoader.java:431)
at DynamicClassLoadTest.loadClass(DynamicClassLoadTest.java:56)
at DynamicClassLoadTest.loadClass(DynamicClassLoadTest.java:33)
at DynamicClassLoadTest.main(DynamicClassLoadTest.java:18)
The class file has apparently been read fine - then why is this java/lang/object reference ?
Any tips would be of huge help.
Thanks.An extension to this.
What should I do when I have to load a jar dynamically ? I manage to load the main class of the jar successfully. But what about classes in the jar which are invoked by this class. Say we have case as below :
JustAJar.jar contains :
sh-2.05a$ jar tvf JustAJar.jar
0 Fri May 23 14:41:14 PDT 2003 META-INF/
70 Fri May 23 14:41:14 PDT 2003 META-INF/MANIFEST.MF
567 Fri May 23 14:40:52 PDT 2003 InvokeTheNext.class
475 Fri May 23 14:40:52 PDT 2003 InvokeMe.class
Now, InvokeMe is the class I instantiate :
public class InvokeMe {
public static void main(String[] args) {
System.out.println("Welcome to InvokeMe");
InvokeTheNext itn = new InvokeTheNext("InvokeMe");
InvokeTheNext is :
public class InvokeTheNext {
public InvokeTheNext(String str) {
System.out.println("Welcome to InvokeTheNext");
System.out.println("Recd ur msg " + str);
Now I manage to define and resolve the class InvokeMe, but when the class is invoked, the foll error is thrown :
Resolved class with name InvokeMe successfully
Welcome to InvokeMe
Mission failed with error : java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at InvokeForClassLoad.main(InvokeForClassLoad.java:46)
Caused by: java.lang.NoClassDefFoundError: InvokeTheNext
at InvokeMe.main(InvokeMe.java:4)
I tried loading the entire jar file into the CLASSPATH dynamically (using System.setProperty) but that doesnt help. Any inputs please ?
Thanks. -
WebLog 9 Class loader problem with an Inbound Resource Adapter
The following code
MessageEndpoint messageEndPoint = null;
InboundListener listener = null;
messageEndPoint = this.messageEndpointFactory.createEndpoint(null);
listener = (InboundListener) messageEndPoint;
causes a ClassCastException as the Listener class is packaged both in the ResourceAdapter and in the EAR
holding the MessageDrivenBean: same class but two
different class loaders !
How can I solve this problem ?Turning on Debugging, found the problem:
<[JCABindingManager] activationSpec=null>
<[JCABindingManager] The activationSpec is null, deActivation is skipped>
In the application.xml, I had
1. ejb (mdb) module and then
2. connector module
Changed the application.xml to
1. connector module and then
2. ejb (mdb) module
container then called endpointDeactivation on undeployment. -
Class loading problem with websphere 6.1
Hello
We have a jsf application that works fine with tomcat as well as jboss. Now we need to deploy on websphere 6.1 and encounter some problem.
We followed the specifications of this link [regarding jsf and Weblogic|http://www-01.ibm.com/support/docview.wss?uid=swg21243668] , i.e. made the myfaces jars a shared library (left tomahawk libs in webapp though).
Now i get java.lang.ClassCastException: javax.faces.component.UIViewRoot incompatible with com.opentext.docviewer.ui.component.toolbar.Toolbar
at com.opentext.docviewer.ui.component.toolbar.ToolbarTag.setProperties(ToolbarTag.java:66)
at javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:536)
at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:312)
at com.ibm._jsp._toolbar._jspx_meth_dv_toolBar_0(_toolbar.java:183)
at com.ibm._jsp._toolbar._jspService(_toolbar.java:87)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)I wrote a small jsp page that showed me the clasloader order of the class javax.faces.component.UIViewRoot and got this:
System path
Webapp path
* bundleresource://31/javax/faces/component/UIViewRoot.class
* wsjar:file:/E:/shared/myfaces/myfaces-api-1.1.4.jar!/javax/faces/component/UIViewRoot.class
So somehow there is a "bundleresource"?
I changed the classloading mechanisms accoording to the link mentioned above, but now i run out of ideas :-(
Regards
Edited by: mark1971 on Sep 10, 2008 2:21 AMHi Per,
Is this a reproducible exception? Looking at the source code, it comes from an impossible place:
try
// commit logic
catch (RuntimeException e)
log("CoherenceRA: Commit failed:\n" + getStackTrace(e));
rollback();
LocalTransactionException lte = new LocalTransactionException(e.toString()); // line 37!!!
lte.setLinkedException(e);
throw lte;
}As you can see, the NPE on line 37 could only come as a result of the "e == null" condition, which would be against the "catch" contract.
I wonder if you run any profiling, debugging tool or AOP framework that "instruments" the resource adapter code and causes an NPE in a place that cannot throw it?
Regards,
Gene -
Apparent EJB Class Loader Issue
I am having a problem loading narrowing an EJB. It appears to be a class loader
problem. I am getting a ClassCastException with the following message: Cannot
narrow remote object to com.dte.ejb.facade.AccessoryServiceHome.
Here is my code that looks up the EJB (I've ommitted the 'catch' clauses):
EJBHome ejbHome = (EJBHome) cache.get(homeClass);
try {
Object temp = ctx.lookup("ejb/" + homeClass.getName());
if (ejbHome == null) {
ejbHome = (EJBHome) PortableRemoteObject.narrow(temp, homeClass);
cache.put(homeClass, ejbHome);
Here is the output of some debugging information from the above method. Here I've
displayed the class.getName and the class.getClassLoader for the Class object
passed to this method and the remote object being cast by the narrow method:
homeClass : com.dte.ejb.facade.AccessoryServiceHome
homeClass : weblogic.utils.classloaders.ChangeAwareClassLoader@29164c finder:
weblogic.utils.classloaders.MultiClassFinder@300ec4
From Lookup: com.dte.ejb.facade.AccessoryServiceBean_krx5el_HomeImpl
From Lookup: weblogic.utils.classloaders.GenericClassLoader@1ea02f finder: weblogic.utils.classloaders.MultiClassFinder@6fca08
As you can see, the Class passed into this method has been loaded with the ChangeAwareClassLoader
but the HomeImpl class was loaded with the GenericClassLoader. I think that is
the problem (please correct me if I am wrong).
The application in question is an .ear with 2 .war modules and a ejb.jar file.
It was my understanding that all classes needed by any module in a .ear were all
loaded with the same class loader. Is this true? If so, then why am I having this
problem?
Thank you in advance for your help.I just want to add few comments hoping the iPlanet engineer will be able to help me.
I mange to get one deployment of a war file with the client weblogic EJB to work; only if I add the Installation Directory path of the war file plus “web-inf/classes” to the classpath of the JVM configuration.
This tells me that the class loader looks for the JVM classpath to load the EJB home class at run time. I think; if I can make iPlanet class loader to look for the application classpath instead of the JVM my problem will go away.
Thank you in advance,
Nad -
MBean calling ejb class loading issue
Hi,
I would like to have an mbean call an ejb. I have come against a (predictable!!)
class loading problem. The EJB Home cant be bundled with the mbean because the
mbean class loader would load the interface, preventing ejb reload( Thats what
the error msg indicates) and the ejb doesnt get deployed.
I have moved to an mlet based scheme (beacuse an mlet is a class loader) to
load the mbeans, but now I have the problem that when the mbean looks up the
home in jndi the cast fails ie the jndi object has an interface class loaded by
the ejb class loader but the mlet has its own loaded home interface. These class
loaders appear to be sibblings - but I havnt printed out the trees.
This is WLS 702 which seems to be JMX 1.1. Has anyone got a way around this?
Have I invented a problem that doesnt exist? I cant go to WLS8.
My current way forward is to have the mbean find the class loader that loaded
the interface class (jndi object) and then have the mbean use that class loader
to load its copy of the interface class. Seems a bit complex. Im sure I missed
something obvious.
Thanks
Pete MarshallPete,
could you explain better your thoughts...
I'm interested to hear them.
regards,
Pedro Salazar.
Pete Marshall wrote:
Must think before typing..
If I have the ejb register a listener on the mbean and have the mbean emit an
event the detyped notification from the mbean will break the link between the
mbean class loader and the ejb loader. I think ;-) Ill try it.
Pete
"Pete Marshall" <[email protected]> wrote:
Hi,
I would like to have an mbean call an ejb. I have come against a (predictable!!)
class loading problem. The EJB Home cant be bundled with the mbean because
the
mbean class loader would load the interface, preventing ejb reload( Thats
what
the error msg indicates) and the ejb doesnt get deployed.
I have moved to an mlet based scheme (beacuse an mlet is a class loader)
to
load the mbeans, but now I have the problem that when the mbean looks
up the
home in jndi the cast fails ie the jndi object has an interface class
loaded by
the ejb class loader but the mlet has its own loaded home interface.
These class
loaders appear to be sibblings - but I havnt printed out the trees.
This is WLS 702 which seems to be JMX 1.1. Has anyone got a way around
this?
Have I invented a problem that doesnt exist? I cant go to WLS8.
My current way forward is to have the mbean find the class loader that
loaded
the interface class (jndi object) and then have the mbean use that class
loader
to load its copy of the interface class. Seems a bit complex. Im sure
I missed
something obvious.
Thanks
Pete Marshall -
Re: MBean calling ejb class loading issue
Must think before typing..
If I have the ejb register a listener on the mbean and have the mbean emit an
event the detyped notification from the mbean will break the link between the
mbean class loader and the ejb loader. I think ;-) Ill try it.
Pete
"Pete Marshall" <[email protected]> wrote:
>
Hi,
I would like to have an mbean call an ejb. I have come against a (predictable!!)
class loading problem. The EJB Home cant be bundled with the mbean because
the
mbean class loader would load the interface, preventing ejb reload( Thats
what
the error msg indicates) and the ejb doesnt get deployed.
I have moved to an mlet based scheme (beacuse an mlet is a class loader)
to
load the mbeans, but now I have the problem that when the mbean looks
up the
home in jndi the cast fails ie the jndi object has an interface class
loaded by
the ejb class loader but the mlet has its own loaded home interface.
These class
loaders appear to be sibblings - but I havnt printed out the trees.
This is WLS 702 which seems to be JMX 1.1. Has anyone got a way around
this?
Have I invented a problem that doesnt exist? I cant go to WLS8.
My current way forward is to have the mbean find the class loader that
loaded
the interface class (jndi object) and then have the mbean use that class
loader
to load its copy of the interface class. Seems a bit complex. Im sure
I missed
something obvious.
Thanks
Pete MarshallPete,
could you explain better your thoughts...
I'm interested to hear them.
regards,
Pedro Salazar.
Pete Marshall wrote:
Must think before typing..
If I have the ejb register a listener on the mbean and have the mbean emit an
event the detyped notification from the mbean will break the link between the
mbean class loader and the ejb loader. I think ;-) Ill try it.
Pete
"Pete Marshall" <[email protected]> wrote:
Hi,
I would like to have an mbean call an ejb. I have come against a (predictable!!)
class loading problem. The EJB Home cant be bundled with the mbean because
the
mbean class loader would load the interface, preventing ejb reload( Thats
what
the error msg indicates) and the ejb doesnt get deployed.
I have moved to an mlet based scheme (beacuse an mlet is a class loader)
to
load the mbeans, but now I have the problem that when the mbean looks
up the
home in jndi the cast fails ie the jndi object has an interface class
loaded by
the ejb class loader but the mlet has its own loaded home interface.
These class
loaders appear to be sibblings - but I havnt printed out the trees.
This is WLS 702 which seems to be JMX 1.1. Has anyone got a way around
this?
Have I invented a problem that doesnt exist? I cant go to WLS8.
My current way forward is to have the mbean find the class loader that
loaded
the interface class (jndi object) and then have the mbean use that class
loader
to load its copy of the interface class. Seems a bit complex. Im sure
I missed
something obvious.
Thanks
Pete Marshall -
I am using Sun implementation of JAXB(jaxb-api.jar) for java-to-xml binding in my web application deployed in the latest version of oracle app server(10g release 3). The web server is loading Oracle implementation of JAXB from the shared archive xml.jar. To direct the web server to load application specific JAXB classes, I have used the property(<web-app-class-loader search-local-classes-first="true" include-war-manifest-class-path="false" />) in the deployment description - orion.xml file. But it does not solve the problem!
Thanks & regardsHi,
Refer to this link on OC4J's Classloading Framework... http://download-east.oracle.com/docs/cd/B25221_04/web.1013/b14433/classload.htm#sthref58 there are a couple of options you may be able to employ, including overriding the shared library - there is an example of doing this with the Oracle XML parser and Xerces.
I'm guessing you're on the right track, but you may want to try include-war-manifest-class-path="true". Also, are you sure that you've got your deployment descriptor file defined correctly? Its normally called orion-application.xml, and that particular element isn't defined in the documentation (http://download-east.oracle.com/docs/cd/B25221_04/web.1013/b14433/descriptors.htm#sthref337). You could always try configuring it through the administration console. -
Cocoon2 weblogic (5.1 sp6) class loader security problem
Hello folks,
System:
Cocoon: v2.0
JDK: Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C),
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
OS: NT4 SP5
Servlet: v2.2
AppServer: Weblogic 5.1 SP6
Symptoms:
I've updated our application from Cocoon 1.7.4 to Cocoon2. After I
figured out what libraries I need on the Weblogic's classpath, I managed
to envoke the MyServlet (MyServlet extends CocoonServlet). The technique
I am using is the one I used with the Cocoon v1.7.4: extend Cocoon
servlet and wrap the HttpServletRequest in MyRequest to provide the XML
content. I changed the line <map:generators default="request"> in
sitemap.xmap to specify the location of the source. Configuration files
seem to be read correctly and the file
<myWebAppContext>/WEB-INF/_tmp_war/org/apache/cocoon/www/sitemap_xmap.java
is generated (but there is no class file generated)!
I looked at the cocoon.log file and looks like a class loader security
problem: the \WEB-INF\_tmp_war gets locked! Is there any workaround this
problem? Any help is much appreciated!
cocoon.log file generated:
DEBUG 62 [cocoon ] (ExecuteThread-11): Using configuration file:
/cocoon.xconf
INFO 62 [cocoon ] (ExecuteThread-11): Reloading from:
file:D:/Programs/cocoon-1.8.2/samples/cocoon.xconf
DEBUG 93 [cocoon ] (ExecuteThread-11): New Cocoon object.
DEBUG 93 [cocoon ] (ExecuteThread-11): Using parser:
org.apache.cocoon.components.parser.JaxpParser
DEBUG 109 [cocoon ] (ExecuteThread-11): Creating Repository with
this directory: D:\programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war
DEBUG 109 [cocoon ] (ExecuteThread-11): Classpath =
D:\Programs\cocoon-1.8.2\samples\WEB-INF\classes;D:\Programs\cocoon-1.8.2\samples\WEB-INF\lib\javac.jar;D:\avue\lib\servlet.jar;D:\avue\lib\jaxp.jar;D:\avue\lib\xerces.jar;D:\avue\lib\xalan.jar;D:\avue\lib\cocoon.jar;D:\avue\lib\avalonapi.jar;D:\avue\lib\logkit.jar;D:\avue\lib\maybeupload.jar;D:\avue\lib\jakarta-regexp-1.2.jar;D:\avue\lib\jstyle.jar;D:\avue\lib\javac.jar;D:\weblogic\lib\weblogic510sp6boot.jar;D:\weblogic\classes\boot;
DEBUG 109 [cocoon ] (ExecuteThread-11): Work directory =
D:\Programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war
DEBUG 125 [cocoon ] (Thread-0): ComponentFactory creating new
instance of org.apache.cocoon.components.parser.JaxpParser.
DEBUG 140 [cocoon ] (Thread-0): ComponentFactory creating new
instance of org.apache.cocoon.components.parser.JaxpParser.
DEBUG 140 [cocoon ] (Thread-0): ComponentFactory creating new
instance of org.apache.cocoon.components.parser.JaxpParser.
DEBUG 140 [cocoon ] (Thread-0): ComponentFactory creating new
instance of org.apache.cocoon.components.parser.JaxpParser.
DEBUG 390 [cocoon ] (ExecuteThread-11): Root configuration:
cocoon
DEBUG 390 [cocoon ] (ExecuteThread-11): Configuration version:
2.0
DEBUG 390 [cocoon ] (ExecuteThread-11): Setting up components...
DEBUG 406 [cocoon ] (ExecuteThread-11): Adding component
(org.apache.cocoon.components.parser.Parser =
org.apache.cocoon.components.parser.JaxpParser)
DEBUG 406 [cocoon ] (ExecuteThread-11): Adding component
(org.apache.cocoon.components.language.generator.ProgramGenerator =
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl)
DEBUG 406 [cocoon ] (ExecuteThread-11): Adding component
(org.apache.cocoon.components.url.URLFactory =
org.apache.cocoon.components.url.URLFactoryImpl)
DEBUG 406 [cocoon ] (ExecuteThread-11): Adding component
(org.apache.cocoon.components.saxconnector.SAXConnector =
org.apache.cocoon.components.saxconnector.NullSAXConnector)
DEBUG 422 [cocoon ] (ExecuteThread-11): Adding component
(org.apache.avalon.util.datasource.DataSourceComponentSelector =
org.apache.cocoon.components.CocoonComponentSelector)
DEBUG 422 [cocoon ] (ExecuteThread-11): Adding component
(org.apache.avalon.util.pool.PoolController =
org.apache.cocoon.components.ComponentPoolController)
DEBUG 422 [cocoon ] (ExecuteThread-11): Adding component
(org.apache.cocoon.components.language.programming.ProgrammingLanguageSelector
= org.apache.cocoon.components.CocoonComponentSelector)
DEBUG 422 [cocoon ] (ExecuteThread-11): Adding component
(org.apache.cocoon.components.language.markup.MarkupLanguageSelector =
org.apache.cocoon.components.CocoonComponentSelector)
DEBUG 422 [cocoon ] (ExecuteThread-11): Adding component
(org.apache.cocoon.components.store.Store =
org.apache.cocoon.components.store.MemoryStore)
DEBUG 422 [cocoon ] (ExecuteThread-11): Adding component
(org.apache.cocoon.components.classloader.ClassLoaderManager =
org.apache.cocoon.components.classloader.ClassLoaderManagerImpl)
DEBUG 422 [cocoon ] (ExecuteThread-11): Setting up the sitemap.
DEBUG 422 [cocoon ] (ExecuteThread-11): Sitemap location =
sitemap.xmap
DEBUG 703 [cocoon ] (ExecuteThread-11): ComponentFactory creating
new instance of org.apache.cocoon.components.url.URLFactoryImpl.
DEBUG 703 [cocoon ] (ExecuteThread-11): Getting the URLFactories
DEBUG 703 [cocoon ] (ExecuteThread-11): for protocol:
resource org.apache.cocoon.components.url.ResourceURLFactory
DEBUG 718 [cocoon ] (ExecuteThread-11): for protocol: context
org.apache.cocoon.components.url.ContextURLFactory
DEBUG 718 [cocoon ] (ExecuteThread-11): Beginning sitemap
regeneration
DEBUG 718 [cocoon ] (ExecuteThread-11): Making URL from
file:/D:/Programs/cocoon-1.8.2/samples/sitemap.xmap
DEBUG 718 [cocoon ] (Thread-1): ComponentFactory creating new
instance of
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.
DEBUG 718 [cocoon ] (Thread-1): Could not find ComponentHandler,
attempting to create one for role:
org.apache.cocoon.components.language.generator.ServerPagesSelector
DEBUG 718 [cocoon ] (Thread-1): ComponentFactory creating new
instance of
org.apache.cocoon.components.language.generator.GeneratorSelector.
DEBUG 718 [cocoon ] (Thread-1): ComponentFactory creating new
instance of
org.apache.cocoon.components.classloader.ClassLoaderManagerImpl.
DEBUG 718 [cocoon ] (Thread-1): CocoonComponentSelector setting
up with root element:
DEBUG 718 [cocoon ] (Thread-1): ComponentFactory creating new
instance of org.apache.cocoon.components.CocoonComponentSelector.
DEBUG 718 [cocoon ] (Thread-1): CocoonComponentSelector setting
up with root element: markup-languages
DEBUG 734 [cocoon ] (Thread-1): Adding
org.apache.cocoon.components.language.markup.xsp.XSPMarkupLanguage for
xsp
DEBUG 734 [cocoon ] (Thread-1): Adding
org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage
for sitemap
DEBUG 734 [cocoon ] (Thread-1): ComponentFactory creating new
instance of org.apache.cocoon.components.CocoonComponentSelector.
DEBUG 734 [cocoon ] (Thread-1): CocoonComponentSelector setting
up with root element: programming-languages
DEBUG 750 [cocoon ] (Thread-1): ComponentFactory creating new
instance of
org.apache.cocoon.components.language.programming.java.JavaLanguage.
DEBUG 750 [cocoon ] (Thread-1): Looking up
org.apache.cocoon.components.classloader.ClassLoaderManager
DEBUG 750 [cocoon ] (Thread-1): Setting the parameters
DEBUG 750 [cocoon ] (Thread-1): Adding
org.apache.cocoon.components.language.programming.java.JavaLanguage for
java
DEBUG 765 [cocoon ] (Thread-1): The instance was not accessible,
creating it now.
DEBUG 765 [cocoon ] (Thread-1): ComponentFactory creating new
instance of
org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage.
DEBUG 1718 [cocoon ] (Thread-1): Making URL from
jar:file:/D:/avue/lib/cocoon.jar!/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
DEBUG 1718 [cocoon ] (Thread-1): Logicsheet
Used:jar:file:/D:/avue/lib/cocoon.jar!/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
WARN 4109 [cocoon ] (Thread-1): Could not load class for program
'org\apache\cocoon\www\sitemap_xmap'
java.security.AccessControlException: access denied
(java.io.FilePermission
\D:\Programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war\- read)
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
at
java.security.AccessController.checkPermission(AccessController.java:399)
at
java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
at java.net.URLClassLoader$5.run(URLClassLoader.java:463)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.getPermissions(URLClassLoader.java:461)
at
java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:162)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at
org.apache.cocoon.components.classloader.ClassLoaderManagerImpl.loadClass(ClassLoaderManagerImpl.java:58)
at
org.apache.cocoon.components.language.programming.java.JavaLanguage.loadProgram(JavaLanguage.java:121)
at
org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:119)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java:245)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:163)
at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
at java.lang.Thread.run(Thread.java:484)
DEBUG 4109 [cocoon ] (Thread-1): Language Exception
org.apache.cocoon.components.language.LanguageException: Could not load
class for program 'org\apache\cocoon\www\sitemap_xmap' due to a
java.security.AccessControlException: access denied
(java.io.FilePermission
\D:\Programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war\- read)
at
org.apache.cocoon.components.language.programming.java.JavaLanguage.loadProgram(JavaLanguage.java:124)
at
org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:119)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java:245)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:163)
at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
at java.lang.Thread.run(Thread.java:484)
DEBUG 4109 [cocoon ] (Thread-1): ComponentFactory decommissioning
instance of
org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage.
DEBUG 4109 [cocoon ] (Thread-1): Can't load ServerPage
org.apache.avalon.ComponentManagerException: Could not add component for
class: org.apache.cocoon.www.sitemap_xmap
at
org.apache.cocoon.components.language.generator.GeneratorSelector.addGenerator(GeneratorSelector.java:61)
at
org.apache.cocoon.components.language.generator.GeneratorSelector.select(GeneratorSelector.java:50)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.select(ProgramGeneratorImpl.java:263)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:172)
at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
at java.lang.Thread.run(Thread.java:484)
DEBUG 4109 [cocoon ] (Thread-1): ComponentFactory creating new
instance of
org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage.
DEBUG 4359 [cocoon ] (Thread-1): Making URL from
jar:file:/D:/avue/lib/cocoon.jar!/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
DEBUG 4359 [cocoon ] (Thread-1): Logicsheet
Used:jar:file:/D:/avue/lib/cocoon.jar!/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
WARN 6109 [cocoon ] (Thread-1): Could not load class for program
'org\apache\cocoon\www\sitemap_xmap'
java.security.AccessControlException: access denied
(java.io.FilePermission
\D:\Programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war\- read)
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
at
java.security.AccessController.checkPermission(AccessController.java:399)
at
java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
at java.net.URLClassLoader$5.run(URLClassLoader.java:463)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.getPermissions(URLClassLoader.java:461)
at
java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:162)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at
org.apache.cocoon.components.classloader.ClassLoaderManagerImpl.loadClass(ClassLoaderManagerImpl.java:58)
at
org.apache.cocoon.components.language.programming.java.JavaLanguage.loadProgram(JavaLanguage.java:121)
at
org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:119)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java:245)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:210)
at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
at java.lang.Thread.run(Thread.java:484)
DEBUG 6109 [cocoon ] (Thread-1): Language Exception
org.apache.cocoon.components.language.LanguageException: Could not load
class for program 'org\apache\cocoon\www\sitemap_xmap' due to a
java.security.AccessControlException: access denied
(java.io.FilePermission
\D:\Programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war\- read)
at
org.apache.cocoon.components.language.programming.java.JavaLanguage.loadProgram(JavaLanguage.java:124)
at
org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:119)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java:245)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:210)
at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
at java.lang.Thread.run(Thread.java:484)
DEBUG 6109 [cocoon ] (Thread-1): ComponentFactory decommissioning
instance of
org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage.
ERROR 6109 [cocoon ] (Thread-1): Error compiling sitemap
org.apache.avalon.ComponentManagerException: Could not add component for
class: org.apache.cocoon.www.sitemap_xmap
at
org.apache.cocoon.components.language.generator.GeneratorSelector.addGenerator(GeneratorSelector.java:61)
at
org.apache.cocoon.components.language.generator.GeneratorSelector.select(GeneratorSelector.java:50)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.select(ProgramGeneratorImpl.java:263)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:219)
at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
at java.lang.Thread.run(Thread.java:484)
DEBUG 6109 [cocoon ] (ExecuteThread-11): Changing Cocoon
context(sitemap.xmap) to prefix()
DEBUG 6109 [cocoon ] (ExecuteThread-11): from
context(file:/D:/Programs/cocoon-1.8.2/samples/) and prefix()
DEBUG 6109 [cocoon ] (ExecuteThread-11): at URI
DEBUG 6109 [cocoon ] (ExecuteThread-11): New context is
file:/D:/Programs/cocoon-1.8.2/samples/
ERROR 6140 [cocoon ] (ExecuteThread-11): Problem with servlet
org.apache.cocoon.ProcessingException: The sitemap handler's sitemap is
not available.
at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:106)
at org.apache.cocoon.Cocoon.process(Cocoon.java:218)
at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:417)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:123)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:761)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:708)
at
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:252)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:346)
at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:246)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)
INFO 6187 [cocoon ] (ExecuteThread-11): '' Processed by Apache
Cocoon 2.0a4 in 5.75 seconds.
================================================================
Regards,
GeorgiHello folks,
System:
Cocoon: v2.0
JDK: Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C),
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
OS: NT4 SP5
Servlet: v2.2
AppServer: Weblogic 5.1 SP6
Symptoms:
I've updated our application from Cocoon 1.7.4 to Cocoon2. After I
figured out what libraries I need on the Weblogic's classpath, I managed
to envoke the MyServlet (MyServlet extends CocoonServlet). The technique
I am using is the one I used with the Cocoon v1.7.4: extend Cocoon
servlet and wrap the HttpServletRequest in MyRequest to provide the XML
content. I changed the line <map:generators default="request"> in
sitemap.xmap to specify the location of the source. Configuration files
seem to be read correctly and the file
<myWebAppContext>/WEB-INF/_tmp_war/org/apache/cocoon/www/sitemap_xmap.java
is generated (but there is no class file generated)!
I looked at the cocoon.log file and looks like a class loader security
problem: the \WEB-INF\_tmp_war gets locked! Is there any workaround this
problem? Any help is much appreciated!
cocoon.log file generated:
DEBUG 62 [cocoon ] (ExecuteThread-11): Using configuration file:
/cocoon.xconf
INFO 62 [cocoon ] (ExecuteThread-11): Reloading from:
file:D:/Programs/cocoon-1.8.2/samples/cocoon.xconf
DEBUG 93 [cocoon ] (ExecuteThread-11): New Cocoon object.
DEBUG 93 [cocoon ] (ExecuteThread-11): Using parser:
org.apache.cocoon.components.parser.JaxpParser
DEBUG 109 [cocoon ] (ExecuteThread-11): Creating Repository with
this directory: D:\programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war
DEBUG 109 [cocoon ] (ExecuteThread-11): Classpath =
D:\Programs\cocoon-1.8.2\samples\WEB-INF\classes;D:\Programs\cocoon-1.8.2\samples\WEB-INF\lib\javac.jar;D:\avue\lib\servlet.jar;D:\avue\lib\jaxp.jar;D:\avue\lib\xerces.jar;D:\avue\lib\xalan.jar;D:\avue\lib\cocoon.jar;D:\avue\lib\avalonapi.jar;D:\avue\lib\logkit.jar;D:\avue\lib\maybeupload.jar;D:\avue\lib\jakarta-regexp-1.2.jar;D:\avue\lib\jstyle.jar;D:\avue\lib\javac.jar;D:\weblogic\lib\weblogic510sp6boot.jar;D:\weblogic\classes\boot;
DEBUG 109 [cocoon ] (ExecuteThread-11): Work directory =
D:\Programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war
DEBUG 125 [cocoon ] (Thread-0): ComponentFactory creating new
instance of org.apache.cocoon.components.parser.JaxpParser.
DEBUG 140 [cocoon ] (Thread-0): ComponentFactory creating new
instance of org.apache.cocoon.components.parser.JaxpParser.
DEBUG 140 [cocoon ] (Thread-0): ComponentFactory creating new
instance of org.apache.cocoon.components.parser.JaxpParser.
DEBUG 140 [cocoon ] (Thread-0): ComponentFactory creating new
instance of org.apache.cocoon.components.parser.JaxpParser.
DEBUG 390 [cocoon ] (ExecuteThread-11): Root configuration:
cocoon
DEBUG 390 [cocoon ] (ExecuteThread-11): Configuration version:
2.0
DEBUG 390 [cocoon ] (ExecuteThread-11): Setting up components...
DEBUG 406 [cocoon ] (ExecuteThread-11): Adding component
(org.apache.cocoon.components.parser.Parser =
org.apache.cocoon.components.parser.JaxpParser)
DEBUG 406 [cocoon ] (ExecuteThread-11): Adding component
(org.apache.cocoon.components.language.generator.ProgramGenerator =
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl)
DEBUG 406 [cocoon ] (ExecuteThread-11): Adding component
(org.apache.cocoon.components.url.URLFactory =
org.apache.cocoon.components.url.URLFactoryImpl)
DEBUG 406 [cocoon ] (ExecuteThread-11): Adding component
(org.apache.cocoon.components.saxconnector.SAXConnector =
org.apache.cocoon.components.saxconnector.NullSAXConnector)
DEBUG 422 [cocoon ] (ExecuteThread-11): Adding component
(org.apache.avalon.util.datasource.DataSourceComponentSelector =
org.apache.cocoon.components.CocoonComponentSelector)
DEBUG 422 [cocoon ] (ExecuteThread-11): Adding component
(org.apache.avalon.util.pool.PoolController =
org.apache.cocoon.components.ComponentPoolController)
DEBUG 422 [cocoon ] (ExecuteThread-11): Adding component
(org.apache.cocoon.components.language.programming.ProgrammingLanguageSelector
= org.apache.cocoon.components.CocoonComponentSelector)
DEBUG 422 [cocoon ] (ExecuteThread-11): Adding component
(org.apache.cocoon.components.language.markup.MarkupLanguageSelector =
org.apache.cocoon.components.CocoonComponentSelector)
DEBUG 422 [cocoon ] (ExecuteThread-11): Adding component
(org.apache.cocoon.components.store.Store =
org.apache.cocoon.components.store.MemoryStore)
DEBUG 422 [cocoon ] (ExecuteThread-11): Adding component
(org.apache.cocoon.components.classloader.ClassLoaderManager =
org.apache.cocoon.components.classloader.ClassLoaderManagerImpl)
DEBUG 422 [cocoon ] (ExecuteThread-11): Setting up the sitemap.
DEBUG 422 [cocoon ] (ExecuteThread-11): Sitemap location =
sitemap.xmap
DEBUG 703 [cocoon ] (ExecuteThread-11): ComponentFactory creating
new instance of org.apache.cocoon.components.url.URLFactoryImpl.
DEBUG 703 [cocoon ] (ExecuteThread-11): Getting the URLFactories
DEBUG 703 [cocoon ] (ExecuteThread-11): for protocol:
resource org.apache.cocoon.components.url.ResourceURLFactory
DEBUG 718 [cocoon ] (ExecuteThread-11): for protocol: context
org.apache.cocoon.components.url.ContextURLFactory
DEBUG 718 [cocoon ] (ExecuteThread-11): Beginning sitemap
regeneration
DEBUG 718 [cocoon ] (ExecuteThread-11): Making URL from
file:/D:/Programs/cocoon-1.8.2/samples/sitemap.xmap
DEBUG 718 [cocoon ] (Thread-1): ComponentFactory creating new
instance of
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.
DEBUG 718 [cocoon ] (Thread-1): Could not find ComponentHandler,
attempting to create one for role:
org.apache.cocoon.components.language.generator.ServerPagesSelector
DEBUG 718 [cocoon ] (Thread-1): ComponentFactory creating new
instance of
org.apache.cocoon.components.language.generator.GeneratorSelector.
DEBUG 718 [cocoon ] (Thread-1): ComponentFactory creating new
instance of
org.apache.cocoon.components.classloader.ClassLoaderManagerImpl.
DEBUG 718 [cocoon ] (Thread-1): CocoonComponentSelector setting
up with root element:
DEBUG 718 [cocoon ] (Thread-1): ComponentFactory creating new
instance of org.apache.cocoon.components.CocoonComponentSelector.
DEBUG 718 [cocoon ] (Thread-1): CocoonComponentSelector setting
up with root element: markup-languages
DEBUG 734 [cocoon ] (Thread-1): Adding
org.apache.cocoon.components.language.markup.xsp.XSPMarkupLanguage for
xsp
DEBUG 734 [cocoon ] (Thread-1): Adding
org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage
for sitemap
DEBUG 734 [cocoon ] (Thread-1): ComponentFactory creating new
instance of org.apache.cocoon.components.CocoonComponentSelector.
DEBUG 734 [cocoon ] (Thread-1): CocoonComponentSelector setting
up with root element: programming-languages
DEBUG 750 [cocoon ] (Thread-1): ComponentFactory creating new
instance of
org.apache.cocoon.components.language.programming.java.JavaLanguage.
DEBUG 750 [cocoon ] (Thread-1): Looking up
org.apache.cocoon.components.classloader.ClassLoaderManager
DEBUG 750 [cocoon ] (Thread-1): Setting the parameters
DEBUG 750 [cocoon ] (Thread-1): Adding
org.apache.cocoon.components.language.programming.java.JavaLanguage for
java
DEBUG 765 [cocoon ] (Thread-1): The instance was not accessible,
creating it now.
DEBUG 765 [cocoon ] (Thread-1): ComponentFactory creating new
instance of
org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage.
DEBUG 1718 [cocoon ] (Thread-1): Making URL from
jar:file:/D:/avue/lib/cocoon.jar!/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
DEBUG 1718 [cocoon ] (Thread-1): Logicsheet
Used:jar:file:/D:/avue/lib/cocoon.jar!/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
WARN 4109 [cocoon ] (Thread-1): Could not load class for program
'org\apache\cocoon\www\sitemap_xmap'
java.security.AccessControlException: access denied
(java.io.FilePermission
\D:\Programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war\- read)
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
at
java.security.AccessController.checkPermission(AccessController.java:399)
at
java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
at java.net.URLClassLoader$5.run(URLClassLoader.java:463)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.getPermissions(URLClassLoader.java:461)
at
java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:162)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at
org.apache.cocoon.components.classloader.ClassLoaderManagerImpl.loadClass(ClassLoaderManagerImpl.java:58)
at
org.apache.cocoon.components.language.programming.java.JavaLanguage.loadProgram(JavaLanguage.java:121)
at
org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:119)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java:245)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:163)
at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
at java.lang.Thread.run(Thread.java:484)
DEBUG 4109 [cocoon ] (Thread-1): Language Exception
org.apache.cocoon.components.language.LanguageException: Could not load
class for program 'org\apache\cocoon\www\sitemap_xmap' due to a
java.security.AccessControlException: access denied
(java.io.FilePermission
\D:\Programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war\- read)
at
org.apache.cocoon.components.language.programming.java.JavaLanguage.loadProgram(JavaLanguage.java:124)
at
org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:119)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java:245)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:163)
at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
at java.lang.Thread.run(Thread.java:484)
DEBUG 4109 [cocoon ] (Thread-1): ComponentFactory decommissioning
instance of
org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage.
DEBUG 4109 [cocoon ] (Thread-1): Can't load ServerPage
org.apache.avalon.ComponentManagerException: Could not add component for
class: org.apache.cocoon.www.sitemap_xmap
at
org.apache.cocoon.components.language.generator.GeneratorSelector.addGenerator(GeneratorSelector.java:61)
at
org.apache.cocoon.components.language.generator.GeneratorSelector.select(GeneratorSelector.java:50)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.select(ProgramGeneratorImpl.java:263)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:172)
at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
at java.lang.Thread.run(Thread.java:484)
DEBUG 4109 [cocoon ] (Thread-1): ComponentFactory creating new
instance of
org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage.
DEBUG 4359 [cocoon ] (Thread-1): Making URL from
jar:file:/D:/avue/lib/cocoon.jar!/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
DEBUG 4359 [cocoon ] (Thread-1): Logicsheet
Used:jar:file:/D:/avue/lib/cocoon.jar!/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
WARN 6109 [cocoon ] (Thread-1): Could not load class for program
'org\apache\cocoon\www\sitemap_xmap'
java.security.AccessControlException: access denied
(java.io.FilePermission
\D:\Programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war\- read)
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
at
java.security.AccessController.checkPermission(AccessController.java:399)
at
java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
at java.net.URLClassLoader$5.run(URLClassLoader.java:463)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.getPermissions(URLClassLoader.java:461)
at
java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:162)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at
org.apache.cocoon.components.classloader.ClassLoaderManagerImpl.loadClass(ClassLoaderManagerImpl.java:58)
at
org.apache.cocoon.components.language.programming.java.JavaLanguage.loadProgram(JavaLanguage.java:121)
at
org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:119)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java:245)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:210)
at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
at java.lang.Thread.run(Thread.java:484)
DEBUG 6109 [cocoon ] (Thread-1): Language Exception
org.apache.cocoon.components.language.LanguageException: Could not load
class for program 'org\apache\cocoon\www\sitemap_xmap' due to a
java.security.AccessControlException: access denied
(java.io.FilePermission
\D:\Programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war\- read)
at
org.apache.cocoon.components.language.programming.java.JavaLanguage.loadProgram(JavaLanguage.java:124)
at
org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:119)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java:245)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:210)
at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
at java.lang.Thread.run(Thread.java:484)
DEBUG 6109 [cocoon ] (Thread-1): ComponentFactory decommissioning
instance of
org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage.
ERROR 6109 [cocoon ] (Thread-1): Error compiling sitemap
org.apache.avalon.ComponentManagerException: Could not add component for
class: org.apache.cocoon.www.sitemap_xmap
at
org.apache.cocoon.components.language.generator.GeneratorSelector.addGenerator(GeneratorSelector.java:61)
at
org.apache.cocoon.components.language.generator.GeneratorSelector.select(GeneratorSelector.java:50)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.select(ProgramGeneratorImpl.java:263)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:219)
at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
at java.lang.Thread.run(Thread.java:484)
DEBUG 6109 [cocoon ] (ExecuteThread-11): Changing Cocoon
context(sitemap.xmap) to prefix()
DEBUG 6109 [cocoon ] (ExecuteThread-11): from
context(file:/D:/Programs/cocoon-1.8.2/samples/) and prefix()
DEBUG 6109 [cocoon ] (ExecuteThread-11): at URI
DEBUG 6109 [cocoon ] (ExecuteThread-11): New context is
file:/D:/Programs/cocoon-1.8.2/samples/
ERROR 6140 [cocoon ] (ExecuteThread-11): Problem with servlet
org.apache.cocoon.ProcessingException: The sitemap handler's sitemap is
not available.
at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:106)
at org.apache.cocoon.Cocoon.process(Cocoon.java:218)
at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:417)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:123)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:761)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:708)
at
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:252)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:346)
at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:246)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)
INFO 6187 [cocoon ] (ExecuteThread-11): '' Processed by Apache
Cocoon 2.0a4 in 5.75 seconds.
================================================================
Regards,
Georgi -
Problem loading modified classes from CLASSPATH using system class loader
Hi,
I am facing problem to load the modified classes from CLASSPATH.
I have set my CLASSPATH to a directory whose classes will be modified frequently. After the server(web/app) is started, the system class loader, using which am trying to load the classes from the directory where the CLASSPATH is set, am not able to load the modified files without the server restart.
Do I need to have a custom class loader to fix this.
Please help me.
Thanks,
SureddyDo I need to have a custom class loader to fix this.Yes.
-
JVMPI class load event problem
Hi
I'm trying to write a simple profiler using JVM Profiler Interface to
display classes loaded while running my application.
For this, I have registered callback to notify two events
JVMPI_EVENT_CLASS_LOAD and JVMPI_EVENT_CLASS_LOAD_HOOK.
Now the problem is that, for some system classes which are loaded
initialy(during JVM initialization) I'm not getting
JVMPI_EVENT_CLASS_LOAD_HOOK event. However JVMPI_EVENT_CLASS_LOAD gets
called for each of them. ( I want .._LOAD_HOOK for all classes)
I gone through some documents/links which says that
JVMPI_EVENT_CLASS_LOAD_HOOK will be sent only after
JVMPI_EVENT_JVM_INIT_DONE event is sent.
I want JVMPI_EVENT_CLASS_LOAD_HOOK event for all classes, even they
are loaded before JVM initialization is complete.
Is there any way to achieve this? Any work arround?
I'm using J2SDK 1.4.2.
Thanks in advance
RohanI want JVMPI_EVENT_CLASS_LOAD_HOOK event for allThe JVMPI api was always experimantal. It has now been superseded by the JVM TI work done for Tiger as part of JSR-163.
This article describes the new API and how to make the transition:
The JVMPI Transition to JVMTI
http://java.sun.com/developer/technicalArticles/Programming/jvmpitransition/
Is there any way to achieve this? Any work arround?When your monitoring agent gets control after JVMTI_EVENT_VM_INIT, use the GetLoadedClasses method to return all of the classes loaded up to that point.
If you also request notification for all subsequently loaded classes (via JVMTI_EVENT_CLASS_FILE_LOAD_HOOK) then after suspending the VM you should have information on all classes loaded since the genesis of the VM.
The HPROF profiling agent was converted to use the new class loading notification mechanism. Refer to the
I'm using J2SDK 1.4.2.I suggest you update your project to use the new APIs provided with JSRs 163 and 174.
Maybe you are looking for
-
Mini display to s-video possible?
Hey everyone. I have an aluminum mac book, which has the mini display port on it. I saw in a store there is a mini-vga to s-video...but what about mini-display? Basically I want to be able to hook up an s-video to my computer so I can watch movies on
-
SAP Training from Remote (Internet based)
SAP Training from Remote (Internet based) Instructor Mr. Nanda Kishore § IIT engineer with 10 years of SAP specific training experience § Trained hundreds of students now well placed in BIG 4 consulting firms § Official trainer for comp
-
Is there a "Replace All" command?
This seems like a no-brainer.... I found the "Ctrl+F" find and replace, but it only replaces a sindle instance of a text string. I also found the complext find dialog. It lets you find all occurances, but (apparently) you cannot do replaces from
-
Impossibilité de lire audios et/ou vidéos avec navigateurs en mode Windows 8
Bonjour, Depuis peu je n'arrive plus à lire des contenus mutimédias sur certains sites web comme Youtube et Facebook, par exemple. Quelque soit le navigateur que j'utilise en mode windows 8 (Chrome pour la figure de gauche ou Google pour la figure dr
-
Language Translation for MENU items
Hi Experts, Please let me know the Process of Language translation for MENU items. I have copied the Standard ALV GUI Status for my ZProgram. Now the MENU items are not translated.