Can I set Boot class loader or system class loader?

In my application, there are classes in a jar files, all these files in the jar need be loaded by a ClassLoader in my application.
And the classes out of jar do not need the ClassLoader to load. the structure is like :
-----myapp.jar ------in this jar, all classes need be loaded by a specified ClassLoader
|---anoapp ------classes in this package, is normal classes
|-------|----a.class
|----b.class
| ----other classes
but my a.class need to access a class in myapp.jar, so I load the class use my ClassLoader, but there still occur
**********ClassFormatError : bad magic number**************
I print the classloader in a.class
+---- System ClassLoader is : com.sun.misc.Launcher$AppClassLoader    ------------it is not my ClassLoader
+---- a.class.getClassLoader is same as System ClassLoader    -------------------it still is not my ClassLoader
+---- Thread.currentThread().getContextClassLoader          ------------------ it is my ClassLoader
So I think when I access class in myapp.jar, it will loaded by System ClassLoader or Bootstrap ClassLoader, if I can set one these two classloader as my ClassLoader, it maybe not occur the Error,
But There are not obvious method in System or Runtime etc.
1. So can Set System Classloader or Bootstrap ClassLoader?
2. If not, How can solve my problem?
Thands in advanced!

**********ClassFormatError : bad magic number**************If you get that error, then no classloader will help you. This is a problem with your running code meant for a newer version of the Virtual Machine in an older version.
Looks like you're compiling the code with a recent JDK (1.4.x?), but running with an older VM. Try just typing "java -version" and see what it prints.
This should just be a matter of running with the right VM. If this is an applet you're trying to run inside the browser, make sure that the browser is using the right VM. Run the "Java Control Panel" and select the correct version.

