Jar classloading mystery

Hi,
I am a bit confused about JVM behavior when loading a jar from a remote disk drive:
Is it true that (on Sun JVM) when a class is loaded, it is stored into a local cache (file?) where it remains even AFTER the appliaction halts?
When using remote jar files (on a different PC in a very slow local network) first execution of my code takes several seconds to execute (profiling shows it's downloading the classes from jar), while any subsequent execution is much faster (and no network data flow is detected) - it obviously loads classes from the local computer.
It makes me think all the classes get stored in the java cache, but the effect takes only some 20 seconds after which the class has to be loaded from the remote classpath again (with the lag). Any ideas?
Thanks in advance.

hi,
I think classes are cached in :
- Windows : *<User Application Data Folder>\Sun\Java\Deployment\cache*
- Unix : *${user.home}/.java/deployment/cache*

Similar Messages

  • OIM 11g Plugin - Third Party Jars : Classloader issue

    Hi All,
    I am having a Plugins.zip under middleware/Oracle_IDM1/server/plugins folder.  [OIM 11g R2]
    This gets invoked from a schedule job.
    I have third party Jars (axis.jar) within Plugins.zip/lib. My code within Plugins.zip calls Thrid Party APIs.
    Now the issue is:
    The APIs (within axis.jar) do not seem to find property files from within their own JARS.
    These property files are within their own Third Party Jars and the Third Party APIs should be able to access them by default. I have tested these APIs from stand alone clients and web clients, they work perfectly.
    But within the Plugins.zip, these third party APIs do not seem to find property files from within their own JARs.
    Looks like some class loader issue. Something must be getting messed up in the way the Third Party JARs from within the Plugins.zip/lib are loaded.
    Has anyone faced similar issue.
    Any suggestions please?
    Thanks,
    Sandeep

    I placed the required JARs under middleware/Oracle_IDM1/server/ThirdParty.
    I also executed UploadJars utility for required JARs.
    I have also added to server startup path : .../middleware/Oracle_IDM1/server/ThirdParty/axis.jar.
    But I still get the following Error:
    java.lang.ExceptionInInitializerError
    Caused By: java.util.MissingResourceException: Cannot find resource 'org.apache.axis.i18n.resource'
    I'm calling axis APIs from my code. The resource "org/apache/axis/i18n/resource.properties" is clearly present inside axis.jar.
    My client works when executed outside of Plugins.zip.
    Please see the full stack trace below:
    java.lang.ExceptionInInitializerError
            at org.apache.axis.utils.Messages.<clinit>(Messages.java:36)
            at org.apache.axis.configuration.EngineConfigurationFactoryFinder$1.run(EngineConfigurationFactoryFinder.java:144)
            at java.security.AccessController.doPrivileged(Native Method)
            at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:113)
            at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:160)
            at org.apache.axis.client.Service.getEngineConfiguration(Service.java:813)
            at org.apache.axis.client.Service.getAxisClient(Service.java:104)
            at org.apache.axis.client.Service.<init>(Service.java:113)
            at org.my.company.webservice.SecurityQASyncWS_ServiceLocator.<init>(SecurityQASyncWS_ServiceLocator.java:12)
            at org.my.company.webservice.SecurityQASyncWSClient.invoke(SecurityQASyncWSClient.java:31)
            at com.my.company.idm.xl.schedule.tasks.SecurityQASynchronization.processBatch(SecurityQASynchronization.java:561)
            at com.my.company.idm.xl.schedule.tasks.SecurityQASynchronization.execute(SecurityQASynchronization.java:222)
            at oracle.iam.scheduler.vo.TaskSupport.invokeExecute(TaskSupport.java:183)
            at oracle.iam.scheduler.vo.TaskSupport.access$000(TaskSupport.java:40)
            at oracle.iam.scheduler.vo.TaskSupport$1.processWithoutResult(TaskSupport.java:143)
            at oracle.iam.platform.tx.OIMTransactionCallbackWithoutResult.process(OIMTransactionCallbackWithoutResult.java:9)
            at oracle.iam.platform.tx.OIMTransactionCallback.doInTransaction(OIMTransactionCallback.java:13)
            at oracle.iam.platform.tx.OIMTransactionCallback.doInTransaction(OIMTransactionCallback.java:6)
            at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
            at oracle.iam.platform.tx.OIMTransactionManager.execute(OIMTransactionManager.java:22)
            at oracle.iam.scheduler.vo.TaskSupport.executeJob(TaskSupport.java:125)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at oracle.iam.scheduler.impl.quartz.QuartzJob$TaskExecutionAction.run(QuartzJob.java:268)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
            at weblogic.security.Security.runAs(Security.java:41)
            at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(weblogicLoginSession.java:52)
            at oracle.iam.scheduler.impl.quartz.QuartzJob.execute(QuartzJob.java:77)
            at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
            at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
    Caused By: java.util.MissingResourceException: Cannot find resource 'org.apache.axis.i18n.resource'
            at org.apache.axis.i18n.ProjectResourceBundle.getBundle(ProjectResourceBundle.java:288)
            at org.apache.axis.i18n.MessagesConstants.<clinit>(MessagesConstants.java:32)
            at org.apache.axis.utils.Messages.<clinit>(Messages.java:36)
            at org.apache.axis.configuration.EngineConfigurationFactoryFinder$1.run(EngineConfigurationFactoryFinder.java:144)
            at java.security.AccessController.doPrivileged(Native Method)
            at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:113)
            at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:160)
            at org.apache.axis.client.Service.getEngineConfiguration(Service.java:813)
            at org.apache.axis.client.Service.getAxisClient(Service.java:104)
            at org.apache.axis.client.Service.<init>(Service.java:113)
            at org.my.company.webservice.SecurityQASyncWS_ServiceLocator.<init>(SecurityQASyncWS_ServiceLocator.java:12)
            at org.my.company.webservice.SecurityQASyncWSClient.invoke(SecurityQASyncWSClient.java:31)
            at com.ets.idm.xl.schedule.tasks.SecurityQASynchronization.processBatch(SecurityQASynchronization.java:561)
            at com.ets.idm.xl.schedule.tasks.SecurityQASynchronization.execute(SecurityQASynchronization.java:222)
            at oracle.iam.scheduler.vo.TaskSupport.invokeExecute(TaskSupport.java:183)
            at oracle.iam.scheduler.vo.TaskSupport.access$000(TaskSupport.java:40)
            at oracle.iam.scheduler.vo.TaskSupport$1.processWithoutResult(TaskSupport.java:143)
            at oracle.iam.platform.tx.OIMTransactionCallbackWithoutResult.process(OIMTransactionCallbackWithoutResult.java:9)
            at oracle.iam.platform.tx.OIMTransactionCallback.doInTransaction(OIMTransactionCallback.java:13)
            at oracle.iam.platform.tx.OIMTransactionCallback.doInTransaction(OIMTransactionCallback.java:6)
            at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
            at oracle.iam.platform.tx.OIMTransactionManager.execute(OIMTransactionManager.java:22)
            at oracle.iam.scheduler.vo.TaskSupport.executeJob(TaskSupport.java:125)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at oracle.iam.scheduler.impl.quartz.QuartzJob$TaskExecutionAction.run(QuartzJob.java:268)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
            at weblogic.security.Security.runAs(Security.java:41)
            at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(weblogicLoginSession.java:52)
            at oracle.iam.scheduler.impl.quartz.QuartzJob.execute(QuartzJob.java:77)
            at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
            at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)

  • Help? Jar File Mystery

    Hi;
    I'm trying to bundle up a Java 2 ( 1.3.1 ) client app as an executable jar
    file that the user ( windoze ) can double click like an exe and have it
    come up.
    Everything works find executing it from a windows 2000 command line with
    "java -jar MyJar.jar"
    However, when I double click it ( windows 2000 ) the application comes up,
    but it looks like it can't find some of the component classes and it cant
    read some of the *.ini ( text ) files I made.
    I used a great Jar app called JavaCannery:
    http://www.cs.umd.edu/users/starz/cannery/
    It goes finds all of you dependencies and writes your manifest file
    appropriately.....so that isn't the problem.
    I noticed that in Windows Explorer | tools | folder option | file types
    that jar files are executed with "javaw.exe -jar "?
    Why the difference from the command line argument? Does this difference
    have anything to do with my app working from the command line and simply
    double clicking it?
    Thanks in advance
    Steve

    javaw should be the same as java except it doesn't create a console window. Perhaps its a CLASSPATH or path thing or possibly what you have working directory set to in the file type association.

  • Loading jar at runtime using custom classloader

    Hi,
    I'm trying to load a jar file to an application running inside weblogic at runtime.
    I followed the example that was posted at
    http://dev2dev.bea.com/cs/user/blog?file=/blog/jcscoobyrs/archive/2005/05/realworld_use_f.html
    and did the following:
    URLClassLoader loader = null;
    URL[] urls = {new URL("file:///" + "C:/Program Files/aaa/WEB-INF/lib/ImportTest3.jar")};
    ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
    ClassLoader loader = new URLClassLoader(urls, classLoader);
    Thread.currentThread().setContextClassLoader(loader);
    Class customClass = Class.forName(className, true, loader);
    customCode = customClass.newInstance();
    Thread.currentThread().setContextClassLoader(classLoader);
    everything works fine when I access my application once.
    But when I'm trying to do the same again, everything fails.
    Any ideas?
    Thanks!

    When you say everything fails - can you clarify the failure? Can you paste the stacktrace? Is it a ClassNotFoundException?

  • Executable JAR containing images doesn't load them

    I'm using Netbeans 4.0 for developping a Java Application. This application is composed of 3 packages:
    - daemonexplorerv10: which contains the main class.
    - GUI: which contains classes I use to create the GUI of the application.
    - images: which contains GIF and PNG images used by the application. It also contains a class named ImageLoader which is used to load the images contained in the package. I will detail this class later.
    My main class, named Main.java, simply lauches the main JFrame of the application GUI. Here is the code of it's main method:
    public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    MainFrame.createAndShowGUI();
        }In the GUI package, I created a class named MainFrame which extends JFrame and is the main frame of my application GUI. Here is the code of it's method createAndShowGUI:
        public static void createAndShowGUI() {
            //Suggest that the L&F (rather than the system)
            //decorate all windows.  This must be invoked before
            //creating the JFrame.  Native look and feels will
            //ignore this hint.
            JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            MainFrame main_frame = new MainFrame(main_frame_title);
            main_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Display the window.
            main_frame.pack();
            main_frame.setVisible(true);
        }And here is the beginning of the code of it's constructor:
        public MainFrame(String title) {
            super(title);
            ImageLoader il = ImageLoader.getSingleton();
            ImageIcon application_icon = il.loadImage("application_icon.png");
            if (application_icon != null) {
                this.setIconImage(application_icon.getImage());
            else {
                System.out.println("Error - application_icon could not be loaded");
    ...As you see, MainFrame uses ImageLoader so as to customize the frame icon. ImageLoader follows the singleton pattern. It has a method called loadImage which returns an IconImage for a given image name. Here is the code of this method:
        public ImageIcon loadImage(String image_name) {
            ClassLoader cldr = this.getClass().getClassLoader();
            URL image_url = cldr.getResource("\\images\\"+image_name);
            if (image_url != null) {
                return new ImageIcon(image_url);
            else {
                return null;
        }For every image I want to use in my application, I use ImageLoader. It fetches the image thanks to the given name, provided that the image is placed in the package called images, or else the method loadImage returns null.
    So the MainFrame uses ImageLoader which fetches the image "application_icon.png" for the frame to set it as it's custom icon.
    My application runs perfectly well :)... as far as I run it through Netbeans launcher. But Netbeans also creates automatically an executable JAR file for each builded application. So I tried to lauch this JAR. Through this way, the application works, but all the images that should be loaded aren't!
    I unpacked the JAR so as to check if all the images are in it. Netbeans includes the images. Netbeans also creates a manifest file which seems perfectly correct.
    So I can't understand why my application runs without any images when I launch it through an executable JAR while it works fine (with all the images) when I lauch it through Netbeans.
    I checked many forums to find a solution. Using ImageIO doesn't or ToolKit doesn't solve the problem. It simply seems that the path of the package called images can't be found by the method getResource when this package is compressed in the JAR.
    P.S: I use J2SE Development Kit 5.0 and J2SE Runtime Environment 5.0.

    So ReinerP, I tried your code today in a little test application which has a single package containing two classes:
    - Main.java
    - JMainFrame.java
    Here is the code of Main.java:
    public class Main {
        /** Creates a new instance of Main */
        public Main() {
         * @param args the command line arguments
        public static void main(String[] args) {
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    //Suggest that the L&F (rather than the system)
                    //decorate all windows.  This must be invoked before
                    //creating the JFrame.  Native look and feels will
                    //ignore this hint.
                    JFrame.setDefaultLookAndFeelDecorated(true);
                    //Create and set up the window.
                    JMainFrame main_frame = new JMainFrame();
                    main_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    //Display the window.
                    main_frame.pack();
                    main_frame.setVisible(true);
    }And here is the code of JMainFrame.java:
    public class JMainFrame extends JFrame {
        /** Creates a new instance of JMainFrame */
        public JMainFrame() {
            super();
            //load and set icon
            URL imgURL = JMainFrame.class.getResource("icon.png");
            ImageIcon img = new ImageIcon(imgURL);
            setIconImage(img.getImage());
    }As you said, it works :). It works when I run it through Netbeans launcher, and it also works when I run it through the Executable JAR Netbeans generated during the building of the application.
    So I adapted the code of the application I was talking about in the first post of this topic. I modified the code of the method loadImage in ImageLoader.java:
    public ImageIcon loadImage(String image_name) {
    //not working in JAR:  ClassLoader cldr = this.getClass().getClassLoader();
    //not working in JAR:  URL image_url = cldr.getResource("\\images\\"+image_name);
            URL image_url = ImageLoader.class.getResource(image_name);
            if (image_url != null) {
                return new ImageIcon(image_url);
            else {
                return null;
        }And it works well. Thanks again. However, I still can't explain why the use of class loader isn't undertood by the executable JAR.

  • What relationship between every classloader?

    Can I deploy several EJB JARS which have many enterprise beans in weblogic6.1sp2?
    what relationship between these ejb jars' classloader and web application's classloader?

    Can I deploy several EJB JARS which have many enterprise beans inweblogic6.1sp2?
    what relationship between these ejb jars' classloader and webapplication's classloader?
    Typically you'd put all those JARs and the WAR into an EAR. Then they'd
    share a classloader (although there's actually more than one involved). If
    you have problems, you can start consolidating; in case of emergency, tend
    to consolidate toward all the classes (including web app) being in one JAR.
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    http://www.tangosol.com/coherence.jsp
    Tangosol Coherence: Clustered Replicated Cache for Weblogic
    "ejb" <[email protected]> wrote in message news:3d9287f2$[email protected]..
    >

  • The weblogic.jar has the javax.management.*, it is conflict with rt.jar's

    Hello guys:
    I want to use JMX 1.0 to communicate with weblogic 8.1. The client should be run in the Java 1.5
    It throw
    java.io.InvalidClassException: javax.management.ObjectName; local class incompatible:
    stream classdesc serialVersionUID = -5467795090068647408, local class serialVersionUID = 1081892073854801359
    java.io.InvalidClassException: javax.management.ObjectName; local class incompatible:
    stream classdesc serialVersionUID = -5467795090068647408, local class serialVersionUID = 1081892073854801359I know the reason is java 1.5 has JMX 1.2 in it.
    So how can I program a class loader to load the weblogic.jar classes in? I have tried a lot of code, but failed.
    Is there any sample here?
    I want to use the JMX 1.0 in weblogic.jar at jdk1.5 run time
    Thanks a lot,
    Qiang

    Thanks for your reply,
    But I have tried your sugestions.
    I use
    Thread.currentThread().setContextClassLoader(cl);I am not sure whether it is correct.
    import java.io.IOException;
    import java.net.URL;
    import java.net.URLClassLoader;
    import java.security.AllPermission;
    import java.security.CodeSource;
    import java.security.PermissionCollection;
    import java.security.Permissions;
    import com.sun.org.apache.bcel.internal.util.ClassPath;
    public class NonDelegatingClassLoader extends URLClassLoader {
         private final PermissionCollection permissions = new Permissions();
              permissions.add(new AllPermission());
         public NonDelegatingClassLoader(URL[] urls) {
              super(urls);
         @Override
         protected synchronized Class<?> loadClass(String name, boolean resolve)
                   throws ClassNotFoundException {
              // Bootstrap classes must be loaded by the bootstrap ClassLoader
              if (name.startsWith("javax.management")
                        || name.startsWith("com.sun.jmx")
                        || name.startsWith("com.sun.management")
                                                                    || name.startsWith("weblogic.")
                   Class c = findLoadedClass(name);
                   if (c == null) {
                        try {
                             c = findClass(name);
                        } catch (ClassNotFoundException e) {
                             byte[] classBytes;
                             try {
                                  ClassPath cp = new ClassPath();
                                  classBytes = cp.getBytes(name);
                             } catch (IOException e1) {
                                  throw new ClassNotFoundException(name);
                             c = defineClass(name, classBytes, 0, classBytes.length);
                   if (resolve) {
                        resolveClass(c);
                   return c;
              } else {
                   return getClass().getClassLoader().loadClass(name);
         protected PermissionCollection getPermissions(CodeSource codesource) {
              return permissions;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.util.Iterator;
    import java.util.Set;
    import javax.naming.Context;
    import org.omg.CORBA.TIMEOUT;
    import weblogic.jndi.Environment;
    import weblogic.management.MBeanHome;
    import weblogic.management.runtime.JVMRuntimeMBean;
    public class QueryWLSThread extends Thread {
         private String m_url = "";
         private String m_username = "weblogic";
         private String m_password = "weblogic";
         private int m_heapUT = -1;
         private Timer m_timer = null;
         public QueryWLSThread(String url, String username, String password,
                   int timeOut) {
              //System.setProperty("jmx.serial.form", "1.0");
              m_url = url;
              m_username = username;
              m_password = password;
              m_timer = new Timer(timeOut, this);
              try {
                   URL[] urls = { new URL("file:/f:/Downloads/weblogic.jar") };
                   ClassLoader cl = new NonDelegatingClassLoader(urls);
                   Thread.currentThread().setContextClassLoader(cl);
              } catch (MalformedURLException e) {
                   // TODO // block
                   e.printStackTrace();
         }It throw out
    java.lang.NoSuchMethodException: weblogic.jndi.internal.ServerNamingNode_811_WLStub.<init>(weblogic.rmi.internal.StubInfo)
         at java.lang.Class.getConstructor0(Unknown Source)
         at java.lang.Class.getConstructor(Unknown Source)
         at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:804)
         at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:790)
         at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:79)If I do not check the name with "weblogic."
    it will throw out method not found.
    If I do not set the system env, it is the same I still use the jdk 1.5 classes.
    I am not sure how to load my class without loading the jdk1.5's
    I also use the java -xbootpath/a:
    Cannot fix this currently.

  • Why does this keep giving a parse error when trying to use JavaHelp

    I'm trying to get JavaHelp to integrate into my application, but when I call the code below I get the following error;
    javax.help.HelpSetException: Could not parse
    Got an IOException (null)
    Parsing failed for nullthe error is occuring at the line indicated;
         HelpSet helpSet;
         HelpBroker helpBroker;
         try
         URL url = new URL("file", "", -1, "file://C:/jh1.1.3/demos/hsjar/idehelp.jar");
         ClassLoader loader = new URLClassLoader(new URL[]{url});
         URL helpUrl = null;
         helpUrl = HelpSet.findHelpSet(loader, "IdeHelp.hs");
         helpSet = new HelpSet(loader, helpUrl);    // *** error here ***
         helpBroker = helpSet.createHelpBroker();
         helpBroker.enableHelpKey(rootPane, "top", helpSet);
         CSH.setHelpIDString(menuItem, "Help");
         helpBroker.enableHelpOnButton(menuItem, "Help", helpSet);
         catch (Exception ex)
         ex.printStackTrace();
         }helpURL never seems to take a value, always staying at null. Can anyone see what I'm doing wrong?
    Thanks

    Got it sorted. I had to create a CLASSPATH to the jar and then the hs reference worked fine. :D

  • Problems with context in JAXB and ActiveX bridge

    Hello!
    I'm using Java ActiveX Bridge for accesing from Navision to a digital invoice API developed by spanish Industry, Commerce and Tourism Department.
    I successfully executed the invoice creation process from a standalone java application. However, it doesn't work through activex bridge.
    I suspect the problem is probably related to a classloader woe. Here's the first code snippet I used:
      public static void marshal(es.mityc.facturae31.Facturae paramFacturae, String paramString)
        try
          logger.info("Loading context es.mityc.facturae31");
          JAXBContext localJAXBContext = JAXBContext.newInstance("es.mityc.facturae31");
          logger.info("Creating marshaller"); The obtained exception is:
    java.lang.NullPointerException
         at javax.xml.bind.ContextFinder.find(ContextFinder.java:279)
         at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
         at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337)
         at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:244)
         at es.mityc.facturae.utils.MarshallerUtil.marshal(MarshallerUtil.java:85)
         at com.mailgrafica.navifacturae.Facturae31.firmar(Facturae31.java:3153)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at sun.plugin.javascript.JSInvoke.invoke(Unknown Source)
         at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at sun.plugin.javascript.JSClassLoader.invoke(Unknown Source)
         at sun.plugin.com.MethodDispatcher.invoke(Unknown Source)
         at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
         at sun.plugin.com.BeanDispatchImpl.invoke(Unknown Source)Then, I changed code to make sure the context creation method receives a classloader which loads classes from appropiate jar file (Facturae-API.jar):
          URL[] urls = { new URL("file:///c:/Archivos de programa/Java/jre6/axbridge/lib/Facturae-API.jar"),
                    new URL("file:///c:/Archivos de programa/Java/jre6/axbridge/lib/lib/jaxb-api.jar"),
                    new URL("file:///c:/Archivos de programa/Java/jre6/axbridge/lib/lib/jaxb-impl.jar"),
                    new URL("file:///c:/Archivos de programa/Java/jre6/axbridge/lib/lib/jsr173_1.0_api.jar")};
          ClassLoader oldcloader = Thread.currentThread().getContextClassLoader();
          URLClassLoader cloader = new URLClassLoader(urls, oldcloader);
          Thread.currentThread().setContextClassLoader(cloader);
          logger.info("Created URLClassloader");
          logger.info("Loading context es.mityc.facturae31");
          JAXBContext localJAXBContext = JAXBContext.newInstance("es.mityc.facturae31", cloader);
          logger.info("Creating marshaller");
          Marshaller localMarshaller = localJAXBContext.createMarshaller();
          FacturaeNamespacePrefixMapper localFacturaeNamespacePrefixMapper = new FacturaeNamespacePrefixMapper();
          localMarshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", localFacturaeNamespacePrefixMapper);
          FileOutputStream localFileOutputStream = new FileOutputStream(paramString + ".xsig");
          logger.info("Starting the marshal process");
          System.out.println("Starting the marshal process");
          localMarshaller.marshal(paramFacturae, localFileOutputStream);  // Exception now is produced here.  Now the exception is:
    javax.xml.bind.JAXBException: class es.mityc.facturae31.Facturae nor any of its super class is known to this context.
         at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:556)
         at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:478)
         at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:328)
         at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:257)
         at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:75)
         at es.mityc.facturae.utils.MarshallerUtil.marshal(MarshallerUtil.java:92)
         at com.mailgrafica.navifacturae.Facturae31.firmar(Facturae31.java:3153)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at sun.plugin.javascript.JSInvoke.invoke(Unknown Source)
         at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at sun.plugin.javascript.JSClassLoader.invoke(Unknown Source)
         at sun.plugin.com.MethodDispatcher.invoke(Unknown Source)
         at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
         at sun.plugin.com.BeanDispatchImpl.invoke(Unknown Source)Could anybody help me? Thanks in advance.

    According problem 1: this is not normal behavior and you could try first to restart Bridge holding down option key to reset the preferences.
    But if you experience this also on the server I don't know if this solutions works. And according to problem 2, you should open a case on Adobe support using the little contact button top right on this page, not many users (including me) of this forum are using a server or know a lot about of that workflow :-(
    You could try a forum search also on the word server (Search for forum only works when you are on the mainpage with al the post for Bridge for some strange reason...)

  • ChangeAwareClassLoader issue

    I got the following error when I call JSP on WLS 8.1sp4 running on Solaris 9.
              <pre>
              java.lang.NoClassDefFoundError: org/apache/taglibs/standard/lang/jstl/MinusOperator
                   at org.apache.taglibs.standard.lang.jstl.ELEvaluator.parseExpressionString(ELEvaluator.java:259)
                   at org.apache.taglibs.standard.lang.jstl.ELEvaluator.evaluate(ELEvaluator.java:191)
                   at org.apache.taglibs.standard.lang.jstl.ELEvaluator.evaluate(ELEvaluator.java:163)
                   at org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:101)
                   at org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:129)
                   at org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager.evaluate(ExpressionEvaluatorManager.java:75)
                   at org.apache.taglibs.standard.tag.el.core.ExpressionUtil.evalNotNull(ExpressionUtil.java:48)
                   at org.apache.taglibs.standard.tag.el.core.OutTag.evaluateExpressions(OutTag.java:99)
                   at org.apache.taglibs.standard.tag.el.core.OutTag.doStartTag(OutTag.java:57)
              </pre>
              This Error is strange because other jstl classes are loaded successfully.
              when I debuged classloaders using -Dweblogic.Debug option, then I found that instance of classloader had never changed but something internal had been changed.
              please see below. internal classpath followed by "with classpath of" of ChangeAwareClassLoader@1b60d0a had been changed, and I supporse this is the reason why I got NoClassDefFoundError.
              <pre>
              [GenericClassLoader] : weblogic.utils.classloaders.ChangeAwareClassLoader@1b60d0a( finder: weblogic.utils.classloaders.CodeGenClassFinder@4abd99, annotation: consumer_web_1_WAR@consumer_1, parent: weblogic.utils.classloaders.GenericClassLoader@5b9d44( finder: weblogic.utils.classloaders.CodeGenClassFinder@99823, annotation: consumer_web_1_WAR@, parent: weblogic.utils.classloaders.GenericClassLoader@a23d38( finder: weblogic.utils.classloaders.CodeGenClassFinder@115c6cb, annotation: ApplicationClassLoader@, parent: weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder: weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null, parent: sun.misc.Launcher$AppClassLoader@9f2a0b)))) defined class interface org.apache.taglibs.standard.lang.jstl.VariableResolver
              [GenericClassLoader] : Looking for class: org.apache.taglibs.standard.lang.jstl.ELEvaluator...
              With classpath of : ()
              Classloader object id (weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder: weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null, parent: sun.misc.Launcher$AppClassLoader@9f2a0b))
              [GenericClassLoader] : Class org.apache.taglibs.standard.lang.jstl.ELEvaluator not found.
              [GenericClassLoader] : Looking for class: org.apache.taglibs.standard.lang.jstl.ELEvaluator...
              With classpath of : ()
              Classloader object id (weblogic.utils.classloaders.GenericClassLoader@a23d38( finder: weblogic.utils.classloaders.CodeGenClassFinder@115c6cb, annotation: ApplicationClassLoader@, parent: weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder: weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null, parent: sun.misc.Launcher$AppClassLoader@9f2a0b)))
              [GenericClassLoader] : Class org.apache.taglibs.standard.lang.jstl.ELEvaluator not found.
              [GenericClassLoader] : Looking for class: org.apache.taglibs.standard.lang.jstl.ELEvaluator...
              With classpath of : (/opt/bea/user_projects/e5489h17/batchconsumer/stage/consumer_web_1_WAR/APP-INF/classes)
              Classloader object id (weblogic.utils.classloaders.GenericClassLoader@5b9d44( finder: weblogic.utils.classloaders.CodeGenClassFinder@99823, annotation: consumer_web_1_WAR@, parent: weblogic.utils.classloaders.GenericClassLoader@a23d38( finder: weblogic.utils.classloaders.CodeGenClassFinder@115c6cb, annotation: ApplicationClassLoader@, parent: weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder: weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null, parent: sun.misc.Launcher$AppClassLoader@9f2a0b))))
              [GenericClassLoader] : Class org.apache.taglibs.standard.lang.jstl.ELEvaluator not found.
              [ChangeAwareClassLoader] : weblogic.utils.classloaders.ChangeAwareClassLoader@1b60d0a( finder: weblogic.utils.classloaders.CodeGenClassFinder@4abd99, annotation: consumer_web_1_WAR@consumer_1, parent: weblogic.utils.classloaders.GenericClassLoader@5b9d44( finder: weblogic.utils.classloaders.CodeGenClassFinder@99823, annotation: consumer_web_1_WAR@, parent: weblogic.utils.classloaders.GenericClassLoader@a23d38( finder: weblogic.utils.classloaders.CodeGenClassFinder@115c6cb, annotation: ApplicationClassLoader@, parent: weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder: weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null, parent: sun.misc.Launcher$AppClassLoader@9f2a0b)))) about to loadClass(org.apache.taglibs.standard.lang.jstl.ELEvaluator)
              [GenericClassLoader] : Looking for class: org.apache.taglibs.standard.lang.jstl.ELEvaluator...
              With classpath of : (/export/home/opt/bea/user_projects/e5489h17/batchconsumer/.wlnotdelete/extract/batchconsumer_consumer_web_1_WAR_consumer_1/jarfiles/WEB-INF/lib/commons-logging.jar)
              Classloader object id (weblogic.utils.classloaders.ChangeAwareClassLoader@1b60d0a( finder: weblogic.utils.classloaders.CodeGenClassFinder@4abd99, annotation: consumer_web_1_WAR@consumer_1, parent: weblogic.utils.classloaders.GenericClassLoader@5b9d44( finder: weblogic.utils.classloaders.CodeGenClassFinder@99823, annotation: consumer_web_1_WAR@, parent: weblogic.utils.classloaders.GenericClassLoader@a23d38( finder: weblogic.utils.classloaders.CodeGenClassFinder@115c6cb, annotation: ApplicationClassLoader@, parent: weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder: weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null, parent: sun.misc.Launcher$AppClassLoader@9f2a0b)))))
              [GenericClassLoader] : Found class: org.apache.taglibs.standard.lang.jstl.ELEvaluator
              [GenericClassLoader] : weblogic.utils.classloaders.ChangeAwareClassLoader@1b60d0a( finder: weblogic.utils.classloaders.CodeGenClassFinder@4abd99, annotation: consumer_web_1_WAR@consumer_1, parent: weblogic.utils.classloaders.GenericClassLoader@5b9d44( finder: weblogic.utils.classloaders.CodeGenClassFinder@99823, annotation: consumer_web_1_WAR@, parent: weblogic.utils.classloaders.GenericClassLoader@a23d38( finder: weblogic.utils.classloaders.CodeGenClassFinder@115c6cb, annotation: ApplicationClassLoader@, parent: weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder: weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null, parent: sun.misc.Launcher$AppClassLoader@9f2a0b)))) defined class class org.apache.taglibs.standard.lang.jstl.ELEvaluator
              [GenericClassLoader] : Looking for class: org.apache.taglibs.standard.lang.jstl.MinusOperator...
              With classpath of : ()
              Classloader object id (weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder: weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null, parent: sun.misc.Launcher$AppClassLoader@9f2a0b))
              [GenericClassLoader] : Class org.apache.taglibs.standard.lang.jstl.MinusOperator not found.
              [GenericClassLoader] : Looking for class: org.apache.taglibs.standard.lang.jstl.MinusOperator...
              With classpath of : ()
              Classloader object id (weblogic.utils.classloaders.GenericClassLoader@a23d38( finder: weblogic.utils.classloaders.CodeGenClassFinder@115c6cb, annotation: ApplicationClassLoader@, parent: weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder: weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null, parent: sun.misc.Launcher$AppClassLoader@9f2a0b)))
              [GenericClassLoader] : Class org.apache.taglibs.standard.lang.jstl.MinusOperator not found.
              [GenericClassLoader] : Looking for class: org.apache.taglibs.standard.lang.jstl.MinusOperator...
              With classpath of : (/opt/bea/user_projects/e5489h17/batchconsumer/stage/consumer_web_1_WAR/APP-INF/classes)
              Classloader object id (weblogic.utils.classloaders.GenericClassLoader@5b9d44( finder: weblogic.utils.classloaders.CodeGenClassFinder@99823, annotation: consumer_web_1_WAR@, parent: weblogic.utils.classloaders.GenericClassLoader@a23d38( finder: weblogic.utils.classloaders.CodeGenClassFinder@115c6cb, annotation: ApplicationClassLoader@, parent: weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder: weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null, parent: sun.misc.Launcher$AppClassLoader@9f2a0b))))
              [GenericClassLoader] : Class org.apache.taglibs.standard.lang.jstl.MinusOperator not found.
              [ChangeAwareClassLoader] : weblogic.utils.classloaders.ChangeAwareClassLoader@1b60d0a( finder: weblogic.utils.classloaders.CodeGenClassFinder@4abd99, annotation: consumer_web_1_WAR@consumer_1, parent: weblogic.utils.classloaders.GenericClassLoader@5b9d44( finder: weblogic.utils.classloaders.CodeGenClassFinder@99823, annotation: consumer_web_1_WAR@, parent: weblogic.utils.classloaders.GenericClassLoader@a23d38( finder: weblogic.utils.classloaders.CodeGenClassFinder@115c6cb, annotation: ApplicationClassLoader@, parent: weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder: weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null, parent: sun.misc.Launcher$AppClassLoader@9f2a0b)))) about to loadClass(org.apache.taglibs.standard.lang.jstl.MinusOperator)
              [GenericClassLoader] : Looking for class: org.apache.taglibs.standard.lang.jstl.MinusOperator...
              With classpath of : ()
              Classloader object id (weblogic.utils.classloaders.ChangeAwareClassLoader@1b60d0a( finder: weblogic.utils.classloaders.CodeGenClassFinder@4abd99, annotation: consumer_web_1_WAR@consumer_1, parent: weblogic.utils.classloaders.GenericClassLoader@5b9d44( finder: weblogic.utils.classloaders.CodeGenClassFinder@99823, annotation: consumer_web_1_WAR@, parent: weblogic.utils.classloaders.GenericClassLoader@a23d38( finder: weblogic.utils.classloaders.CodeGenClassFinder@115c6cb, annotation: ApplicationClassLoader@, parent: weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder: weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null, parent: sun.misc.Launcher$AppClassLoader@9f2a0b)))))
              [GenericClassLoader] : Class org.apache.taglibs.standard.lang.jstl.MinusOperator not found.
              </pre>
              Is there a patch available for it? or are there any workaround for it?

    A NoClassDefFoundError here indicates that you probably have a Class in the
              System classpath which depends on another class not in the system classpath.
              Can you show me the jars which the App (webapp/app) contains and those that
              you've added to the system classpath?
              -- Nagesh
              <Toru Watanabe> wrote in message news:[email protected]...
              >I got the following error when I call JSP on WLS 8.1sp4 running on Solaris
              >9.
              > <pre>
              > java.lang.NoClassDefFoundError:
              > org/apache/taglibs/standard/lang/jstl/MinusOperator
              > at
              > org.apache.taglibs.standard.lang.jstl.ELEvaluator.parseExpressionString(ELEvaluator.java:259)
              > at
              > org.apache.taglibs.standard.lang.jstl.ELEvaluator.evaluate(ELEvaluator.java:191)
              > at
              > org.apache.taglibs.standard.lang.jstl.ELEvaluator.evaluate(ELEvaluator.java:163)
              > at
              > org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:101)
              > at
              > org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:129)
              > at
              > org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager.evaluate(ExpressionEvaluatorManager.java:75)
              > at
              > org.apache.taglibs.standard.tag.el.core.ExpressionUtil.evalNotNull(ExpressionUtil.java:48)
              > at
              > org.apache.taglibs.standard.tag.el.core.OutTag.evaluateExpressions(OutTag.java:99)
              > at
              > org.apache.taglibs.standard.tag.el.core.OutTag.doStartTag(OutTag.java:57)
              > </pre>
              >
              > This Error is strange because other jstl classes are loaded successfully.
              > when I debuged classloaders using -Dweblogic.Debug option, then I found
              > that instance of classloader had never changed but something internal had
              > been changed.
              > please see below. internal classpath followed by "with classpath of" of
              > ChangeAwareClassLoader@1b60d0a had been changed, and I supporse this is
              > the reason why I got NoClassDefFoundError.
              >
              > <pre>
              > [GenericClassLoader] :
              > weblogic.utils.classloaders.ChangeAwareClassLoader@1b60d0a( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@4abd99, annotation:
              > consumer_web_1_WAR@consumer_1, parent:
              > weblogic.utils.classloaders.GenericClassLoader@5b9d44( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@99823, annotation:
              > consumer_web_1_WAR@, parent:
              > weblogic.utils.classloaders.GenericClassLoader@a23d38( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@115c6cb, annotation:
              > ApplicationClassLoader@,
              > parent: weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null,
              > parent: sun.misc.Launcher$AppClassLoader@9f2a0b)))) defined class
              > interface org.apache.taglibs.standard.lang.jstl.VariableResolver
              > [GenericClassLoader] : Looking for class:
              > org.apache.taglibs.standard.lang.jstl.ELEvaluator...
              > With classpath of : ()
              > Classloader object id
              > (weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null,
              > parent: sun.misc.Launcher$AppClassLoader@9f2a0b))
              > [GenericClassLoader] : Class
              > org.apache.taglibs.standard.lang.jstl.ELEvaluator not found.
              > [GenericClassLoader] : Looking for class:
              > org.apache.taglibs.standard.lang.jstl.ELEvaluator...
              > With classpath of : ()
              > Classloader object id
              > (weblogic.utils.classloaders.GenericClassLoader@a23d38( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@115c6cb, annotation:
              > ApplicationClassLoader@, parent:
              > weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null,
              > parent: sun.misc.Launcher$AppClassLoader@9f2a0b)))
              > [GenericClassLoader] : Class
              > org.apache.taglibs.standard.lang.jstl.ELEvaluator not found.
              > [GenericClassLoader] : Looking for class:
              > org.apache.taglibs.standard.lang.jstl.ELEvaluator...
              > With classpath of :
              > (/opt/bea/user_projects/e5489h17/batchconsumer/stage/consumer_web_1_WAR/APP-INF/classes)
              > Classloader object id
              > (weblogic.utils.classloaders.GenericClassLoader@5b9d44( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@99823, annotation:
              > consumer_web_1_WAR@, parent:
              > weblogic.utils.classloaders.GenericClassLoader@a23d38( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@115c6cb, annotation:
              > ApplicationClassLoader@, parent:
              > weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null,
              > parent: sun.misc.Launcher$A
              > ppClassLoader@9f2a0b))))
              > [GenericClassLoader] : Class
              > org.apache.taglibs.standard.lang.jstl.ELEvaluator not found.
              > [ChangeAwareClassLoader] :
              > weblogic.utils.classloaders.ChangeAwareClassLoader@1b60d0a( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@4abd99, annotation:
              > consumer_web_1_WAR@consumer_1, parent:
              > weblogic.utils.classloaders.GenericClassLoader@5b9d44( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@99823, annotation:
              > consumer_web_1_WAR@, parent:
              > weblogic.utils.classloaders.GenericClassLoader@a23d38( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@115c6cb, annotation:
              > ApplicationClassLoad
              > er@, parent: weblogic.utils.classloaders.GenericClassLoader@18bd7f1(
              > finder: weblogic.utils.classloaders.CodeGenClassFinder@1896444,
              > annotation: null, parent: sun.misc.Launcher$AppClassLoader@9f2a0b))))
              > about to loadClass(org.apache.taglibs.standard.lang.jstl.ELEvaluator)
              > [GenericClassLoader] : Looking for class:
              > org.apache.taglibs.standard.lang.jstl.ELEvaluator...
              > With classpath of :
              > (/export/home/opt/bea/user_projects/e5489h17/batchconsumer/.wlnotdelete/extract/batchconsumer_consumer_web_1_WAR_consumer_1/jarfiles/WEB-INF/lib/commons-logging.jar)
              > Classloader object id
              > (weblogic.utils.classloaders.ChangeAwareClassLoader@1b60d0a( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@4abd99, annotation:
              > consumer_web_1_WAR@consumer_1, parent:
              > weblogic.utils.classloaders.GenericClassLoader@5b9d44( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@99823, annotation:
              > consumer_web_1_WAR@, parent:
              > weblogic.utils.classloaders.GenericClassLoader@a23d38( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@115c6cb, annotation:
              > ApplicationClassLoader@,
              > parent: weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null,
              > parent: sun.misc.Launcher$AppClassLoader@9f2a0b)))))
              > [GenericClassLoader] : Found class:
              > org.apache.taglibs.standard.lang.jstl.ELEvaluator
              > [GenericClassLoader] :
              > weblogic.utils.classloaders.ChangeAwareClassLoader@1b60d0a( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@4abd99, annotation:
              > consumer_web_1_WAR@consumer_1, parent:
              > weblogic.utils.classloaders.GenericClassLoader@5b9d44( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@99823, annotation:
              > consumer_web_1_WAR@, parent:
              > weblogic.utils.classloaders.GenericClassLoader@a23d38( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@115c6cb, annotation:
              > ApplicationClassLoader@,
              > parent: weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null,
              > parent: sun.misc.Launcher$AppClassLoader@9f2a0b)))) defined class class
              > org.apache.taglibs.standard.lang.jstl.ELEvaluator
              > [GenericClassLoader] : Looking for class:
              > org.apache.taglibs.standard.lang.jstl.MinusOperator...
              > With classpath of : ()
              > Classloader object id
              > (weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null,
              > parent: sun.misc.Launcher$AppClassLoader@9f2a0b))
              > [GenericClassLoader] : Class
              > org.apache.taglibs.standard.lang.jstl.MinusOperator not found.
              > [GenericClassLoader] : Looking for class:
              > org.apache.taglibs.standard.lang.jstl.MinusOperator...
              > With classpath of : ()
              > Classloader object id
              > (weblogic.utils.classloaders.GenericClassLoader@a23d38( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@115c6cb, annotation:
              > ApplicationClassLoader@, parent:
              > weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null,
              > parent: sun.misc.Launcher$AppClassLoader@9f2a0b)))
              > [GenericClassLoader] : Class
              > org.apache.taglibs.standard.lang.jstl.MinusOperator not found.
              > [GenericClassLoader] : Looking for class:
              > org.apache.taglibs.standard.lang.jstl.MinusOperator...
              > With classpath of :
              > (/opt/bea/user_projects/e5489h17/batchconsumer/stage/consumer_web_1_WAR/APP-INF/classes)
              > Classloader object id
              > (weblogic.utils.classloaders.GenericClassLoader@5b9d44( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@99823, annotation:
              > consumer_web_1_WAR@, parent:
              > weblogic.utils.classloaders.GenericClassLoader@a23d38( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@115c6cb, annotation:
              > ApplicationClassLoader@, parent:
              > weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null,
              > parent: sun.misc.Launcher$A
              > ppClassLoader@9f2a0b))))
              > [GenericClassLoader] : Class
              > org.apache.taglibs.standard.lang.jstl.MinusOperator not found.
              > [ChangeAwareClassLoader] :
              > weblogic.utils.classloaders.ChangeAwareClassLoader@1b60d0a( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@4abd99, annotation:
              > consumer_web_1_WAR@consumer_1, parent:
              > weblogic.utils.classloaders.GenericClassLoader@5b9d44( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@99823, annotation:
              > consumer_web_1_WAR@, parent:
              > weblogic.utils.classloaders.GenericClassLoader@a23d38( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@115c6cb, annotation:
              > ApplicationClassLoad
              > er@, parent: weblogic.utils.classloaders.GenericClassLoader@18bd7f1(
              > finder: weblogic.utils.classloaders.CodeGenClassFinder@1896444,
              > annotation: null, parent: sun.misc.Launcher$AppClassLoader@9f2a0b))))
              > about to loadClass(org.apache.taglibs.standard.lang.jstl.MinusOperator)
              > [GenericClassLoader] : Looking for class:
              > org.apache.taglibs.standard.lang.jstl.MinusOperator...
              > With classpath of : ()
              > Classloader object id
              > (weblogic.utils.classloaders.ChangeAwareClassLoader@1b60d0a( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@4abd99, annotation:
              > consumer_web_1_WAR@consumer_1, parent:
              > weblogic.utils.classloaders.GenericClassLoader@5b9d44( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@99823, annotation:
              > consumer_web_1_WAR@, parent:
              > weblogic.utils.classloaders.GenericClassLoader@a23d38( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@115c6cb, annotation:
              > ApplicationClassLoader@,
              > parent: weblogic.utils.classloaders.GenericClassLoader@18bd7f1( finder:
              > weblogic.utils.classloaders.CodeGenClassFinder@1896444, annotation: null,
              > parent: sun.misc.Launcher$AppClassLoader@9f2a0b)))))
              > [GenericClassLoader] : Class
              > org.apache.taglibs.standard.lang.jstl.MinusOperator not found.
              > </pre>
              >
              > Is there a patch available for it? or are there any workaround for it?

  • Classloader won't let me delete jar file!

    Hi-
    I am writing a classloader that runs main from a class called MyMain. MyMain loads classes from a jar file called MattTable.jar. I need to be able to delete the jar file once the classes are loaded from it, or even just delete it at the end of the program. Either way, the classloader will not release it so I cannot delete the jar file until after my program finishes. I want to be able to delete it from with in my code after the method is invoked.
    URL urls[] = new URL[] { new File(".").toURL() };
    URLClassLoader loader = new URLClassLoader( urls );
    Class c = loader.loadClass(mainClass);
    Method m1 = c.getMethod("main", new Class[] { args.getClass() });
    //main loads classes from an outside jar file
    m1.invoke( null, new Object[] {args} );
    //Here is where I want to delete the jar file
    //I would even accept file.deleteOnExit() but this won't work either
    If anyone can help me figure out how to delete this file, it would be a great help!
    Thanks,
    Matt

    Hi,
    I've created a small classloader for jar files which releases the handle every time a class is loaded. It might still need some optimization, but at least it works:import java.util.zip.*;
    import java.util.*;
    import java.io.*;
    public class ZipClassLoader extends ClassLoader {
         private Hashtable classes = new Hashtable();
         private File f;
         public ZipClassLoader(String zipFileName) {
              this (new File(zipFileName));
         public ZipClassLoader(File zipFile) {
              f = zipFile;
         public Class loadClass(String className) throws ClassNotFoundException {
              return (loadClass(className, true));
         public synchronized Class loadClass(String className, boolean resolve) throws ClassNotFoundException {
              if (classes.containsKey(className)) return (Class)classes.get(className);
              ZipFile zipFile = null;
              BufferedInputStream bis = null;
              byte[] res = null;
              try {
                   zipFile = new ZipFile(f);
                   ZipEntry zipEntry = zipFile.getEntry(className.replace('.', '/')+".class");
                   res = new byte[(int)zipEntry.getSize()];
                   bis = new BufferedInputStream(zipFile.getInputStream(zipEntry));
                   bis.read(res, 0, res.length);
              } catch (Exception ex) {
              } finally {
                   if (bis!=null) {
                        try {
                             bis.close();
                        } catch (IOException ioex) {}
                   if (zipFile!=null) {
                        try {
                             zipFile.close();
                        } catch (IOException ioex) {}
              if (res == null) return super.findSystemClass(className);
              Class clazz = defineClass(className, res, 0, res.length);
              if (clazz == null) throw new ClassFormatError();
              if (resolve) resolveClass(clazz);
              classes.put(className, clazz);
              return(clazz);
    }This is the test program I've created. It loads a class from the Apache log4j jar file, and deletes the file when the class is loaded:import java.io.File;
    public class Test {
         public static void main(String[] args) throws Exception {
              File f = new File("C:\\jartest\\log4j-1.2.6.jar");
              ZipClassLoader zl = new ZipClassLoader (f);
              Class c = zl.loadClass ("org.apache.log4j.ConsoleAppender", true);
              Object o = c.newInstance();
              System.out.println (o.getClass().getName());
              f.delete();
    }

  • Loading an entire JAR via a classloader

    Hi how would I load an entire JAR file via a classloader. Currently I'm able to load one file at a time (in this case org.w3c.dom.Node) as shown below:
    import java.net.*;
    public class MyJarLoader {
       public static void main(String [] args) throws Exception {
         URL[] urlsToLoadFrom = new URL[]{new URL("file:subdir3/xml-apis.jar")};
         URLClassLoader loader1 = new URLClassLoader(urlsToLoadFrom);
         Class cls1 = Class.forName("org.w3c.dom.Node", true, loader1);
         System.out.println("Loaded '"+cls1.getName()+"'");
         org.w3c.dom.Node Node = (org.w3c.dom.Node) cls1.newInstance();
    Thanks

    Figured this one out as below. Note this is the simplistic solution since it requires that the jar files be present in the classpath. If not, you will have to write your own loadClass method to read the data from the zip (& then can't use the method 'Class.forName()').
    Regards
    //Load Apache JAR files
    URL[] urlArrToLoadFrom = new URL[]{new URL("file:xalan-j_2_5_0/xml-apis.jar"),
                new URL("file:xalan-j_2_5_0/xercesImpl.jar"), new URL("file:xalan-j_2_5_0/xalan.jar")};
    //Create a URLClassLoader to access jar files
    URLClassLoader urlLoaderGeneric = new URLClassLoader(urlArrToLoadFrom);
    //Foreach jar file, open, load class files & close
    for(int i=0; i<urlArrToLoadFrom.length; i++) {
    //Debug
       System.out.println(urlArrToLoadFrom.toString());
       //Open zip file
       ZipFile zf = new ZipFile(urlArrToLoadFrom[i].getFile());
       for (Enumeration enum = zf.entries(); enum.hasMoreElements();) {
         //Get entry
         ZipEntry ze = (ZipEntry) enum.nextElement();
         //Only load if it's not a directory and it's a class file
         int iIndexClass = -1;
         if (!ze.isDirectory() && ((iIndexClass = ze.getName().indexOf(".class")) != -1)) {
             //Remove .class & replace / with .
             String strApacheClassName = (ze.getName().substring(0,iIndexClass)).replace('/','.');
             //Load class file
             Class classApache = Class.forName(strApacheClassName, true, urlLoaderGeneric);
             System.out.println("Loaded '"+classApache.getName()+"'");
       //Close zip
       zf.close();

  • Loading a jar via a custom classloader

    Hi,
    I have written a custom class loader that allows me to load a compiled java program as a collection of class files at runtime.
    This is nice however I now need to consider the runtime execution of more complex java programs that have custom library dependencies.
    This means loading a .jar library into the classloader. I can get the contents of a jar and load specific classes by name via reflection but I want to load the entire jar into the classloader so that its contents can be used 'as needed' much like a jar on the system classpath.
    Is this possible? If so I would like to know how as I have been struggling with this problem and cannot see a solution.
    Regards,
    Stephen

    However I still don't understand why you need to
    actually load all those classes initially. Afterall,
    URLClassLoader (which sounds a lot like what youare
    describing) only loads classes as needed.i have just built a swing app that accesses an oracle
    database, i jared together all the classes, and i did
    something in the manfest file so that you can just
    double clisk the jar and it fires up like an exe.
    doing it this way everything is fine except it cannot
    access the database, the reason is those oracle
    classes are not loaded, even they are on the path - i
    can run the app using a batch file but i dont like it
    as it opens up a dos window. this is an example, as i
    was told, where it is necessary to load all thoses
    oracle database classes initially. Dear, daFei.
    I believe that you are getting confused between the way the system will ignore that CLASPPATH environment variable when you run a java application packaged as a jar file with the -jar switch (the classpath for the jar can be set in the manifest) and what I am attempting to-do which is to run a compiled java program at runtime and dynamically load any dependant libraries.
    Stephen

  • Replacing JAR files loaded by custom ClassLoader

    Hi all,
    I am trying to create an auto-updater for a stand alone application, which can look for new versions of relevant jar files on the internet and download them. I have code which will look for newly downloaded versions and can replace the old jar file with the new one (using simple File methods). This works fine for when the application is started initially, but as the application is a server and may not manually be started for a long time, I am trying to force the server to restart and reload with the new code.
    if(newCode.exists()) {
         System.out.println("new code!");
         if(oldCode.exists()) {
              oldCode.delete();
         if(code.exists()) {
              if(! code.renameTo(oldCode)) {
                        throw new IOException("Error backing up code file");
         if(! newCode.renameTo(code)) {
              throw new IOException("Error installing new code file");
    }I have looked around the forums a bit, and have come up with using a ClassLoader based on URLClassLoader:
    class ProxyLoader extends URLClassLoader
         public ProxyLoader(String jarFile) throws MalformedURLException {
              super(new URL[] { (new File(jarFile)).toURL() });
         public Class findClass(String name) throws ClassNotFoundException {
              System.out.println("Finding: " + name);
              return super.findClass(name);
    }This seems to work OK, as all the classes from the jar file are loaded by this classloader.
    I have a method which can create an instance of the class loader, and load the server application.
    private boolean startProxy(int port) {
         try {
              pl = new ProxyLoader("proxy.jar");
              Class ptClass = pl.loadClass("proxy.POPThread");
              pt = ptClass.newInstance();
              Method ptStart = ptClass.getMethod("start", new Class[0]);
              ptStart.invoke(pt, new Object[0]);
              return true;
         } catch(Exception e) {
              return false;
    }I also have a method to shut down the server:
    private boolean stopProxy() {
         try {
              Class ptClass = pl.loadClass("proxy.POPThread");
              Method ptInterrupt = ptClass.getMethod("interrupt", new Class[0]);
              ptInterrupt.invoke(pt, new Object[0]);
              return true;
         } catch(Exception e) {
              return false;
    }These appear to be working fine, the problem I have however is when I try to rename the existing jar file (proxy.jar) in order to replace it with a new one (proxy.new), the renameTo method on the File object fails. I am guessing that is because the proxy.jar file is still in use by the JVM. I have tried setting the classloader var to null, but this doesnt seem to have any effect.
    My main question is how can I 'free' the jar file so that it can be replaced with new code? Is it possible? My only otherway of working around this is to have a variable stored in a file pointing at the 'current' code, but the jar file isn't litterally replaced.
    This is a standalone application, which will probably run in a startup script on a server, so webstart isn't really an option.
    TIA
    iklesteve

    I have found this to be true anytime I try to use the renameTo() API to rename a file with a .jar file extension (regardless of the actual file type - i.e. it could be a text file with .jar appended and it will still fail) in the case where the class making the renameTo() call is loaded from another .jar file.
    I run the same exact code after extracting from the .jar, then the rename to the other .jar file is successful. Also, if I rename the .jar file to a ".ja" file, I can successfully rename the jar file even if the code is running with the context of another .jar file.
    Is this some kind of bogus security measure within the JVM or is it a bug?

  • Classloading [EAR] - [webapp.war+ejb.jar]

    Hi.
    I've got a problem with the classloader hierarchy in WL 6.0.
    When I deploy my war/ejb application as an EAR, everything works fine.
    But I want (for several reasons) to deploy
    EJB jars and WebApp wars (or exploded Web Apps) seperately.
    WL 6.0 EJB classloader doesn't export remote/home interfaces and
    helper classes,
    so my web app can't find them.
    When I include that interfaces/classes in my Web App, I get
    occasionally ClassCastExceptions (I assume depending on classloader
    caching).
    Is there a way to configure the classloader hierarchy, or do you have
    any other solution for this?
    Thanks,
    Roman

    Hello,
    I have a big application to do.
    So, one solution should be to use an EAR for one
    module, containing the WAR for the web-tier and the
    EJB-JAR for the business-tier.
    It would be better doing like this than creating a
    big WAR, in order to avoid to deploy a big WAR when a
    modification is done in one module.Are you using local EJBs or remote EJBs? The only way for a war to talk to a local EJB is to package the war along with the ejb-jar in an EAR file because they need to be collocated. You can not simply bundle EJB classes in a war file.
    If you are using remte EJBs, then you can package the EJB client view classes along with the servlets and JSPs in the war file and deploy the war separately. But again your war will be one big war.
    If your EJBs are just entity beans, then Java EE 5 (see http://weblogs.java.net/blog/ss141213/archive/2005/12/using_java_pers.html) allows you some nice options.
    >
    What about the problem of the session ?
    In fact, I have to declare a context-root for one
    EAR.
    And at each context-root is created an object
    HttpSession on the server.
    So, I have some questions about this :
    - How can I configure my WARs in order to use only
    one HttpSession object for every WARs ?
    There is no standard way to do this. Relying on any application server specific feature can only make your app non-portable. So I strongly recommend you not to do this.
    - Can I put multiple WARs in one EAR ?Of course you can.
    If yes, what about the context-root ? This solution would resolve
    the session problem.Can't be solved using any standard way. So I suggest you stick to one big war, if that's what your business requirement is.To speed up development-deployment-test cycle, any appserver allows a rapid deployment option where in you can deploy incremental changes to server. Use this facility during development. DON'T sacrifice portability of your app by using any product specific configuration that you may not find any where else.
    Thanks,
    Sahoo

Maybe you are looking for

  • Error in this code - javafx

    Sorry for the question but I'm a newbie I have this code: http://weblogs.java.net/blog/brunogh/archive/2007/09/my_first_fx_blu_1.html Button {                              text: "Inquiry"                              enabled : bind model.inquiryBtnEn

  • My iBooks app now displays all PDF's as "Untitled"

    Good Morning: My iPhone 3GS is now displaying all new PDF's with the title "Untitled" in my ibooks app. This started after the recent iBooks update. The previous PDF's I have on iBooks from before the update all have the titles of the PDF as it was l

  • HT4623 how do you do this if your ipod is disabled?

    idk

  • Incremental Export and Import...Please Help..

    Hello experts! Please help..... We are running a program with and same database with same user/password in different location and branches. We dont have any centralization, regularly after updating stock and sales they will send the .dmp file through

  • Chapter Id problem

    Hi, Facing some problem while creating Excise Invoice when chapter id is different. step-1. Creation of Sale Order (VA01).      system accept material with different chapter id. step-2. Outbound Delivery (VL01N)      system accept material with diffe