RMI dynamic classloading problems

I wanted to know if you could help me answer this particular case,
which i still haven't been able to solve in days:
1>RMI Client and Server are on different hosts.
2>the Client makes a RMI method call to a Server who has to execute
dynamically a particular classfile specified by the client itself and
return the result to the client
PROBLEM IS:
at the beginning only the client has the classfile to be executed by
server and needs to transfer him the information in order to have its
RMI method executed,and no ohter protocols except for RMI are
allowed.
QUESTION IS:
how could i solve this case with the use of codebases and
URLClassLoader Objects?
hoping i've clearly made the point,thanXalot
nicholas

The client can set its own codebase. The client class that the server will call needs to implement an interface the server knows. Then the client will pass this object to the server, and the server will make its call on that object. Since this object is not exported it will be serialized to the server, and the call will run on the server.
Quite insecure. But it should work just that simply I do believe.
You do know how to use codebase?

Similar Messages

  • Dynamic Classloading

    Hello all,
    Could someone tell me a practical way to setup dynamic classloading in an EJB app? I'd like to set it up such that all of the shared codebase is deployed within the same ear with the EJB application. Is this practical or does dynamic classloading require the use of an external web-server? Right now I am trying to use the rmi.server.codebase system property via the %JAVA_OPTS% env. variable on appserver start-up to point to a servlet deployed in a .war my .ear. What is the practical approach? Thanks in advance.
    Cliff

    Thank you crackers,
    You've cleared alot for me. So if I follow what you're saying then my problem boils down to how my client talks to the server. And the principles of EJB state that the communication details are left to the vendor. All I have to do then is get my home interface via JNDI. This assumes of course that the stubs are available on the client.
    Now don't get me wrong here, I'm not trying to debate the advantages of EJB. I'm just trying to illustrate my dillemma and find a plausible solution. In my scenario I'm not really all that concerned with the transport layer (well I am concerned with the leaky abstractions therein but that's another story). I'm primarily concerned with versioning issues. I cannot maintain classes installed on the client as they could potentially fall out of date with the server. I need a dynamic classloading mechanism, which I thought would be provided with EJB as it is with RMI. I just naturally assumed it would be since EJB is typically (though not always, as you point out) layered always RMI. If you're saying that there is no such facility then I will have to find an alternative solution for my problem. You see I have no choice and I must concern myself with the underworkings of EJB as there are leaky abstractions within the technology. While it is a powerful technology it does not solve all of my problems. Also, I need to fill these holes in a vendor neutral way.
    Cliff

  • PortableRemoteObject ClassLoader problems in pe8.1

    Hi, I'm in the process of porting a Sun Java Application Server 7 to 8.1 PE and I'm running into ClassLoader problems when I make remote calls into the server. The situation is a little odd in that I've exported a PortableRemoteObject from the BootstrapServlet (too many reasons to go into detail, but it all worked in 7 just fine). Most of the calls I make into the remove server work fine, exception I get ClassNotFound exceptions in the strangest places. For example, I have a SearchCriteria class that I pass as a parameter. It makes it to the server. But, its inner class, Constraint which is static and Serializable, gets a ClassNotFoundException. So I made it Externalizable and finally figured out what was going on.
    The SearchCriteria class loader was set to the WebappClassLoader. But the ObjectInput of readObject was set to AppClassLoader. Now why the AppClassLoader could find SearchCriteria and not its nested class, I do not know.
    So my question is, is there any way to tell the ORB to use the WebappClassLoader instead of the AppClassLoader?

    More information. If I update the calling threads class loader to be the same as the objects class loader, the unaccessible classes can be loaded.
      public void readExternal(ObjectInput in)  throws IOException, ClassNotFoundException
        Thread.currentThread().setContextClassLoader(getClass().getClassLoader());Does this make sense? Seems so out of place.

  • Dynamic ClassLoader

    Hi there,
    i am trying to program a dynamic classloader in Abap. by now i came this far:
    DATA classname TYPE string VALUE 'ZCL_TEST'.
    DATA dref TYPE REF TO data.
    DATA type_descr TYPE REF TO cl_abap_typedescr.
    FIELD-SYMBOLS <ref> TYPE ANY.
    type_descr = cl_abap_typedescr=>describe_by_name( p_name = classname ).
    classname = type_descr->absolute_name.
    CREATE DATA dref TYPE REF TO (classname).
    ASSIGN dref->* TO <ref>.
    CREATE OBJECT <ref> TYPE (classname).
    dref->to_string( ). -----> ERROR
    The ClassLoading itselfs works perfectly, but now i don't know how to call a method of that class... Can't beliieve that i can instantiate a Class but not call a method?!?
    So has someone done it already and can point me the right way?
    Thanks
    Mathias

    I don't know what would be the use of creating the object with REF TO DATA and than assign it back to the variable REF TO OBJECT to be able to access the data.
    CREATE DATA dref TYPE REF TO
               ('\program=kellerh_test\interface=i1').
    Here you are creating the TYPE at runtime which is type referent to the Interface. You get the object reference to the Field-Symbol. But Since field-symbol is not allowing to access the attributes, we need to cast that into the variable TYPE REF TO OBJECT.
    Check this code:
    REPORT  ztest_np_1.
    INTERFACE i1.
      DATA: w_num TYPE i.
    ENDINTERFACE.                    "i1
    CLASS c1 DEFINITION.
      PUBLIC SECTION.
        INTERFACES i1.
    ENDCLASS.                    "c1 DEFINITION
    DATA dref TYPE REF TO data.
    FIELD-SYMBOLS <ref> TYPE any.
    CREATE DATA dref TYPE REF TO
               ('\program=ZTEST_NP_1\interface=i1').
    ASSIGN dref->* TO <ref>.
    CREATE OBJECT <ref> TYPE c1.
    FIELD-SYMBOLS <attr> TYPE ANY.
    DATA: lo_obj TYPE REF TO object.
    lo_obj ?= <ref>.
    ASSIGN lo_obj->('I1~W_NUM') TO <attr>.
    <attr> = 10.
    WRITE: 'Test'.
    Regards,
    Naimesh Patel

  • Dynamic Link Problem beim Batchencoden???

    Habe seit kurzem folgendes Problem: Exportiere ich mehrere Videos über den Media Encoder, habe ich bei fast der Hälfte der Filme "kaputte Videos" entweder nur an den Effekten oder beim kompletten Video. Rechne ich die Filme einzeln raus, ist alles ok. Das stinkt sehr nach Dynamic Link Problem. Ich kennen das z.T. schon in der Zusammenarbeit mit After Effects. Hier rechne ich meine Projekte erst, bevor ich sie in Premiere reinhole. Aber auf das Batchencoden kann ich nicht verzichten, da ich teilweise 30 und mehr Clips in verschiedenen Formaten rausrechnen muss und das wirklich nicht einzeln erledigen will.
    Frage: Hat jemand ne Idee (das Problem existiert erst seit kurzer Zeit), ob da irgendwelche caches vollaufen, kann man dynamic link irgendwie "resetten" oder muß ich das ganze Production Premium Paket CS5.5 neu installieren (wollte ich eigentlci vermeiden!!!!!)?
    Ach ja, System Windows 7 64Bit mit CS5.5
    Gruß
    Stefan

    Operator error. Answered my own question. I haven't used Dynamic Link much. It works fine. I was momentarily confusing the import of a PP project vs. a Dynamic Linked Sequence.  

  • Dynamic classloading without default constructor

    Just wondering if anyone has done dynamic classloading using a constructor other than the default. I know that newInstance() calls the default constructor. But how would you do it without that? Thanks for the help.

    If you know that there is a constructor that takes,
    for example, a single String argument you can use
    something like this:
    Class clazz = ...; // class to instantiate
    String stringArg = ...; // argument to pass to constructor
    Constructor c = clazz.getConstructor( new Class[] { String.class } );
    Object value = c.newInstance( new Object[] { stringArg > } );
    And even better, when JDK 1.5 is released, you'll be able to write:
        Class clazz = ...;
        String stringArg = ...;
        Constructor c = clazz.getConstructor(String.class);
        Object value = c.newInstance(stringArg);Geoff

  • CS4 Dynamic Link Problem

    Is anybody having trouble keeping the source files linked in After Effects after using dynamic link from Premiere?
    Please refer to this link:
    cwrig, "CS4 Dynamic Link Problem" #1, 26 Oct 2008 1:02 pm
    This is very frustrating.
    Thanks for your time!

    Did some more tests and here is what does and doesn't work for me.
    Losing footage -
    Yes I was having the issue (and the topic is in the premiere forum also)
    Here is what seems to solve it.
    It loses the footage if I use the original folder which has spaces in the name. Not sure if that is the culprit but both methods proved consistent in every test I did.
    it worked when I used a new folder called "Test" at the root of my editing drive.
    Crashing-
    Not sure if other have the issue but when I close AE, PPro will just sit there with an hour glass and show as not responding.
    If I close PPro first and then AE and reopen PPro then all seems to work as it is supposed to.
    This was also consistent in every test I did.

  • GetResources() gives null's after using RMI (ClassLoader problem???)

    Hi
    I have just put RMI into my app and it works fine, connects to a remote server, runs a method on the server and returns the results.
    The problem is when I try to use a line like:
    URL url = MyClass.class.getResources("image/save.gif");
    The url is null. This code will work before my RMI function is run. Also, every dialog the application opens after running RMI has a line at the top of the pane saying: "Java Applet Window".
    Is RMI playing with the Classloader?
    Do I have to instaniate the ClassLoader or do something else to get my resources again and get rid of the text on each of the dialog boxes???
    Thanks in advance.

    if your class is Remote object, you use the RMI CLassLoader when you do:
    URL url = MyClass.class.getResources("image/save.gif");you shoud use instead:
    URL url = Classloader.getSystemResources("image/save.gif");

  • Rmi rebind's problem,dynamic rebind object!

    hi,everyone
    I have a problem,i know a class's name and this class have implement remoteobject,
    what can i rebind this class on the RMI registry .
    I write code like this:
    Class temp = Class.forName("Test");
    Naming.rebind("test",temp.newInstance());
    the "Test" is my class name,but cann't compile this code ,it's say:
    rebind(java.lang.String,java.rmi.Remote) in java.rmi.Naming cannot be applied to (java.lang.String,java.lang.Object)
    what can i do? help me

    You might try downcasting your newly created Object to a Remote. If you give a method a java.lang.Object reference, it won't figure out if it's really pointing to a java.rmi.Remote.

  • Dynamic classloading and incompatibleclasschangeerror

    I have different versions of my applications like v1 v2 v3 and my current version is v4.
    In my case, v4 might need to talk to v3, v2 or v1. To achevie that I need that same versions of classes from the respective versions of the applications i.e. I will make jars like v3.jar, v2.jar and v1.jar which will be loaded dynamically using my own custom class loaders. When v4 trying to access v3 it uses the classes using the classloader which loaded v3.jar
    v4 contacts v3, v2, v1 through RMI.
    Now the problem is when v4 is calling a remote method of v3 I am getting IncompatibleClassChangeError
    I tried to recompile all the required classes in v3 and created a new v3.jar and I have loaded the same dynamically in v4. I also recompiled all the classes of v4, but still the result is same.
    Both v3 classes and v4 classes are compiled using the same JRE version.
    Can somebody help me to figure out what could be the issue.
    Thanks

    If you know that there is a constructor that takes,
    for example, a single String argument you can use
    something like this:
    Class clazz = ...; // class to instantiate
    String stringArg = ...; // argument to pass to constructor
    Constructor c = clazz.getConstructor( new Class[] { String.class } );
    Object value = c.newInstance( new Object[] { stringArg > } );
    And even better, when JDK 1.5 is released, you'll be able to write:
        Class clazz = ...;
        String stringArg = ...;
        Constructor c = clazz.getConstructor(String.class);
        Object value = c.newInstance(stringArg);Geoff

  • RMI Dynamic Class Loading

    Hello,
    I have a standalone Java Client which is connecting to an RMI based svr component on WLS 6.0sp1. However, before connecting to the RMI Svr, I am trying to boot strap couple of other CLASS files from the App Svr. using the RMIClassLoader. Now here's the problem...
    I have placed my classes( one which I want to download and instantiate before I start making conventional calls to RMI Svr remote methods) in the folder WL_HOME/config/examples/rmi/*.class
    which is the code_base url I use. However, the error I get when trying to download the classs using RMIClass loader is:
    No Security Manager: RMI Class Loader disabled"...
    due to which I can not even get connected to my remote object after that. Can somebody please tell me how can I set whatever option it is so that I can get this thing working.
    I tried using the "Grant all" security policy too on the client side & server side in vain.
    Any help is truly appreciated. Thanks a lot!
    cl I am trying to

    I'll try having a crack at this, see inline comments
    Chirag Shah wrote:
    Hello,
    I have a standalone Java Client which is connecting to an RMI based svr component on WLS 6.0sp1. However, before connecting to the RMI Svr, I am trying to boot strap couple of other CLASS files from the App Svr. using the RMIClassLoader. Now here's the problem...
    I have placed my classes( one which I want to download and instantiate before I start making conventional calls to RMI Svr remote methods) in the folder WL_HOME/config/examples/rmi/*.class
    which is the code_base url I use. However, the error I get when trying to download the classs using RMIClass loader is:I'll assume that you're using a proper URL (file://) to instanciate your ClassLoader.
    >
    No Security Manager: RMI Class Loader disabled"...
    Does your client explicitly set a SecurityManager using the following command?
    if (System.getSecurityManager() == null) {
    System.setSecurityManager(new java.rmi.RMISecurityManager());
    Also,I believe that it should only be your client changing its policy file (for the network classload).
    >
    due to which I can not even get connected to my remote object after that. Can somebody please tell me how can I set whatever option it is so that I can get this thing working.
    I tried using the "Grant all" security policy too on the client side & server side in vain.
    Any help is truly appreciated. Thanks a lot!
    cl I am trying toHope it helps,
    Stephane Vaucher
    CIRANO
    Research Professional

  • Rmi and classloader: some server instances can not find the class on server

    Hi:
    I want to migrate my rmi applications from JDK 1.1 to JDK1.2.2. It exists in the following environments:
    - there is one authentication server and many application servers, all have binded in the main method
    - dynamic loading of the server stubs and interfaces is not used; they are local on the client.
    - security manager is enabled only on the server site and the policy file is created.
    - all server classes, stubs and interfaces are in the same directory on server site
    - the registry and the server are started as follows:
    unsetenv CLASSPATH
    rmiregistry 1103 &
    setenv CLASSPATH ~usr/serverDir:~oracle/jdbc/lib/classes12.zip
    java -Djava.rmi.server.codebase=file://~usr/serverDir/
    -Djava.rmi.server.hostname=myHost -Djava.security.manager myServer
    After starting the client, the rmi client connects to the server and the authentication request comes back with a list of applications.
    When the user chooses one of them, the rmi sends the request to thatapplication (e.g., OMSRmiServer_Stub). The application could not find the other class on the sever directory: (the authenication server can find the same class)
    java.lang.NoClassDefFoundError: JOMPrepStatement
    at java.lang.Class.getFields0(Native Method)
    at java.lang.Class.getFields0(Compiled Code)
    at java.lang.Class.getDeclaredFields(Compiled Code)
    at java.io.ObjectStreamClass$1.run(Compiled Code)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessController.doPrivileged(Compiled Code)
    at java.io.ObjectStreamClass.<init>(Compiled Code)
    at java.io.ObjectStreamClass.lookupInternal(Compiled Code)
    at java.io.ObjectStreamClass.lookup(Compiled Code)
    at java.io.ObjectStreamClass.lookupInternal(Compiled Code)
    at java.io.ObjectStreamClass.lookup(Compiled Code)
    at java.io.ObjectStreamClass.lookupInternal(Compiled Code)
    at java.io.ObjectStreamClass.lookup(Compiled Code)
    at java.io.ObjectStreamClass.lookupInternal(Compiled Code)
    at java.io.ObjectOutputStream.writeObject(Compiled Code)
    at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:256)
    at sun.rmi.server.UnicastRef.invoke(Compiled Code)
    at OMSRmiServer_Stub.executeStringSetSelect(Unknown Source)
    at OMSDeviceRmiClient.getStatusLOV(OMSDeviceRmiClient.java:196)
    at OMSRmiClient.getStatusLOV(OMSRmiClient.java:76)
    at OMSDevicePane.listenToTree(Compiled Code)
         at OMSDeviceContextPane.initComponents(OMSDeviceContextPane.java:107)
    at OMSFrame.jomInit(Compiled Code)
    at JOMCountFrame.init(JOMCountFrame.java:190)
    at JOMCountFrame.run(JOMCountFrame.java:253)
    at java.lang.Thread.run(Thread.java:485)
    Any help is appreciated.
    - Mahan.

    in jdk1.2.2 no need classes12.zip in class path.
    just set CLASSPATH=.;
    that is enough for solving ur problem
    bye
    raghu

  • 64-bit JNI C++ to JAVA invocation multiple threads classloader problem

    Hi ALL,
    I have a C++ app that invokes Java classes on 64-bit Solaris 10 with 64-bit JVM.
    Here is the problem:
    The native non-main (not the thread that initializes the JVM) threads would not be able to find any user-define class.
    Here are the symptoms and observations:
    1. JNIEnv::ExceptionDescribe() showed the following StackOverflowError:
    Exception in thread "Thread-0" java.lang.StackOverflowError
            at java.util.Arrays.copyOf(Arrays.java:2734)
            at java.util.Vector.ensureCapacityHelper(Vector.java:226)
            at java.util.Vector.addElement(Vector.java:573)
            at java.lang.ClassLoader.addClass(ClassLoader.java:173)
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
            at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
            at java.net.URLClassLoader.access$000(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:307)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)2. The "main thread" that instantiates the JVM has no problem finding and loading any class or method
    3. But the other threads (non-main threads) would not be able to find the user-defined classes unless the classes were already loaded by the main thread.
    4. The non-main threads can find the "standard" java classes with no problem
    5. The same app ran fine on 32-bit system.
    6. Except for the JVM reference is global, each thread acquired JNIEnv by either GetEnv() or AttachCurrentThread().
    Any idea why it is a problem with 64-bit?
    I have the sample program to reproduce this issue in this thread: http://forums.sun.com/thread.jspa?messageID=10885363&#10885363. That was the original thread I raised but I have narrowed it down to a more concrete scenario. That's why I am creating this new thread. I hope this does not break any rule on this forum. If it does, I apologize.
    I really appreciate it if anyone can provide any help/suggestion.
    Regards,
    - Triet

    Here is the sample program. Again, this works on 32-bit but not 64-bit.
    #include <string>
    #include "jni.h"
    #include "TestThread.h"
    static JavaVM *g_pjvm = NULL;  /* denotes a Java VM */
    static JNIEnv *g_penv = NULL;  /* pointer to native method interface */
    void initJVM(char** jvmOptions) {
        printf("RJniTest init starts...\n");
        JavaVMInitArgs vm_args; /* JDK/JRE 6 VM initialization arguments */
        JavaVMOption* poptions;
        int optionLen = 0;
        while (jvmOptions[optionLen]) {
            optionLen++;
        printf("RJniTest::init len=%d\n", optionLen);
        if (optionLen > 0) {
            printf("RJniWrapper::init jvmOptions\n");
            poptions = new JavaVMOption[optionLen];
            //poptions[0].optionString = "-Djava.class.path=/usr/lib/java";
            int idx = 0;
            while (jvmOptions[idx]) {
                poptions[idx].optionString = jvmOptions[idx];
                idx++;
        printf("RJniTest::init vm_args: version(%x), nOptions(%d)\n",
                JNI_VERSION_1_6, optionLen);
        vm_args.version = JNI_VERSION_1_6;
        vm_args.nOptions = optionLen;
        vm_args.options = poptions;
        vm_args.ignoreUnrecognized = JNI_FALSE;
        // load and initialize a Java VM, return a JNI interface
        // pointer in env
        printf("RJniTest::init creates JVM\n");
        JNI_CreateJavaVM(&g_pjvm, (void**)&g_penv, &vm_args);
        printf("RJniTest init ends\n");
    void findClass(const char* classname) {
        static const char* fname = "justFindClasses";
        printf("%s: findClass: %s\n", fname, classname);
        JNIEnv* jenv;
        jint ret = g_pjvm->GetEnv((void**)&jenv, JNI_VERSION_1_6);
        if (ret == JNI_EDETACHED) {
            ret = g_pjvm->AttachCurrentThread((void**)&jenv, NULL);
            if (ret != JNI_OK || jenv == NULL) {
                printf("%s: get env error: ret=%d\n", ret, fname);
            } else {
                printf("%s: got new env\n", fname);
        } else if (ret == JNI_OK) {
            printf("%s: env already there\n");
        jclass classref;
        classref = jenv->FindClass(classname);
        if (classref == NULL) {
            printf("%s: %s class not found!\n", fname, classname);
            if (jenv->ExceptionOccurred()) {
                jenv->ExceptionDescribe();
                jenv->ExceptionClear();
        printf("%s: found class: %s\n", fname, classname);
    class RJniTestThread : public TestThread {
    public:
        void threadmain();
    void RJniTestThread::threadmain() {
        printf("RJniTestThread::threadmain: Starting testing\n");
        findClass("org/apache/commons/logging/Log");
        findClass("java/util/List");
        printf("RJniTestThread::threadmain: done.\n");
    int main(int argc, char** argv) {
        char **jvmOptions = NULL;
        printf("RJniTestDriver starts...\n");
        if (argc > 1) {
            jvmOptions = new char*[argc];
            for (int i = 0; i < argc ; i ++) {
                jvmOptions[i] = argv[i + 1];
            jvmOptions[argc - 1] = NULL;
        } else {
            int size = 8;
            int i = 0;
            jvmOptions = new char*[size];
            jvmOptions[i++] = (char*) "-Djava.class.path=<list of jar files and path here>";
            jvmOptions[i++] = (char*) "-Djava.library.path=/sandbox/mxdev/3rdparty/java/unix/jdk1.6.0_14/jre/lib/sparc";
            jvmOptions[i++] = (char*) "-Djava.compiler=NONE";
            jvmOptions[i++] = (char*) "-verbose:jni";
            jvmOptions[i++] = (char*) "-Xcheck:jni";
            jvmOptions[i++] = NULL;
        printf("init JVM\n");
        initJVM(jvmOptions);
        // UNCOMMENT HERE
        // findClass("org/apache/commons/logging/Log");
        // findClass("java/util/List");
        // UNCOMMENT END
        printf("start test thread\n");
        RJniTestThread testThread;
        ThreadId tid = testThread.launch();
        printf("wait for test thread\n");
        int ret = pthread_join(tid, NULL);
        printf("RJniTestDriver ends\n");
    }

  • Seam on Weblogic 10.3.2: Possible classloader problem?

    Hi all,
    I have a problem deploying a Seam 2.2.0.GA application on WebLogic 10.3.2. I use JRockit 1.6.0_14, Richfaces 3.2.0.GA and Facelets 1.1.14 and the Server is deployed on Windoes XP 32bit. The application has the following structure:
    application.ear
    |--> APP-INF
    | |--> classes
    | |--> lib (all jar dependencies go here, including the WAR dependencies, EJB module dependencies)
    |-->META_INF
    | |--> application.xml
    | |--> data-sources.xml
    | |--> MANIFEST.MF
    | |--> weblogic.xml
    | |--> weblogic-application.xml
    |--> jboss-seam-2.2.0.GA.jar (is an EJB module)
    |--> myEjbModule1.jar
    |--> myEjbModule2.jar
    |--> myEjbModule3.jar
    |--> myEjbModule4.jar
    |--> myWar.war (NO libraries in WEB-INF/lib, finds everything in EAR/lib)
    JBoss Seam is an EJB module. and is declared as such in application.xml. Everything is OK, since the application loads correctly. The jar contains a faces.config registering the SeamPhaseListener on JSF, so that Seam actually works.
    Problems start when I try to enable the debug page of Seam. In order to do this, one must include in the classpath the jboss-seam-debug.jar (in APP-INF/lib or EAR/lib, here I am using the first). This jar has its own faces.config, which registers the Seam*Debug*PhaseListener on JSF, so that it catches debug requests.
    When deploying WITH jboss-seam-debug.jar, the application does not appear, but ONLY the debug page with the following exception (stacktrace at the end):
    Exception during request processing:
    Caused by java.lang.IllegalStateException with message: "No phase id bound to current thread (*make sure you do not have two SeamPhaseListener instances installed*)"
    This probably signifies a classloader issue. So, I have two questions:
    1. Has anyone deployed JBoss Seam on WenLogic WITH the debug page? If yes, is the structure of my project correct?
    2. Is there a way to debug the classloading of WebLogic? What I would find helpful would be to see what happens that registers the SeamPhaseListener more than one times.
    Note: When "JBoss-izing" the same EAR (remove hibernate jars, which are provided by JBoss, and move all libraries from EAR/lib to EAR root), the application loads correctly. BOTH the application AND the debug page appear correctly.
    Edited by: user6410241 on Mar 24, 2010 8:14 AM
    Edited by: user6410241 on Mar 24, 2010 8:26 AM

    The problem was the name of the Seam EJB module. Changing the jar to jboss-seam.jar, everything worked. This issue does not appear on JBoss 4.2.3.GA, where I also tested.
    Edited by: deadlock_gr on Jun 10, 2010 9:55 AM
    Edited by: deadlock_gr on Jun 10, 2010 9:56 AM

  • 10g Signal Handlers and Dynamic Binding Problems on Mac OS X

    I have the following env vars set up, and it seems the client libs show a deadl\
    ock behavior post installation. SqlPlus exhibits a similar problem with 10g cli\
    ent libs on the Mac, since it simply hangs for 20 secs before returning the pro\
    mpt. I have G4 10.3.4 Mac, and 3.3 (1640) gcc, and still haunted by this probl\
    em...
    ORACLE_HOME=/Users/Oracle/10g/orahome
    ORACLE=ORACLE_HOME/bin
    ORACLE_BASE=/Users/Oracle/10g
    DYLD_LIBRARY_PATH=/Users/Oracle/10g/orahome/lib
    a) ktrace sqlplus user/pass@db
    b) kdump -R | grep sigaction gives:
    885 sqlplus 5.877734 CALL sigaction(0x2,0xbffff500,0xbffff570)
    885 sqlplus 0.001252 RET sigaction 0
    885 sqlplus 0.002032 CALL sigaction(0xd,0xbfff90f0,0xbfff9160)
    885 sqlplus 0.001831 RET sigaction 0
    885 sqlplus 0.001293 CALL sigaction(0x12,0xbfffb6e0,0xbfffb750)
    885 sqlplus 0.001234 RET sigaction 0
    885 sqlplus 0.001551 CALL sigaction(0x12,0xbfffbda0,0xbfffbe10)
    885 sqlplus 0.001401 RET sigaction 0
    885 sqlplus 0.001331 CALL sigaction(0x2,0xbfffd090,0xbfffd100)
    885 sqlplus 0.001333 RET sigaction 0
    This shows a 5.9 sec delay for the first sigaction, and a full response is received some long 20 secs later on the prompt.
    Some feedback from engineering regarding this issue since the 9i release has been:
    "This is a known problem with signal handlers and the lazy binding we have on Mac OS X. A small change to how Oracle library's signal
    handler is installed using _signal_nobind(3) and
    _dyld_lookup_and_bind_fully(3) could help to solve this problem.
    The problem that we are trying to avoid is a possible dead lock from
    code that could be called in a signal handler when the thread that
    gets the signal is in the middle of lazy binding a symbol. So when a
    signal handlers installed the default action is to cause it to be
    bound fully. This is made very expensive by the mismatch of the
    interfaces to signal(3) and segvec(2) like routines which are passed
    an address and the dynamic linker that wants a global symbol name. So the end result is to call the routine _dyld_bind_fully_image_containing_address(3) with the address of the signal handler to be bound. Which binds everything in the image (in this case the Oracle shared library).
    We have had problems like this before. For example: [This is what is
    done in usleep(3)]
    usleep()
    /* code removed for this example */
    setvec(vec, sleepx);
    #ifdef __DYNAMIC__
    _dyld_lookup_and_bind_fully("_usleep", NULL, NULL);
    (void) _sigvec_nobind(SIGALRM, &vec, &ovec);
    #else
    (void) sigvec(SIGALRM, &vec, &ovec);
    #endif
    static void sleepx(int unused)
    ringring = 1;
    The use of _sigvec_nobind(2) (or _signal_nobind(3) ) and the use of
    _dyld_lookup_and_bind_fully(3) will cause just the needed symbols used by the signal handler. "
    It seems this issue hasn't been resolved in the most recent 10g client release.Can anyone shed some light one this issue?
    For better demonstration, here is a series of steps we took here:
    sigaction.c - C file produced by "proc sigaction.pc"
    sigaction.pc - ProC source file
    gcc_sig* - Shell script to compile sigaction.c
    ktrace.sigtest - raw ktrace output from running sigtest
    ktrace.sqlplus - raw ktrace output from running sqlplus
    kdump.sqlplus - output of kdump -R on ktrace.sqlplus
    kdump.sigtest - output of kdump -R on ktrace.sigtest
    sigaction.lis - auxiliary file produced by proc
    1. sigaction.pc:
    #include <stdio.h>
    #include <stdlib.h>
    #include "/Users/oracle/10g/orahome/precomp/public/sqlca.h"
    int main(int argc, char **argv) {
    char user[30], passwd[30], db[40];
    char con_str[100], date[10], *icp;
    strcpy(user, "XXXXXXXX");
    strcpy(passwd, "XXXXXXXX");
    strcpy(db, "db_name");
    sprintf(con_str,"%s/%s@%s",user,passwd,db);
    EXEC SQL CONNECT :con_str;
    EXEC SQL SELECT SYSDATE INTO :date FROM DUAL;
    printf("SYSTEM DATE = %s\n",date);
    EXEC SQL COMMIT RELEASE;
    2. gcc_sig:
    #!/bin/sh
    CFLAGS="-I$ORACLE_HOME/precomp/public -I/usr/include"
    CFLAGS="$CFLAGS -I$ORACLE_HOME/lib -L$ORACLE_HOME/lib"
    ORALIBS="-L$ORACLE_HOME/lib -lclntsh $ORACLE_HOME/lib/nautab.o $ORACLE_HOME/lib/naeet.o"
    CC="gcc -g"
    PROG=$1
    OUTPUT=$2
    $CC $CFLAGS $PROG -o $OUTPUT $ORALIBS
    3. Generate the rest of the output files for your viewing of the results based on the commands provided above.
    Thanks!

    It's a delay, not a deadlock, that originatesfrom the way Oracle
    libraries handle dymaic bindings.to "dynamic" bindings. Maybe prebinding could help ?
    export DYLD_PREBIND_DEBUG=1ronr@[email protected]:/Users/ronr
    sqlplus "/ as sysdba"dyld: sqlplus: prebinding disabled because library: /Users/oracle/product/server/10.1/lib/libsqlplus.dylib got slid
    dyld: in map_image() determined the system shared regions ARE used
    dyld: 2 two-level prebound libraries used out of 5
    Ronald
    http://homepage.mac.com/ik_zelf/oracle/

Maybe you are looking for