Similar Messages

  • How can I set document date automatically as system date?

    I use FBV1, FBV2, F-02, FB02. Posting date is automatically set as system date. I want to set document date automatically as system date.
    How can I set document date automaticall as system date?
    Wbr.
    İlker Çokkeçeci
    Computer Engineer
    Ankara, Turkey

    Hi Expert,
    Please refer the below link..
    Document date to be defaulted as system date for all FI transactions
    as there mentioned, please go to T-Code: SHD0.
    Regards,
    GK
    SAP

  • Can i set up standby in Single system

    Hi all,
    Can i setup the standby in single system?
    If yes, my primary DB in C:\ORACLE i want to set up my standby DB in E:\ORACLE. I am trying to do the setup, but iam getting the problem at standby control file.
    1) I cann't give the same name for the databases, if i give we cann't open the databases in exclusive mode
    2) If i give different DB name for stand by DB, my standby control file is not identifying the new DB name.
    Please give me the solution...
    Thanks in advance
    Mahi

    Thanks murlib , After updating this thread , realized I have not mention about some lock parameter and exact name (lock_name_space) is not coming to my mind and in btw you updated name, Thanks. With out this parameter no-way 2 database with same db_name can start, because lock file in $ORACLE_HOME/dbs created using this parameter only.
    Cheer,
    Virag

  • Can you set a global EntityResolver (via system property, or static method)

    I'm trying to set a customized EntityResolver (telling the xml parser where to look for XML schema files).
    Usually, you'd use the standard syntax - somehting like:
    SaxParser parser=new SaxParser();
    parser.parser.setEntityResolver(myResolver);
    However, I was wondering whether you can set a "global" EntityResolver, to be used as default for all parsers ?
    Maybe this can be done through some system property, or a static method somewhere in the parsing XML ?
    (BTW, I need it because I'm using some third-party API, that encapsulates a SaxParser, but won't let me access it, so I can't configure it directly).
    thanks.

    I don't think you can.
    What is possible is to set content on the folder resource itself; that would be returned instead of the page you mentioned.

  • HT3986 why can't my boot camp in mac system detect the win7 system i've installed

    I try to use parallel in my macbook pro, but it can't show me the boot camp option that i used to intall win7.
    when i click my boot camp assistance in mac system, it shows me only to continue to install windows. is it supposed to be like this?

    Unclear what you did and askng your system to do.
    Can you boot Windows natively now?
    If you want to dual boot Windows and Mac, you use Boot Camp.
    If you want to do all that, AND you also want to use your Windows as a guest OS under Mac using parallels you setup parallels after Windows was installed and functioning and fully updated first.
    And Parallels has their How To, FAQ and support forum.
    http://en.wikipedia.org/wiki/Comparison_of_VMware_Fusion_and_Parallels_Desktop
    http://www.parallels.com/products/desktop?icid=1480

  • How can I set or reset the page that is loaded when I open a new tab using Ctrl t ?? by

    I recently downloaded a program that has, as an undesired additional action, apprently setup Yahoo as the page that opens by default when I open a new tab using <Ctrl> <t> (or the <+> symbol on the tab bar). This is aggravating to me, particularly as I have not been able to find a way to stop it occurring.
    I expect that it is buried somewhere in my profile, but I also have not found a way to explore or edit the contents of my profile.
    There is a JScript script file called "user" in ...\profiles\4g4vpust.default that I suspect is associated with the behaviour, but renaming it achieved nothing.
    Prior to this, my new tabs used to open as blank pages, i.e. did not load any URL and I was happy with that. How can I get back to that state?

    Did it add the freeze net assistant add-on? That add-on is known to do this. If you have that add-on you can uninstall it Firefox should revert to the default behavior.
    If you do not have that add-on, another add-on will be causing this, you can use the procedure in the following link to identify what one - https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Can you set permissions to a help system?

    Hi -- i am creating a helpsystem and was wondering if with RoboHelp 8, i can limit who sees which book/Topic?
    We need this because certain customers who will view this help system will not be able to see the certain parts of the application. They have certain rights for each application.
    My fear is that i will have to create separate helpsystem projects for each of the different pieces...
    If anyone has ANY ideas  -- thank would be great! Thank you!
    Allison

    Hi Allison. This can't be handled from within RoboHelp but you have the following options.
    Firstly, the application installation could check the user's licence and only install the relevant help files. If you are outputting CHM files, this is fairly straitforward as you just have a CHM for each licenced area and the application installs the relevant ones.
    Secondly, use WebHelp output to a website or internal server. You could then apply security to the output files as required.
    Lastly you could output WebHelp Pro output to a server using the Robohelp Server 8 application. This has the concept of protected areas that only users with the correct logonb and password can access.
    Read the RoboColum(n) for a tips,  tricks and musings on the Technical Communication Suite products.

  • How can I set up a 2nd user on mac pro

    want a family member to be able to log in on my desktop mac without access to my applications. How can I set up 2nd user?

    System Preferences > Accounts > ...
    Click on the lock in the bottom left and enter your Admin Username and password.
    Click on the Plus [+] button under the left column.
    Create a new user, generally NOT [ ] allow user to administer this computer.
    This user is completely separate, can have their own email, their own desktop, and cannot mess up your settings on shared Applications or email. They WILL have access to Applications in /Applications, but not the ones in /Users/<yourname>/applications.
    If you need additional restrictions, use Parental Controls.

  • How can I set the ff4 to English version

    I download ff4 to be my browser,I prefer English version. Can I set it ?

    Try the JsfUtils class instead that includes this method:
      public static void setExpressionValue(String expression, Object newValue) {
        FacesContext facesContext = getFacesContext();
        Application app = facesContext.getApplication();
        ExpressionFactory elFactory = app.getExpressionFactory();
        ELContext elContext = facesContext.getELContext();
        ValueExpression valueExp = elFactory.createValueExpression(elContext, expression, Object.class);
        //Check that the input newValue can be cast to the property type
        //expected by the managed bean.
        //If the managed Bean expects a primitive we rely on Auto-Unboxing
        //I could do a more comprehensive check and conversion from the object
        //to the equivilent primitive but life is too short
        Class bindClass = valueExp.getType(elContext);
        if (bindClass.isPrimitive() || bindClass.isInstance(newValue)) {
          valueExp.setValue(elContext, newValue);
      }Assuming claim type is a String, you could then call:
    JsfUtils.setExpressionValue("#{ClaimValueObj.claimType}", "someValue");Note to call the getters and setters via your EL expression, you don't include the get/set prefix.
    JsfUtils is available via SRDemo or similar, not the standard Oracle libraries. Otherwise just rip the method above into your own code.
    Regards,
    CM.

  • "Can't open boot device" mesage when installing Solaris 10 by cdrom

    I am getting the following error message when I try to install Solaris 10 from cdrom:
    "Can't open boot device."
    The system I am trying to install to is a SunFire v100.
    The boot command I am using is:
    ok boot cdrom - nowin
    I have used this cd to successfully install several other v100s without any trouble. I have tried another cd and get the same behavior. I have also tried installing another v100 and get the same error.
    Any help on this would be greatly appreciated.

    Please check the "cdrom" alias.
    -g.

  • How to load a class dynamically in the current/system class loader

    I need to dynamically load a new jdbc driver jar to the current/system class loader... Please note that creating a new classloader will not help since the DriverManager refers to the systemclassloader itself.
    Restarting the application by appending the jar to its classpath will solve the problem but I want to avoid doing this.

    Did you then create a ClassLoader to load the JDBC
    driver and then install it into the system as
    directed by the JDBC specification (ie
    Class.forName(someClassName))?
    And then try to use it from a class loaded fromsome
    other ClassLoader (i.e. the system class loader)?
    If you did not try this please explain why not.O.K. I just looked at the source to
    java.sql.DriverManager. I did not know what I was
    talking about, as what I suggested above will not
    work.
    This is my new Idea:
    Create a URLClassLoader to load the JDBC driver also
    in this ClassLoader you need to place a helper class
    that does the following:
    public class Helper {
    public Driver getJDBCDriver(String driverClassName,
    String url) {
    try {
    Class.forName(driverClassName);
    Driver d = DriverManager.getDriver(url);
    return d;
    catch(Exception ex) {
    ex.printStackTrace();
    return null;
    }Now create an instance of the Helper class in the new
    ClassLoader, and call its getJDBCDriver method to get
    an instance of the driver (you will probably have to
    create an interface in the root class loader that the
    Helper implements so that you can easily call it).
    Now from the root classloader you can make calls
    directly to the returned Driver and bypass the
    DriverManager and its restrictions on cross
    ClassLoader access.
    The only catch here is that you would have to call to
    the returned Driver directly and not use the Driver
    Manager.This sounds like will work but I did not want to load DriverManager in a new classloader.. I did a hack
    I unzip the jar dynamically in a previously known location (which I included in my classpath when launching the app). The classLoader finds the class now though it did not exist when the app was launched !
    A hack of-course but works eh ..

  • System Preferences can't set date and time and other odd behaviour

    I have a 2008 Macbook Air, which is beginning to show signs of age, but now appears to have taken on a terminal problem.  I can't set the date and time in the system preferences, even when connected to the internet - the pane just comes up as faded out and I am unable to do anything. The problem started after I accidentally allowed the battery to run down without having shut down the computer and it automatically assumed a date of 1 Jan 2001. I am unable to perform any updates on the machine until the issue is resolved, according to software update.
    Other strange things that have happened are that the trackpad no longer responds to the 'tap to click' function or 'two finger' click. In system preferences, I cannot edit energy saver, network (advanced) or account settings - attempting to do so brings up more faded panels or an error message after failure to load.
    Has anyone seen similiar behaviour on their mac or have suggestions as how I might resolve the problem?
    Thanks!

    If this is recent, what has changed since the last time D&T worked correctly?
    I see that your Question has languished for some period of time without response. You have posted your issue in Using Apple Support Communities whose topic is 'How to use this forum software's interface, features and/or how to find what you wish'. It is a relatively low traffic and inappropriate forum for your problem. I will ask our Hosts to move it to " Using iPhone " where it may get a more rapid response from your fellow users.
    ÇÇÇ

  • Replacing system class loader

    Hi!
    I'm trying to replace the system class loader for plugin management reasons. I've written a simple test app for testing, but it doesn't work. The first code is a ClassLoader, the second is the main code.
    I try to run the code like this: java -Xbootclasspath/a:. -Djava.system.class.loader=A -cp . B
    It uses my classloader every time, except for when I call Class.forName(). What could be the problem?
    Thanks, Bal�zs
    public class A extends java.lang.ClassLoader {
    public A(ClassLoader parent) {
    super(parent);
    System.out.println("A loaded, parent is " + parent);
    public Class loadClass(String name) throws java.lang.ClassNotFoundException {
    try {
    Class c = getParent().loadClass(name);
    System.out.println("A was asked for " + name + " and delegated it to " + getParent());
    return c;
    } catch (ClassNotFoundException e) {
    System.out.println("A was asked for " + name + " but didn't find it");
    throw new ClassNotFoundException(name + " not found :[");
    }; // ENDOF CLASS A
    public class B {
    public static void main(String[] args) {
    (new B()).proc();
    private void proc() {
    System.out.println("Hello World!");
    System.out.println("Class loader: " + getClass().getClassLoader());
    try {
    Class.forName("C");
    } catch (ClassNotFoundException e) {
    e.printStackTrace();
    }; // ENDOF CLASS B

    Thanks for the reply. I think I've got a much better idea of how this stuff works now. I think what I need to do is register my deserializer with SOAP as a class that will really load the deserializer using Class.forName() with my class loader as a parameter. Then when the bootstrap class loader can't find a class, findClass() in my classloader will be called and I can load it from a URL.
    Should work.
    Thanks very much!

  • 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,
    Sureddy

    Do I need to have a custom class loader to fix this.Yes.

  • Can't set class cfol error

    hey
        i could really use some help here. Basically I am trying to get a sript working that monitors where an application is open and if it isn't then for it to copy a folder (that countains many files and subfolders) over to a hidden mounted volume...here is what I have:
    -- insert your existing code here  on idle tell application "System Events" to ¬ set exists_ to exists process "name of app to watch"  if exists_ is false then tell application "Finder" duplicate folder "path:to:source:" to folder "path:to:destination:" end tell return -- quit script end if  return 10 -- checks every 10 seconds to see if app has been quit end idle
    any ideas? it gives me the following error:
    "can't set <<class cfol>> "/Volumes/VantageGaming/Batman Arkham Aslyum/SaveData/6a38a6200000001 of appliation "Finder" to <<class cfol>> "Users?VantageGaming/Library/Application Support/Feral Interactive/Batman Arkham Aslyum/SaveData/6a38a6200000001" of application "Finder".
    i would realy appreciate any help...i'm would consider myself a novice!
    peace will

    hey
         EDIT: sorry here is the code that i have tried....we are gettting close but applescript for me is so frustrating! thanks for taking the time to play with the code...
    i'm using this code:
    on idle
              set source to "/Users/VantageGaming/Library/Application Support/Feral Interactive/Batman Arkham
    Asylum/SaveData/6a38a62600000001" as POSIX file
              set destination to "/Volumes/VantageGaming/Batman Arkham Asylum/SaveData/6a38a62600000001" as POSIX file
              tell application "System Events" to ¬
                        set exists_ to exists process "Batman Arkham Asylum"
              if exists_ is false then
                        tell application "Finder" to duplicate "/Users/VantageGaming/Library/Application Support/Feral Interactive/Batman Arkham Asylum/SaveData/6a38a62600000001" to "/Volumes/VantageGaming/Batman Arkham Asylum/SaveData/6a38a62600000001"
                        return
              end if
              return 10
    end idle
    it is still returning me a Can't make "/Users/VantageGaming/Library/Application Support/Feral Interactive/Batman Arkham Asylum/SaveData/6a38a62600000001" into type item
    i'm trying to research about type item failures but can't find anything relevant yet....
    uhhh
    peace will
    peace will

Maybe you are looking for

  • Quicktime Pro converting files

    I have an Insignia 5.0MP High-Definition Digital Camcorder with 3" Swivel LCD Screen but the AVI files it produces are useable on iMovie. Will Q Pro convert them from AVI to something I can use with iMovie?

  • Visio 2013 Breaks Internet Explorer Viewing

    I believe this is a problem with Visio 2013 Pro because if I start with a fresh install of Windows 8.1 and install Office 2013 Pro Plus with the Visio Viewer then I can open Visio drawings in Internet Explorer, but as soon as I install Visio 2013 (wi

  • Select wich returns the shortest time

    Hi, I don't know how to do a select. I'm goig to explain what I want to get to see wheter somebody can help. I've a select that returns the following columns (table t): handle_id, logon_id, object_name I've another table with the following columns (t

  • Opinions on best CLI IOS authentication model

    Anyone care to mention what works well and what doesn't for alternatives to the default enable/exec password scheme in IOS? I've got RADIUS authentication working on an AP1200, and am thinking of using it elsewhere, but I'm concerned about what happe

  • Moving Abroad - Power cord question

    Hi, I have recently moved to Spain and my lovely iMac arrived shortly after me yesterday. And to be honest I've just realised that it won't be as simple as just changing the plug to use power outlets here. What is my best course of action? Is it OK t