Debug classes loaded with reflexion by a JVM launched normally

Hi,
I would like to debug some classes that are loaded with reflexion by an Eclipse plugin without starting the whole eclipse environnement in debug mode.
Therefore is it possible to turn a JVM or a specific JVM thread in debug mode at excution time?
or to load a class by reflexion in a debug mode?

Sounds like you want to debug Eclipse - simply start it with the debugging switches, then use jdb to attach to it, and add some breakpoints to the classes that you are interested in. Alternatively, you can use some other lightweight debugger.
This really isn't a JVM issue, and there should be a more suitable forum that deals with debugging.

Similar Messages

  • Question  about dynamic class loading with thread built in

    Hi ,
    I am trying to load a class with a thread built in from the network.
    I write my network classloader, convert the class to a byte array and transmit over the network using socket. This step seems fine but when I tried to load the class at the receiver, some exception happens,"
    the reported exception is that :
    Exception in thread "Thread-2" java.lang.NoClassDefFoundError: SampleProject/Application$1
    my class name is "SampleProject . Application", the $1 I think it may refers to the thread built in the "Application".
    Could any one give me some hint for how to dynamic load such class file with thread built in over the network?
    Thank you!
    Best Regards,
    Song Guo

    Exception in thread "Thread-2"
    java.lang.NoClassDefFoundError:
    SampleProject/Application$1That means that the receiving end can't find an anonymous inner class which you have in the Application class. (The anonymous clas is given the synthetic name 1). Check your bin/classes folder you will have a class there with the name Application$1.class
    Kaj

  • Dynamic class loading with Webstart

    Hello !
    //within the jar-file at the webstart-directory
    public interface MyFrame{
    public void createFrame();
    //within the jar-file dynamically downloaded
    public class MyExtFrame extends JFrame implements MyFrame{
    String className = "MyExtFrame";
    ClassLoader cl = ClassLoader.getSystemClassLoader();
    JarClassLoader jarLoader = new JarClassLoader (cl, jarFile));
    /* Load the class from the jar file and resolve it. */
    Class c = jarLoader.loadClass (className, true);
    /* Create an instance of the class.
    Object o = c.newInstance();
    /* Are we using a class we specifically know about? */
    if (o instanceof MyFrame){
    // Yep, lets call a method we know about. */
    MyFrame client=(MyFrame) o;
    //call a class-method (here creates the whole gui-object at once)
    client.createFrame();
    This is the code i'm using and i've encountered following problem, if i put this code into an application without webstart, anything works fine, but with webstart i'll get a: java.lang.NoClassDefFoundError
    Then i've put the MyFrame-classes into the downloaded jar-file, but this won't work either, i'll get a ClassCastException.
    What do i have to do, to become it working ?
    Thanks for any conclusions and help.
    Michael

    Finally i've found out myself, i've read some postings in this forum and put them all together, so that my webstart-application finally works the way i want...
    That was the topic:
    Downloading a jar-file and starting a class from this jar-file within a webstart application (dynamic class loading).
    I'll post my final solution for this problem, may be it would be useful in future for anyone else.
    //grant all permissions on the clientside
    Policy.setPolicy( new Policy() {
    public PermissionCollection getPermissions(CodeSource codesource) {
    Permissions perms = new Permissions();
    perms.add(new AllPermission());
    return(perms);
    public void refresh(){
    //get the current classloader
    ClassLoader cl = MyLoadedClass.class.getClassLoader();
    //create a new url-classloader while using the current classloader
    URL[] urls = new URL[1];
    File f = new File(new String(jarName));
    urls[0] = f.toURL();
    URLClassLoader ul = new URLClassLoader(urls, cl);
    //load a class from jarfile
    Class c = ul.loadClass(new String(className));
    //get an object from loaded class
    Object o = c.newInstance();
    /* Are we using a class we specifically know about? */
    if (o instanceof KnownInterface){
    // Yep, lets call a method we know about. */
    KnownInterface client = (KnownInterface) o;
    client.doAnything();

  • FB Debug application loaded with SWFLoader

    I am fairly new to flex builder, I am working on a fairly
    large project that has many pages. To reduce the application sizes,
    I have created seperate applications for each type of user. The
    login page then loads the appropiate application useing SWFLoader.
    When I try to debug the application by setting a breakpoint within
    my application and start the login page, my breakpoint never
    breaks. Does anyone know anything about this, or how I would debug
    an application loaded this way. Just a note, I cannot run the
    loaded application without the login applicaiton being loaded
    first. The login app contains data that the secondary application
    needs.

    Most likely the issue here is that the SWF that you are
    loading with the <SWFLoader> tag was not built for debugging.
    E.g. say you have a project called MyComponent, and then the
    main project called MyApp. Inside MyApp.mxml you have this:
    <mx:SWFLoader source="MyComponent.swf" />
    And presumably you manually copied MyComponent.swf from
    MyComponent/bin into the MyApp project. Well, the MyComponent
    project built two versions of the SWF: MyComponent.swf, which is
    the release version, and MyComponent-debug.swf, which is the debug
    version.
    So if you need to debug it, you'll have to copy
    MyComponent-debug.swf over to the MyApp project. To get it to load
    with the SWFLoader tag, you'll either need to temporarily change
    the filename in the SWFLoader tag to refer to
    MyComponent-debug.swf, or else rename the debug SWF to the release
    filename of MyComponent.swf.
    Unfortunately there is no automated workflow to have
    SWFLoader detect whether it is running debug or release, and load a
    different SWF.

  • How to recover from an exception on a class loaded with a classloader?

    I have created a classloader for the purpose of dynamically loading "modules" . The whole application is multithreaded and the separate modules may also run as separate threads. The problem that I am facing is that if one of the modules crashes (does not handle an exception), then the class loader object which loaded the required classes and started the module's thread, cannot be accessed. The thread which attempts to access this class loader freezes. Is there any way to recover from this situation?
    Thanks in advance

    Ok, let me provide a bit more information. Each "module" is handled by specific class (let's call it ModuleDescriptor), which subclasses the URLClassLoader class. The ModuleDescriptor class is responsible for describing each module, maintain module state information (loaded, unloaded, started, stopped, etc) and also executing some method calls on a specific object of the module, which in essence acts as a means to start or stop the module. Each module is a separate thread and is packaged in a JAR file, which is first downloaded locally. If one of these module threads crashes, then I cannot even call a method of the ModuleDescriptor to perform the necessary unloading bit. Basically, when I can the method that thread of execution halts without an exception or an error or anything. The rest of the application continues working properly (other threads). I find this situation bizarre, because the ModuleDescriptor object and the actual module with the thread that crashed execute on separate threads. If there is any more specific information that I have to provide, please let me know.

  • Dynamic Class Loading with interface

    Hello
    I would appreciate any help on the following problem.
    I need to load all classes in a particular directory and its subdirectories (top directory is known but not in the classpath) which implement a predefined interface. At the moment I am using a lot of reflection to accomplish this and believe it can be avoided somehow using the fact that I know these classes have to implement a predefined interface.
    At the moment, I am searching through the directory and subdirectory, loading all names of classes into a vector using a custom URLClassloader, and then load all classes in the vector into modulecontainers to populate a defaultmutabletree which is displayed on the gui.
    I'm sure that knowing the interface means there's a more straightforward way.
    Thanks in advance.

    Finally i've found out myself, i've read some postings in this forum and put them all together, so that my webstart-application finally works the way i want...
    That was the topic:
    Downloading a jar-file and starting a class from this jar-file within a webstart application (dynamic class loading).
    I'll post my final solution for this problem, may be it would be useful in future for anyone else.
    //grant all permissions on the clientside
    Policy.setPolicy( new Policy() {
    public PermissionCollection getPermissions(CodeSource codesource) {
    Permissions perms = new Permissions();
    perms.add(new AllPermission());
    return(perms);
    public void refresh(){
    //get the current classloader
    ClassLoader cl = MyLoadedClass.class.getClassLoader();
    //create a new url-classloader while using the current classloader
    URL[] urls = new URL[1];
    File f = new File(new String(jarName));
    urls[0] = f.toURL();
    URLClassLoader ul = new URLClassLoader(urls, cl);
    //load a class from jarfile
    Class c = ul.loadClass(new String(className));
    //get an object from loaded class
    Object o = c.newInstance();
    /* Are we using a class we specifically know about? */
    if (o instanceof KnownInterface){
    // Yep, lets call a method we know about. */
    KnownInterface client = (KnownInterface) o;
    client.doAnything();

  • The applet fails to load. with 'red cross' screen JVM 1.6.19 and above

    After updating the JVM to one of the latest version 1.6 builds, our users started to experience a problem with opening java applets.
    All the users have JVM versions 1.6.0_19 – 1.6.0_26 on Windows 7/2008. The browser is IE8. On the server usually there is IIS7, with ‘Integrated Windows authentication’
    on applet’s virtual folder. Applet’s classes are packaged into a signed JAR file. Both the client and the server are located in the same local area network with no proxy or firewall between them.
    The applet’s website usually belongs to the trusted security zone. When loaded, the applet establishes HTTP connection to the server to get the necessary data.
    When the user tries to open an HTML page containing the applet, there can be the following scenarios:
    1.     The applet fails to load. We’re getting a ‘red cross’ screen. All the HTML elements except of the applet are loaded OK.
    From the IIS log we can see that the loading of the JAR file failed with the error code 401, the user name field in the log for the JAR is empty.
    2.     The java asks for the user name and password showing a popup ‘Authentication required’. At this moment we can see the following message in the Java console:
    network: Firewall authentication: site=/XX.XX.XX.XX:XX, protocol=http, prompt=, scheme=ntlm
    If the user enters the correct credentials, the applet loads OK. Even if the user checks the ‘Save the password in your password list’ checkbox, Java continues to ask for credentials
    on every page reload. It’s worth to note that the company’s external firewall doesn’t get any requests from the applet.
    The problems happen even when the client and the server are located on the same machine, but never happens when we use localhost as the server name in the page URL.
    During investigations we found out the following workarounds:
    1.     Enabling anonymous authentication on the virtual folder always solves the problem.
    2.     Sometimes, changing security zone from ‘Trusted’ to ‘Local intranet’ solves the scenario 2 (‘Authentication required’ popup) problem.
    It’s worth to note that changing the security zone never helps if the page URL contains dots (for example, uses IP address instead the server name).
    3.     Upgrading to IE9 solves the scenario 2 problem partly: Java asks for the credentials only once.

    I have the same issue. I use single sign-on with IIS 7 and Integrated Window authentication on the tomcat virtual folder. The applet jar file is on the root directory of the web application (the same level of index.html). So I use '.' as the code_base to call the applet from javascript.
    So when I launch my web application into a browser, the auto-connection is successfully performed (single sign-on through Upstream, kerberos, remote_user, ...). But when I want to launch the applet in the web application, a new authentication panel (red panel with "authentication required") occurs in order to set credentials (login, password, domain) with the message in the java applet console:
    "network: Firewall authentication: site=myApplicationUrl, protocol=http, prompt=, scheme=ntlm"
    So why the applet doesn't inherit previous credentials in this case ??
    Have you solved this problem ?
    Thanks
    Edited by: 886341 on 20 sept. 2011 08:56

  • Help accessing methods in classes load with forName()

    Hi all,
    I am dynamically loading classes at runtime by using Class.forName() and .newInstance(). Is there any way I can access the methods of those classes after they are dynamically loaded? It doesnt seem that they are available for use.
    Any help would be appreciated.
    Ryan

    To clarify, are you asking how to invoke a method on an Object without knowing its class? In any case you should use the reflection api that are avaliable.
    Ex: cl = Class.forName(); Method[] methods = cl.getMethods(); for(int i = methods.length; i-- > 0;) System.out.println(methods[i-1].getName());
    or
    methods[i-1].invoke(cl.newInstance(), new Object[]{});

  • Plz help me out with class loader problem

    hai forum members,
    I have a code which loads class files from local disk.
    It works fine with some classes ,
    But i get this exception when i am selecting certain other class files
    I am using jdeveloper.
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Filter (wrong name: project1/Filter)
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at com.jutframe.JavaUnitTester.selectClass_actionPerformed(JavaUnitTester.java:449)
         at com.jutframe.JavaUnitTester$7.actionPerformed(JavaUnitTester.java:338)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1766)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
                        JFileChooser jfilechooser=new JFileChooser();
                        Filterclass filter=new Filterclass();
                        //Set selection mode for file chooser
                        jfilechooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
                        //set file filter
                        jfilechooser.setFileFilter(filter);
                        int returnVal = jfilechooser.showOpenDialog(this);
                        if(returnVal == JFileChooser.APPROVE_OPTION)
                            try
                                    String str = jfilechooser.getSelectedFile().getName();
                                    String parent=jfilechooser.getSelectedFile().getParent();
                                     // Create a File object on the root of the directory containing the class file
                                     File file = new File(parent);
                                     // Convert File to a URL
                                     URL url = file.toURL();         
                                     URL[] urls = new URL[]{url};
                                     // Create a new class loader with the directory
                                     ClassLoader cl = new URLClassLoader(urls);
                                     StringTokenizer st = new StringTokenizer(str,".");
                                     String s = st.nextToken ();
                                     Class c = cl.loadClass(s);  //ERROR IS SHOWN IN THIS PARTICULAR LINE
                                     Object instance=c.newInstance();
    --------------------------------------------please help me trace my mistake.
    thank you all.

    i think the problem that i have set a particular class path for my class files and my application loads files from that alone.
    So plz tell me if theres any way to access the class path of a particular file dynamically?
    regards

  • Class loader: saaj-api conflict

    I need to load saaj-api from my application which is newer than the one that comes w/ith oc4j 10.1.3 which is loaded by the system class loader with name api from webservices/lib/saaj-api.jar.
    remove-inherited doesn't seem to do the trick.
    Any suggestions would be appreciated.
    Thanks,
    Jindong.

    While I understand where you're coming from, it sounded to me that oc4j lacks the flexibility to allow application to use newer version of certain component.
    For example, certain JDK level supports certain JAXP, but there is indeed an extension mechnism to allow application plug in newer JAXP?
    I believe other j2ee contains are a lot flexbile in terms of this...I don't think J2EE spec says that applications running in its container can not use newer software components?
    I think it only makes sense that the minimum supported level is j2ee 1.4, but nothing should stop applications from having their own version of any thing.
    I strongly suggest that this to be considered for what ever release you guys are working on or a work around can be provided for the current version we're using.
    Jindong.

  • Performance issues with class loader on Windows server

    We are observing some performance issues in our application. We are Using weblogic 11g with Java6 on a windows 2003 server
    The thread dumps indicate many threads are waiting in queue for the native file methods:
    "[ACTIVE] ExecuteThread: '106' for queue: 'weblogic.kernel.Default (self-tuning)'" RUNNABLE
         java.io.WinNTFileSystem.getBooleanAttributes(Native Method)
         java.io.File.exists(Unknown Source)
         weblogic.utils.classloaders.ClasspathClassFinder.getFileSource(ClasspathClassFinder.java:398)
         weblogic.utils.classloaders.ClasspathClassFinder.getSourcesInternal(ClasspathClassFinder.java:347)
         weblogic.utils.classloaders.ClasspathClassFinder.getSource(ClasspathClassFinder.java:316)
         weblogic.application.io.ManifestFinder.getSource(ManifestFinder.java:75)
         weblogic.utils.classloaders.MultiClassFinder.getSource(MultiClassFinder.java:67)
         weblogic.application.utils.CompositeWebAppFinder.getSource(CompositeWebAppFinder.java:71)
         weblogic.utils.classloaders.MultiClassFinder.getSource(MultiClassFinder.java:67)
         weblogic.utils.classloaders.MultiClassFinder.getSource(MultiClassFinder.java:67)
         weblogic.utils.classloaders.CodeGenClassFinder.getSource(CodeGenClassFinder.java:33)
         weblogic.utils.classloaders.GenericClassLoader.findResource(GenericClassLoader.java:210)
         weblogic.utils.classloaders.GenericClassLoader.getResourceInternal(GenericClassLoader.java:160)
         weblogic.utils.classloaders.GenericClassLoader.getResource(GenericClassLoader.java:182)
         java.lang.ClassLoader.getResourceAsStream(Unknown Source)
         javax.xml.parsers.SecuritySupport$4.run(Unknown Source)
         java.security.AccessController.doPrivileged(Native Method)
         javax.xml.parsers.SecuritySupport.getResourceAsStream(Unknown Source)
         javax.xml.parsers.FactoryFinder.findJarServiceProvider(Unknown Source)
         javax.xml.parsers.FactoryFinder.find(Unknown Source)
         javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
         org.ajax4jsf.context.ResponseWriterContentHandler.<init>(ResponseWriterContentHandler.java:48)
         org.ajax4jsf.context.ViewResources$HeadResponseWriter.<init>(ViewResources.java:259)
         org.ajax4jsf.context.ViewResources.processHeadResources(ViewResources.java:445)
         org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:193)
         org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
         org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
    On googling this seems to be an issue with java file handling on windows servers and I couldn't find a solution yet. Any recommendation or pointer is appreciated

    Hi shubhu,
    I just analyzed your partial Thread Dump data, the problem is that the ajax4jsf framework ResponseWriterContentHandler triggers internally a new instance of the DocumentBuilderFactory; every time; triggering heavy IO contention because of Class loader / JAR file search operations.
    Too many of these IO operations under heavy load will create excessive contention and severe performance degradation; regardless of the OS you are running your JVM on.
    Please review the link below and see if this is related to your problem.. This is a known issue in JBOSS JIRA when using RichFaces / ajaxJSF.
    https://issues.jboss.org/browse/JBPAPP-6166
    Regards,
    P-H
    http://javaeesupportpatterns.blogspot.com/

  • Dynamic class loading issue with XmlBeans and Axis2

    Hi,
    Since support to web services is not enough in JDeveloper I am using apache axis2 to consume web services from an ADF web application.
    Everything works fine if I use jdk 1.5 but our app servers require jdk 1.4.2_08-b03 so I switched jre settings to jdk 1.4.2_08-b03 in the JDeveloper and I started to get these issues.
    I debugged the application and this line is the cause of the exception. It is in request document class.
    return (org.htng.pws._2008a.guestselfservice.name.types.FetchProfileRequestDocument)org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance(type,
    null);
    I did some further testing and found that it is happening when I call org.apache.xmlbeans.XmlBeans.getContextTypeLoader()
    The error messages that I am getting are
    1.     J*BO-29000: Unexpected exception caught: java.lang.IllegalAccessError, msg=tried to access field* org.htng.pws._2008a.guestselfservice.name.types.FetchProfileRequestDocument$1.class$org$htng$pws$_2008a$guestselfservice$name$types$FetchProfileRequestDocument from class org.htng.pws._2008a.guestselfservice.name.types.FetchProfileRequestDocument
    2.     tried to access field org.htng.pws._2008a.guestselfservice.name.types.FetchProfileRequestDocument$1.class$org$htng$pws$_2008a$guestselfservice$name$types$FetchProfileRequestDocument from class org.htng.pws._2008a.guestselfservice.name.types.FetchProfileRequestDocument
    As I understand somehow the application server is not allowing the XMLBeans APIs to dynamically load the classes ..But I couldn’t find a way to convince it..
    Does anybody have any idea by any chance?
    Thanks a lot

    Some more details ..
    I could make it work if I change the below getClassLoader with Thread.currentThread().getContextClassLoader()
    org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(FetchProfileResponseDocument.class.getClassLoader()This is a generated code and normally works fine with jdk 1.5 .. I guess there should be some setting to make it work in 1.4 as well..
    Any Idea ?

  • What's the deal with Lazy Class Loading?

    My understanding was that if class B is used in class A, (i.e. imported and used in local code), but class A does NOT
    - extend class B
    - implement class B
    - have a field of class B's type or
    - use class B in any of its methods signatures
    then class B would not be loaded unless the localised code that uses it was executed.
    However, I am of course finding that this is not the case.
    So what's the deal?
    Why are my classes being loaded when there's no code that uses them?

    Okay, prepare for some gory details...
    My actual code is slightly more complicated than A & B, but the context of the error is the same.
    Here is what's happening:
    The main method, in class A is creating an instance of A;
    The constructor of A creates an instance of B;
    The constructor of B calls a static method in C;
    The static method in C creates an instance of C.
    C contains an instance method M that creates an instance of inner class C.C1, however method M is NOT called from C's constructor, nor will it EVER be called in the (test) application.
    Class C.C1 implements interface D.D1.
    Neither of classes D or D.D1 are in the classpath (intentionally).
    A NoClassDefFoundError is thrown, indicating that D.D1 could not be loaded, with the top method on the stack trace being (from memory) B.<init> (i.e. no mention of C, the only class that refers to D or D.D1).
    My assumption was that C.C1 should never be loaded, because it is never used, or that, if it was loaded eagerly, no exception should be thrown until a point at which it is used.
    Seeing as the inner classes and the inheritance can complicate things above, I commented out the code that uses C.C1 and D.D1, which results in the following sequence of events (which still fail):
    The main method, in class A is creating an instance of A;
    The constructor of A creates an instance of B;
    The constructor of B calls a static method in C;
    The static method in C creates an instance of C.
    Difference is here:
    C contains an instance method M that creates an instance of class D, however method M is NOT called from C's constructor, nor will it EVER be called in the (test) application.
    Class D does not appear in any method signatures or as a field type.
    Class D is not in the classpath (intentionally).
    A NoClassDefFoundError is thrown, indicating that D could not be loaded, with the top method on the stack trace being B.<init> (i.e. no mention of C, the only class that refers to D).
    Again, my assumption is that D should never be loaded, because the only method that uses it is never called.
    Why is the JVM attempting to load D and telling me that it can't find it when the application never actually uses D?
    Crazy stuff!

  • EP 6.20 Class loader issues with irj application

    Hi All,
    I have a servlet to interface with the SAP UM API.  I had deployed this as a WAR, but the SAP UM cannot be initialised outside of the irj application (SAP Support advised this it is abailable outside the irj application in 6.40).
    As a result, I tried to deploy it within the irj application - I copied my jars to the WEB-INF\lib directory, and modified the WEB-INF\web.xml to include a new servlet and servlet-mapping.
    I also had to copy some other SAP supporting jars into WEB-INF\lib (the XML parser impls).
    This works fine for the UM stuff.  Ideally I'd like to redeploy the irj application so I don't have to hack the files and it would allow me to specify the additional libaries required, however there is now way I've found in the Deploy Tool to do this (you need the WAR of the irj application, or the project file).  So this is problem 1.
    Problem 2.  The next extension included support for user mapping data.
    Using -
    IUserMapping iUserMapping = UMFactory.getUserMapping();
    iUserMapping.getUserMappingData(systemAlias, iUser, mapLogonData);
    I was able to read the mapping data, but this required knowing beforehand, all the system aliases.  With a response from SAP Security, it was suggested
    IUserMappingService iums = (IUserMappingService)PortalRuntime.getRuntimeResources().getService(IUserMappingService.KEY);
    IUserMappingData mappingData = iums.getMappingData (systemAlias, iUser);
    be used to obtain mapping data, and that
    com.sap.portal.pcm.system.ISystems sysSrv = (ISystems)PortalRuntime.getRuntimeResources().getService(ISystems.KEY);
    String[] systemAliases = sysSrv.getAliases();
    be used to obtain the system aliases.
    The problem is with the class loader.  If I copy the jars with the classes for the IUserMappingService and the ISystems, to the irj WEB-INF\lib I cause a class def not found with other EP6 applications.  This is also the case when I add them to the JVM classpath (I know this is bad - but it was a last resort!).
    Hoping someone can help me redeploy irj with my application that will resolve problem 2! If not, maybe some advice on problem 2?
    Cheers,
    Scott...

    Hi Scott,
    THis isnt an answer to ur Question, but could u tell me which jar files are needed for the packages:
    com.sap.portal.pcm.system.ISystems
    com.sap.portal.pcm.system.ISystem
    and under which path I coul dfind them.
    Thnx
    Regards
    Meesum.

  • Getting LinkageError with class loader

    I've written a class loader which extends java.net.URLClassLoader. My class is called EntryClassLoader. It only ovverides findClass() so that it will search a user-supplied path for a class. Beloww is the code:
    public Class findClass(String className) throws ClassNotFoundException
    try {
    // First check to see if the user has prepended some
    // directory path
    if (className.indexOf(File.separatorChar) != -1) {
    String path = className.substring(0,
    className.lastIndexOf(File.separatorChar));
    className = className.substring(className.lastIndexOf(File.separatorChar)
    + 1);
    addURL(new File(path).toURL());
    return super.findClass(className);
    catch (MalformedURLException e) {
    e.printStackTrace();
    return null;
    Here's a sample test program I've written:
    public static void main(String args[]) throws Exception {
    EntryClassLoader loader = new EntryClassLoader();
    loader.findClass("TestPlayer");
    loader.findClass("TestPlayer");
    If I comment out the 2nd call to findClass(), the program runs fine, and I know that TestPlayer is successfully loaded. With the code as is however, I get the following error:
    Exception in thread "main" java.lang.LinkageError: duplicate class definition: TestPlayer
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
    at nirex.EntryClassLoader.findClass(EntryClassLoader.java:33)
    at TestLoader.main(TestLoader.java:8)
    Could someone please explain why I might be getting this error. And I really don't understand why it works if I only call findClass() once. Thanks.
    John

    Check if findLoadedClass(className) is null and load only then. If findLoadedClass() returns a non-null value, the class has already been loaded.

Maybe you are looking for

  • ITunes won't open and my iTunes Folder is missing

    My iTunes wouldn't open so I tried removing iTunes and Quicktime along with my iTunes folder, and now iTunes folder won't come back after reinstalling iTunes. Also iTunes won't open still. Any help would be great, thanks!

  • Oracle 10g release 2 client

    Can someone please help answer these questions for me. I am trying to make a case for me to use the Oracle 10g client for a new .NET system, that is going against an Oracle 9i database server. I would like to take advantage of the new speed improveme

  • Static method allowed in interface?

    Hello, I've written the following code: package a.b.c.d; import java.util.Map; public interface Adapter public void execute(Mapping mapping) throws Exception; public static Map getParameters( ) throws Exception; My compiler complains thusly: "Adapter

  • Java script does not execute - help would be appreciated.

    How can i tell the user where they are based upon the page url? I have put the following script at the top of the large product page and have the latest version of js installed. <script type="text/javascript"> if (document.location.href.match('brands

  • White patches appearing on the screen after some time

    I have bought an iMac recently. And for some days white patches like something occurring on my screen after sometime when I opens it. And the patches are there after closing it till sometime. So what can i do now? PLEASE help me .