Why do I get a ClassCastException using JNDI between ears?

This is an issue that has bothered me for almost a year. It comes up every once in a while and usually I can find a workaround, but I need to understand what is causing the failure.
Here is the problem description as an abstract example:
I have two WAR files deployed on WL (8.1 sp3), WarA and WarB.
In a servlet in WarA, I execute the following:
  Context context = new InitialContext();
  MyObject myObj = new MyObject();
  context.bind("myObject", myObj);Then, in a servlet in WarB, I execute the following, receiving a ClassCaseException on the last line of code:
  Context context = new InitialContext();
  Object obj = context.lookup("myObject");
  MyObject myObj = (MyObject)obj;  //ClassCastException!!Of course I have deployed MyObject.class in a jar file inside the WEB-INF/lib of each WAR.
I understand that each WAR file uses a seperate ClassLoader, but I do not understand why the object's class is not recognized when it is retrieved. I have tried several debugging methods (obj.getClass().getName() or halting execution using a debugger and looking at the object's class signature). In every instance the classname looks correct, exactly as I would expect it to, but the ClassCastException is thrown anyways.
In the past I have "copped out" by creating an EAR, putting both WARs in the EAR, and adding the jar containing MyObject to the APP-INF/lib.
Unfortunately the most recent occurrence of this problem is more complex and I do not have the luxury of my standard workaround. Can someone please fill in the blanks of what elementary concept I am overlooking?
Thanks
JB

I don't think the classloader-structure tag is exactly what I am looking for. Based on the documentation I reviewed on the edocs site, that solution appears to make sense if you are manipulating numerous classloaders within a specific ear.
I suppose you could try to use the classloader-structure to reference a classloader from a seperate application, but the docs do not indicate that this is a possibility. Moreover, it seems dangerous and potentially very confusing.
Ultimately, I think this boils down to a lesson for me about classloaders. Unless someone can tell me otherwise, I am ready to concede that you cannot access/cast an object that you have bound to the JNDI tree in one application from within any other application. The notable exception to this rule is the scenario where the class type to which you are casting is a class that is loaded by the system classloader.
This makes some sense to me - each standalone war or ear is independent of other wars/ears deployed on the app server. But, it is also somewhat frustrating because you cannot share global services across a suite of applications via JNDI unless you bundle them all as a single ear.

Similar Messages

  • Why do I get a constant clicking through my ear buds when playing music or videos?

    Why do I get a constant clicking through my ear buds when playing music or videos?  I am using Samsung phone earbuds.  The clicking is at a 1 second intervals, and actually partially drops out the sounds. Thanks

    Have you tried another set of earbuds so that you can rule out a problem with the Samsung's?

  • WHY THE IPHONE GETTING HOT WHEN USING 3G PLUS WITH DATa?, WHY THE IPHONE GETTING HOT WHEN USING 3G PLUS WITH DATA?

    why my iphone 4s getting hot when using 3g plus with data?
    then my phone left side speaker didnt work when i list songs?

    It is normal for the phone to get hot when your using data such as YouTube videos, streaming music etc.. And as for the left speaker not working, the left speaker is a microphone, the right one is for sound. Don't worry, everything your iPhone is doing is normal.

  • Why my cellphone gets hot without using

    Why my cellphone gets hot without using

    Operate iOS devices where the temperature is between 0º and 35º C (32º to 95º F). Low- or high-temperature conditions might temporarily shorten battery life or cause the device to alter its behavior to regulate its temperature.
    Store the device where the temperature is between -20º and 45º C (-4º to 113º F). Don’t leave the device in your car, because temperatures in parked cars can exceed this range.
    When using the device or charging the battery, it is normal for it to get warm. The exterior of the device functions as a cooling surface that transfers heat from inside the device to the cooler air outside.
    Conditions and activities that may cause the device to alter performance and behavior include:
    Leaving the device in a car on a hot day.
    Leaving the device in direct sunlight for an extended period of time.
    Using certain features in hot conditions or direct sunlight for an extended period of time, such as GPS tracking or navigation in a car, or playing a graphics-intensive game.
    If the interior temperature of the device exceeds the normal operating range, the device will protect its internal components by attempting to regulate its temperature. If this occurs, you may notice the following:
    The device stops charging.
    The display dims or goes black.
    In navigation:The device will present an alert and turn off the display:
    Navigation will continue to provide audible turn-by-turn directions. When approaching a turn, the display will illuminate to guide you through the turn.
    To return the device to normal operation, press the Home Button and slide to unlock. If the device has cooled down enough, you can continue normal usage.
    Drive and ride safely. Give full attention to driving or riding and to the road.
    Cellular radios will enter a low-power state. The signal may weaken during this time.
    The camera flash is temporarily disabled.
    If the device exceeds a certain temperature threshold, it will present a temperature warning screen similar to this:
    To resume use of your device as quickly as possible, turn it off, move it to a cooler environment, and allow it to cool down.
    Note (iPhone only): When this message appears, the device may still be able to make emergency calls.

  • Why do I get a ClassCastException?

    Hello!
    I'm playing around with hibernate, axis2 and Weblogic 8.1.6 and I got I really tricky problem.
    My Weblogic 8.1.6 got consist of 3 servers.
    1 Adminserver (myserver)
    1 Managedserver (ejbserver)
    1 Managedserver (webserviceserver)
    My play_around_example is built around a database called names in a mysql-databas.
    To access data I got a package called nameshibernate.jar, that works fine used from an standalone application called namesjavaapplication.jar.
    (namesjavaapplication->nameshibernate->database)
    I also got an ejb in a packaged called namesejb.jar that uses the nameshibernate.jar. The namesejb.jar is deployed under "Ejb Modules" and the target is "ejbserver". If I call the ejb from my standalone application called namesjavaapplication.jar it works fine.
    (namesjavaapplication->namesejb->nameshibernate->database)
    I also got an webserviceapplication that uses axis2 in a aar-file called nameswebservice.aar. This application uses the namesejb.jar. The Axis2-server is deployed in the server under "Web Application Modules" and the target is "webserviceserver". In this Axis2-server the nameswebservice.aar is deployed. This i supposed to work like:
    (namesjavaapplication->nameswebservice->namesejb->nameshibernate->database)
    If I call the webservice from my standalone application called namesjavaapplication.jar I get a calsscast exception:
    java.lang.ClassCastException: Cannot narrow remote object to namesejb.client.NameManagerEJBHome
    I really can not find out the problem since it works fine if I go directly to the ejb like:
    (namesjavaapplication->namesejb->nameshibernate->database)
    Below is the method inside my standalone application that calls the ejb directly.
    This is the code that works:
    (namesjavaapplication->namesejb->nameshibernate->database)
         public void getNamesEJB() throws Exception
              try
                   System.out.println("getNamesEJB start");
                   Context context = getWebLogicInitialContext();
                   Object object = context.lookup("namesejb/client/NameManagerEJBHome");
                   System.out.println("\t1: " + object.getClass().getName());
                   Class c = Class.forName("namesejb.client.NameManagerEJBHome");
                   System.out.println("\t2: " + c.getName());
                   System.out.println("\t3: " + NameManagerEJBHome.class.getName());
                   System.out.println("\t4: " + (object instanceof NameManagerEJBHome));
                   System.out.println("\tjava.class.version: " + System.getProperty("java.class.version"));
                   System.out.println("\tjava.class.path: " + System.getProperty("java.class.path"));
                   System.out.println("\tjava.library.path: " + System.getProperty("java.library.path"));
                   System.out.println("\tjava.compiler: " + System.getProperty("java.compiler"));
                   System.out.println("\tjava.ext.dirs: " + System.getProperty("java.ext.dirs"));
                   System.out.println("\tuser.dir: " + System.getProperty("user.dir"));
                   System.out.println("\tjava.home: " + System.getProperty("java.home"));
                   if(object instanceof namesejb.server.NameManagerSessionBean)
                        System.out.println("\t"+ ((namesejb.server.NameManagerSessionBean)object).getSerialVersionUID() );
                   else
                        System.out.println("\tNOT instanceof NameManagerSessionBean");
                   NameManagerEJBHome nameManagerEJBHome = (NameManagerEJBHome)PortableRemoteObject.narrow(object, NameManagerEJBHome.class);
                   NameManangerEJBObject nameManangerEJBObject = nameManagerEJBHome.create();
         String nameString = "";
                   List names = nameManangerEJBObject.getNames();
         for (int i = 0; i < names.size(); i++)
         Name theName = (Name) names.get(i);
         nameString = nameString + "\n" + theName.getName();
         textAreaEJB.setText(nameString);
              catch(RemoteException e)
                   e.printStackTrace();
              catch(NamingException e)
                   e.printStackTrace();
              catch(Exception e)
                   e.printStackTrace();
    From this I get this output:
    getNamesEJB start
    1: namesejb.server.NameManagerSessionBean_o0oo54_HomeImpl_816_WLStub
    2: namesejb.client.NameManagerEJBHome
    3: namesejb.client.NameManagerEJBHome
    4: true
    java.class.version: 50.0
    java.class.path: namesjavaapplication.jar
    java.library.path: /home/fredrik/Applications/Java/Java_ee_sdk_5-04/jd k/jre/lib/i386/server:/home/fredrik/Applications/Java/Java_ee_sdk_5-04 /jdk/jre/lib/i386:/home/fredrik/Applications/Java/Java_ee_sdk_5-04/jdk /jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
    java.compiler: null
    java.ext.dirs: /home/fredrik/Applications/Java/Java_ee_sdk_5-04/jdk/jr e/lib/ext:/usr/java/packages/lib/ext
    user.dir: /home/fredrik/eclipse_workspace/namesjavaapplication
    java.home: /home/fredrik/Applications/Java/Java_ee_sdk_5-04/jdk/jre
    NOT instanceof NameManagerSessionBean
    Below is my methods inside the ejb:
         public void ejbCreate()
              try
                   Class c = Class.forName("namesejb.client.NameManagerEJBHome");
                   System.out.println("1: " + c.getName());
                   System.out.println("2: " + NameManagerEJBHome.class.getName());
                   System.out.println("java.class.version: " + System.getProperty("java.class.version"));
                   System.out.println("java.class.path: " + System.getProperty("java.class.path"));
                   System.out.println("java.library.path: " + System.getProperty("java.library.path"));
                   System.out.println("java.compiler: " + System.getProperty("java.compiler"));
                   System.out.println("java.ext.dirs: " + System.getProperty("java.ext.dirs"));
                   System.out.println("user.dir: " + System.getProperty("user.dir"));
              catch(Exception e)
                   System.out.println(e.getMessage());
                   e.printStackTrace();
         public ArrayList getNames() throws Exception {
              Class c = Class.forName("namesejb.client.NameManagerEJBHome");
              System.out.println("4 " + c.getName());
              NameManager nameManager = new NameManager();
              return nameManager.getNames();
    From these methods I get this output from the ejbserver:
    1: namesejb.client.NameManagerEJBHome
    2: namesejb.client.NameManagerEJBHome
    java.class.version: 48.0
    java.class.path:/home/fredrik/Applications/bea/jrockit81sp6_142_10/lib/tools.jar:/home/fredrik/Applications/bea/weblogic81/server/lib/weblogic_sp.jar:/home/fredrik/Applications/bea/weblogic81/server/lib/weblogic.jar::/home/fredrik/Applications/bea/weblogic81/common/eval/pointbase/lib/pbserver44.jar:/home/fredrik/Applications/bea/weblogic81/common/eval/pointbase/lib/pbclient44.jar:/home/fredrik/Applications/bea/jrockit81sp6_142_10/jre/lib/rt.jar:/home/fredrik/Applications/bea/weblogic81/server/lib/webservices.jr:
    java.library.path:/home/fredrik/Applications/bea/jrockit81sp6_142_10/jre/lib/i386/jrockit:/home/fredrik/Applications/bea/jrockit81sp6_142_10/jre/lib/i386:/home/fredrik/Applications/bea/jrockit81sp6_142_10/jre/../lib/i386:/home/fredrik/Applications/bea/weblogic81/server/lib/linux/i686:/home/fredrik/Applications/bea/weblogic81/server/lib/linux/i686/oci920_8
    java.compiler: null
    java.ext.dirs: /home/fredrik/Applications/bea/jrockit81sp6_142_10/jre/lib/ext
    user.dir: /home/fredrik/Applications/bea/user_projects/domains/mydomain
    4 namesejb.client.NameManagerEJBHome
    THIS WORKS FINE
    Below is the method inside my webservice that calls the ejb directly.
    This is the code that throws the Exception:
    (namesjavaapplication->nameswebservice->namesejb->nameshibernate->database)
         public String getNamesWSEJB() throws Exception
              String errorMessage = "Error: ";
              try
                   System.out.println("getNamesWSEJB start");
                   Context context = getWebLogicInitialContext();
                   Object object = context.lookup("namesejb/client/NameManagerEJBHome");
                   System.out.println("\t1: " + object.getClass().getName());
                   Class c = Class.forName("namesejb.client.NameManagerEJBHome");
                   System.out.println("\t2: " + c.getName());
                   System.out.println("\t3: " + NameManagerEJBHome.class.getName());
                   System.out.println("\t4: " + (object instanceof NameManagerEJBHome));
                   System.out.println("\tjava.class.version: " + System.getProperty("java.class.version"));
                   System.out.println("\tjava.class.path: " + System.getProperty("java.class.path"));
                   System.out.println("\tjava.library.path: " + System.getProperty("java.library.path"));
                   System.out.println("\tjava.compiler: " + System.getProperty("java.compiler"));
                   System.out.println("\tjava.ext.dirs: " + System.getProperty("java.ext.dirs"));
                   System.out.println("\tuser.dir: " + System.getProperty("user.dir"));
                   System.out.println("java.home: " + System.getProperty("java.home"));
                   if(object instanceof namesejb.server.NameManagerSessionBean)
                        System.out.println("\t"+ ((namesejb.server.NameManagerSessionBean)object).getSerialVersionUID() );
                   else
                        System.out.println("\tNOT instanceof NameManagerSessionBean");
                   NameManagerEJBHome nameManagerEJBHome = (NameManagerEJBHome)PortableRemoteObject.narrow(object, NameManagerEJBHome.class);
                   NameManangerEJBObject nameManangerEJBObject = nameManagerEJBHome.create();
         String nameString = "";
                   List names = nameManangerEJBObject.getNames();
                   for (int i = 0; i < names.size(); i++)
                        Name theName = (Name) names.get(i);
                        nameString = nameString + "\n" + theName.getName();
                   return nameString;
              catch(RemoteException e)
                   errorMessage = errorMessage + e.getMessage();
                   e.printStackTrace();
              catch(NamingException e)
                   errorMessage = errorMessage + e.getMessage();
                   e.printStackTrace();
              catch(Exception e)
                   errorMessage = errorMessage + e.getMessage();
                   e.printStackTrace();
              return errorMessage;
    1: namesejb.server.NameManagerSessionBean_o0oo54_HomeImpl_816_WLStub
    2: namesejb.client.NameManagerEJBHome
    3: namesejb.client.NameManagerEJBHome
    4: false
    java.class.version: 48.0
    java.class.path:/home/fredrik/Applications/axis2-1.3/lib/jalopy-1.5rc3.jar:/home/fredrik/Applications/bea/jrockit81sp6_142_10/lib/tools.jar:/home/fredrik/Applications/bea/weblogic81/server/lib/weblogic_sp.jar:/home/fredrik/Applications/bea/weblogic81/server/lib/weblogic.jar::/home/fredrik/Applications/bea/weblogic81/common/eval/pointbase/lib/pbserver44.jar:/home/fredrik/Applications/bea/weblogic81/common/eval/pointbase/lib/pbclient44.jar:/home/fredrik/Applications/bea/jrockit81sp6_142_10/jre/lib/rt.jar:/home/fredrik/Applications/bea/weblogic81/server/lib/webservices.jar:
    java.library.path: /home/fredrik/Applications/bea/jrockit81sp6_142_10/jre/lib/i386/jrockit:/home/fredrik/Applications/bea/jrockit81sp6_142_10/jre/lib/i386:/home/fredrik/Applications/bea/jrockit81sp6_142_10/jre/../lib/i386:/home/fredrik/Applications/bea/weblogic81/server/lib/linux/i686:/home/fredrik/Applications/bea/weblogic81/server/lib/linux/i686/oci920_8
    java.compiler: null
    java.ext.dirs: /home/fredrik/Applications/bea/jrockit81sp6_142_10/jre/lib/ext
    user.dir: /home/fredrik/Applications/bea/user_projects/domains/mydomain
         NOT instanceof NameManagerSessionBean
    java.lang.ClassCastException: Cannot narrow remote object to namesejb.client.NameManagerEJBHome
    at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:242)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
    at nameswebservices.NamesWebService.getNamesWSEJB(NamesWebService.java:49)
    at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
            at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
            at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:165)
            at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:98)
            at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
            at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
            at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
            at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
            at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
            at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
            at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
            at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
            at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7047)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
            at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
            at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
            at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
            at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    I really can not find out what might be the problem since it works to call tje ejb from a standalone application.
    The "same" code executed from a webservice throws the exception.
    One strange thing that I notice is that from the standalone the java.class.version gets 50.0 and from the webserver it gets 48.0 But the standalone uses 1.6 when I run it and the Weblogic uses 1.4. (I do not think that weblogic can run with 1.6)
    Pretty long thread but I hope for some mercy!
    Best regards
    Fredrik                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hello Thok, this code is from a quistion in a studybook for preparation of the SCJP 5.0 exam.
    When i compile i get this warning:
    Shapes.java:13: warning: [unchecked] unchecked cast
    found   : java.util.ArrayList
    required: java.util.ArrayList<generics.Rectangle>
            ArrayList <Rectangle> c = (ArrayList<Rectangle>) b;
                                                             ^
    1 warningWhen running this line causes an exception:
                for ( Rectangle o : c){My questions are
    How do i re-write the code so that i will get an warning and exception free program?
    Tnx Auke

  • Unable to get database connection using JNDI

    Hi,
    I am using Sun System Application Server 8.1 and using the following code in my web application:
    Context obj_initCtx = new InitialContext();
    Context obj_envCtx = (Context) obj_initCtx.lookup("java:comp/env"); //on this line exception is occured
    m_objDataSource = (DataSource) obj_envCtx.lookup("jndi/mydb");
    I have properly configured the deployment descriptors but getting following error on run time:
    javax.naming.NamingException invocation exception      
    at com.sun.enterprise.naming.NamingManagerImpl.getComponentId(NamingManagerImpl.java:999)     
    at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:661)     
    at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:132)     
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:288)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)     
    at com.ascertia.adss.module.base.ASC_DBManager.getConnection(ASC_DBManager.java:57)
    Any help will be highly appreciated:
    Regards,
    Yasir Khan

    I've had a similar error. In a filter I was able to call lookup("java:comp/env") but got that exception when calling env.lookup("jdbc/mydatasource") in the init() method. Some nice people here answered that I should configure a jndi name for my datasource with a __pm termination, and did it without success.
    My workaround was to call lookup outside init, in the doFilter method.
    Best regards.
    Antonio Varela.

  • Why do I get -18001 Errors using Customised TestStand User Interface

    Hi all
    I have a problem when attempting to run my application on my host NT PC. I have a customised operator interface to TestStand written using Labview 5.1.1 and built using the LabVIEW application builder. I am running the TestStand Development (Run-Time) System on my host PC.
    The problem is that as soon as I go to run my sequence of vis (mass compiled using the same version of LabVIEW and assembled for run-time distribution) I receive the error '-18001 VI Not Executable.'
    I think this is probably to do with how I've included the ActiveX server in my LabVIEW User Interface application, but knowing very little about ActiveX I'm not sure exactly what the problem is.
    If anyone
    has any ideas, I would be extremely grateful for any assistance you could offer. My TS version is 1.0.1
    Thanks
    Dave

    David,
    I would like to add to Richard's input. The typical reasons a VI cannot be executed that cause this message are:
    1) There is an error in the VI such that the run arrow of the VI is broken when the VI is open in the LV development environment. This problem is usually easy to debug because you should get the error (shown below) when running your sequence in the sequence editor using the default "LabVIEW" ActiveX server provided by the LV development environment (not the LV ActiveX server provided by your operator interface which is by default named "TestStandLVGUIRTS" ).
    An error occurred in the 'MyVIStep' step of the 'MainSequence' sequence in 'MySequence.seq'.
    LabVIEW : VI is not executable.
    An error occurred accessing the LabVIEW ActiveX automation server. Error Code: -18001
    2) The same error will occur when
    a. you are using any LV ActiveX server other than the "LabVIEW" server provided by the LV development environment, AND
    b. at least one of the called VI was not assembled for distribution properly. This means that not all test VIs and their *entire* hierarchy were distributed.
    I am not sure exactly what you have done so have compiled some information that I think will help. Below I have included the document, Overview of Distributing TestStand when your Sequences use the LV Standard Prototype Adapter, which will appear in the NIDZ shortly. Another useful document is the NIDZ document Distributing LabVIEW Test VIs, which you can obtain from our website. Read these documents before preceding with the steps immediately below, which give you an example process for distributing. This may help provide a better understanding and guidance in the distribution process. We are working to simplify this process in future versions of TestStand.
    For the following example distribution I recommend that you are use default shipping code so that the problem is not complicated with potential errors added through customizations you have made.
    Building The Operator Interface
    The following are steps if you are using a LabVIEW operator interface.
    1) Copy the contents of \OperatorInterfaces\NI\LV to \OperatorInterfaces\User\LV.
    2) Open a new VI in LabVIEW. Make sure all other VIs are closed.
    3) In LabVIEW Select Tools>>Build Application or Shared Library
    4) In the builder click the Load button and load \OperatorInterfaces\User\LV\testexec.bld. This build script is configured to create testexec.exe that contains the LV ActiveX server with the name of TestStandLVGUIRTS (see the Application tab of the builder).
    5) In the builder click Build.
    6) Once the application testexec.exe is built, run it once so that the server TestStandLVGUIRTS is automatically registered. You do not need to run a sequence. Close texec.exe.
    Creating a LabVIEW Run-time Server
    If you are using the LabVIEW operator interface then skip this section. The following steps are meant for those who use an operator interface written in a ADE other than LabVIEW. They provide you with a LabVIEW run-time server that is used by TS to run your VIs.
    1) Copy the contents of \Components\NI\RuntimeServers to \Components\User\RuntimeServers.
    2) Open a new VI in LabVIEW. Make sure all other VIs are closed.
    3) In LabVIEW Select Tools>>Build Application or Shared Library
    4) In the builder click the Load button and load \Components\User\RuntimeServers\LabVIEW\TestStandLVRTS.bld. This build script is configured to create TestStandLVRTS.exe that contains the LV ActiveX server with the name of TestStandLVRTS (see the Application tab of the builder).
    5) In the builder click Build.
    6) Once the application TestStandLVRTS.exe is built, run it once so that the server TestStandLVRTS is automatically registered on your development machine. Close TestStandLVRTS.exe.
    Assembling the Test VIs for Run-Time Distribution
    This distribution process uses one of the shipping TS examples that calls LV VIs.
    1) From LV mass compile all VIs in the directory \Examples\AccessingArrays\UsingLabVIEW\. Please make sure that there were no error messages in the Status tab of the Mass Compile dialog box.
    2) In the sequence editor open \Examples\AccessingArrays\UsingLabVIEW\AccessingArrays.seq
    3) Confirm that the sequence runs without problem.
    4) In the sequence editor select Tools>>Assemble Test VIs for Run-time Distribution.
    5) If you are using TestStand 2.0 select \Examples\AccessingArrays\UsingLabVIEW\AccessingArrays.seq as the file from which the VIs should be assembled.
    6) Set the target directory to be something distinct like C:\temp\AssblVIs.
    7) If you are using TestStand 2.0 skip adding Dynamic VIs
    8) Save with or without diagrams. Its your choice.
    Change Search Directories
    Once the VIs are assembled successfully, you must add the new target directory to the TS search directories.
    1) In the sequence editor select Configure>>Search Directories.
    2) Add your target search directory (e.g. C:\temp\AssblVIs) to the search directories.
    3) Close the Edit Search Directories dialog box.
    4) Confirm that your sequence steps now reference the assembled VIs. Right click on a step in the sequence and select Specify Module.
    5) The dialog should show that the code module is found in the target directory (e.g. C:\temp\AssblVIs) that you just added to the search directories.
    6) Run the sequence. This is the initial test to see if the VIs are assembled properly.
    Switch the LV Adapter to use the TestStandLVRTS server or TestStandLVGUIRTS
    1) In the sequence editor select Configure>>Adpaters.
    2) In the Configurable Adapters control select the LabVIEW Standard Prototype Adapter and then click the Configure button.
    3a) If you are not using the LV operator interface then switch the ActiveX server to TestStandLVRTS.
    3b)If you are using the LV operator interface then switch the ActiveX server to TestStandLVGUIRTS.
    4) Close the adapter configuration dialog boxes. You will get a couple of questions boxes. Just click OK each time.
    5) Now run your sequence. If successful you are no longer using the LV development environment to run your VIs. This shows that the VIs were assembled correctly, the LV ActiveX server is working properly and that the search directories are configured properly.
    You can now try and run the sequence using your operator interface on you development computer. If this test works it means that you have also confirmed that your operator interface is working correctly with all the other components. Now it is just a matter of moving all the component correctly to the target machine.
    Distributing Components
    -To distribute your operator interface use the distribution tool of the application development environment (ADE) in which you built your operator interface.
    -To distribute the TS engine using the Run Engine Installation Wizard tool. This tool is typically not used for distributing your sequences and VIs, which you will probably distribute more frequently than the TS engine. It does distribute and register your LV run-time server (if you are using one) as long as you have stored it in \Components\User\RuntimeServers. It also distributes other TS components that you have stored under the directory \Components\User\.
    -You can use whatever distribution system you like to distribute your VIs and sequence files (e.g. ZIP and network transfer are popular) . Ensure that you distribute the assembled VIs and not the development VIs. Also ensure that the location of the VIs on the target machine is one of the TS search directories.
    Hope this helps.
    Regards,
    Kitt
    =========================================
    Title:
    Overview of Distributing TestStand when your Sequences use the LV Standard Prototype Adapter
    The general outline of the components to be distributed and the actions to take are followed by a more detailed description.
    Components that need to be distributed:
    TS engine
    Operator interface
    LabVIEW executable that will act as a LabVIEW ActiveX automation server (If the operator interfaces is written in LabVIEW, it can function as the LabVIEW ActiveX automation server.).
    LabVIEW run-time engine
    LabVIEW test VIs
    Test sequence files
    Actions before distributing:
    It is recommended that you test the distribution components on the development machine before you distribute them to your target machine. In this manner you can more easily debug errors that you may encounter
    Create the executable that will serve as your LabVIEW ActiveX server on the target machine (components 2 or 3 above).
    Assemble the test VIs for distribution.
    Update the TestStand search directories so that the sequences reference the assembled VIs.
    Configure the LabVIEW Standard Prototype Adapter to use the LabVIEW ActiveX server that you will install on the target machine.
    Test the distribution components on the development machine.
    Enter section headings, separating each section with a line break:
    TS Engine Component
    Operator Interface Component
    LabVIEW ActiveX Server
    Configuring the LabVIEW Standard Prototype Adapter
    LabVIEW Run-time Engine Component
    Assembling your Test VIs for Distribution
    Note
    TS Engine Component
    With any TestStand distribution you must install the TestStand runtime engine on the target machine. The Run Engine Installation Wizard tool, found under Tools menu of the Sequence Editor, facilitates this process. The wizard tool will create two files, SetupTSEngine.exe and TSEngine.cab. Move the two files to your target machine and run SetupTSEngine.exe to install the TestStand engine.
    These installation files include the current configuration settings that exist in the Sequence Editor at the time the tool is invoked. It also includes all process models, TestStand types and step type modules. If you have customized components of TestStand and saved them under the directory TestStand\Components\User, then the components will also be included with the engine installation.
    You must purchase at least a base deployment or debug deployment license for each machine on which you install the TestStand engine.
    Operator Interface Component
    You will also need to install an operator interface executable on the target machine. This program acts as a client to the TS runtime engine, controlling the execution of sequences and displaying their progress. TestStand ships with several versions of TestStand operator interfaces, which are written in different application development environments (ADE). For distributing the operator interface executable, refer to the application development environment in which it was created.
    LabVIEW ActiveX Server
    You must have a LabVIEW ActiveX server on the target machine. TestStand uses the LabVIEW ActiveX server to run VIs using either the LabVIEW development environment or the LabVIEW runtime engine. The LabVIEW ActiveX server is provided by either LabVIEW development environment or by any LabVIEW executable that has been built with �Enable ActiveX Server� selected. This setting can be accessed in the LabVIEW Application Builder during the build process. When this preference is enabled, you must enter a server name. You will use the server name to configure the LabVIEW Standard Prototype adapter in TestStand.
    If your operator interface is written in LabVIEW, then it can act as the LabVIEW ActiveX server on your target machine. TestStand ships with two operator interfaces written in LabVIEW. The standard LabVIEW operator interface is located in TestStand\OperatorInterfaces\NI\LV, while a simplified version is located in TestStand\Examples\OperatorInterfaces\Simple LV. LabVIEW buildscripts are provided for these applications to facilitate building an operator interface in the latest version of LabVIEW. The settings of these buildscripts are such that the applications are LabVIEW ActiveX servers with the server names of TestStandLVGUIRTS for the standard operator interface, and TestStandSimpleLVGUIRTS for the simple operator interface. The applications register the servers the first time they are executed. If you want to manually register or unregister one of the servers, you can invoke the executable with the /RegServer and /UnregServer command-line arguments respectively.
    If your operator interface is programmed in a language other than LabVIEW, then you will need a separate LabVIEW executable to provide the LabVIEW ActiveX server on your target machine. For this purpose, TestStand ships with a LabVIEW run-time server application located in TestStand\Components\NI\RuntimeServers\LabVIEW. A LabVIEW buildscript is provided for this application to facilitate building a run-time server in the latest version of LabVIEW. The settings of this buildscript are such that the application is a LabVIEW ActiveX server with the server name of TestStandLVRTS.
    Note: When an ActiveX executable server is accessed, the executable is launched automatically if it is not already executing.
    Configuring the LabVIEW Standard Prototype Adapter
    When TestStand runs a VI using the LabVIEW Standard Prototype adapter, it does so using a LabVIEW ActiveX server. By default the adapter is configured to use the �LabVIEW� server, which is provided by the LabVIEW development environment. If you do not have the LabVIEW development environment on your target machine then you must configure the LabVIEW Standard Prototype adapter within TestStand to use a different server (e.g. TestStandLVGUIRTS, TestStandLVRTS, or TestStandSimpleLVGUIRTS).
    To configure your LabVIEW Standard Prototype adapter, select Configure>>Adapters from the menu. In the Adapter Configuration dialog box that appears, select the LabVIEW Standard Prototype Adapter in the Configurable Adapters section. Click the Configure button. You can select or type a server name in the Select or Type Which LabVIEW ActiveX Server to User control. If your server name is not in the list you will need to type it.
    As explained in the LabVIEW ActiveX Server section above, TestStand ships with LabVIEW buildscripts to build a LabVIEW operator interface and a LabVIEW run-time server application. These applications are LabVIEW ActiveX servers with server names TestStandLVGUIRTS and TestStandLVGRTS, respectively. You can configure you LabVIEW Standard Prototype adapter to use one of these servers.
    LabVIEW Run-time Engine Component
    If any of your sequence steps use the LabVIEW adapter or if your operator interface is written in LabVIEW, then you must install the LabVIEW runtime engine on the target machine. It is important that your LabVIEW run-time engine is the same version as the VIs that TestStand executes.
    You can find installation files for the LABVIEW 5.1 run-time engine in the LabVIEW installation directory, Labview\APPLIBS\installs\RunTime. In addition, you can choose to automatically distribute and install the LabVIEW run-time engine with the distribution of a LabVIEW executable. Refer to LabVIEW documentation.
    Assembling your Test VIs for Distribution
    After distributing TestStand, you must ensure that your sequences are able to locate the VIs they call, and the VIs must be able to locate their required resources.
    One common mistake is to simply copy the original VIs from the development machine to the target machine. Once you have configured your LabVIEW Standard Prototype adapter to use a LabVIEW ActiveX server other than LabVIEW, your sequence will not be able to execute your original test VIs that your sequences call.
    TestStand provides the Assemble Test VIs for Distribution tool, which gathers test VIs and their required resources, and places them in a common location for distribution. You can then modify your TestStand search directories so that your sequences reference the assembled VIs. These topics are covered in the NIDZ document Distributing LabVIEW Test VIs.
    Links: See Distributing LabVIEW Test VIs below
    Note
    Remember to test your distribution components on your TestStand development system before distributing TestStand. If the execution does not work on the development system it is not going to work on your target machine. On your development machine you have more ability to debug problems you may encounter.
    Note: One common problem of testing distribution components on your TestStand development system is that your sequences reference the original Test VIs instead of the assembled test VIs. Refer to the NIDZ document Distributing LabVIEW Test VIs for assistance.
    Once the components work on your development machine, you are ready to install them on your target machine. The order in which you install these components on the target machine is irrelevant.
    ==============================================

  • Why do I get artifacts when using the adjustment brush to increase or decrease exposure?

    When using the adjustment brush to darken a background I get  white or light colored artifacts.   When using the brush to lighten the eyes of a person I get brown artifacts that look like freckles in the area of adjustment.  That didn't happen in LR 3.

    Here are the screen shots with the original, with Auto Mask on and without Auto Mask.
    Thanks to C. Frans W  for the suggestion of it being an Auto Mask issue.
    Dorin,  if you have any other comments, I would welcome them.
    If C. Frans W  has additional comments those are welcome also.

  • Why do I get horrible resolution using Benchtop Function Generator.vi

    At 200 Hz, the resolution on my Oscilloscope is horrible, I am running a sine wave, but it looks more like a square wave. What can I do to improve this so that I get good resolution at 1000 Hz

    Hi John!
    The infos you provide are very scanty.
    Please tell me, what Hardware and Software you use. Are you measuring a real word signal or a simulated (Software)?
    If you are measuring a real world signal - what device do use to accomplish this?
    Please be aware of sampling theorem!
    Stefan
    Impossible is nothing - nothing is impossible

  • Why am i getting redirected when using search engiens

    when i use any search engine i get redirected, what can i do to correct this?

    Do a malware check with some malware scanning programs.<br />
    You need to scan with all programs because each program detects different malware.<br />
    Make sure that you update each program to get the latest version of their databases before doing a scan.<br />
    * http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    * http://www.superantispyware.com/ - SuperAntispyware
    * http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    * http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    * http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
    See also:
    * "Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked

  • Why am i getting hyperlinks without using a /a tags?

    Im using Dreamwever6 and im very new at this.
    I have code showing up as a link when i preview it but there is no anchor tag set for a link.  I've previewed in Safari, Fire Fox, and Chrome.  I've included the html below.  The lines that display incorectly are in bold.
    <!doctype html>
    <html>
              <head>
                  <title>Project Title</title>
        <body>
                        <div id="top">
                                  <div id="logo">
                          <img src="_img/ManchesterLogo.jpg" />
                </div>
                <div id="social-media">
                          <p>For Additional Info<br />Please call 555-555-0000</p>
                    <ul>
                              <li><a href="http://www.facebook.com" /><img src="#" /></li>
                        <li><a href="http://www.twitter.com" /><img src="#" /></li>
                        <li><a href="#" /><img src="#" /></li>
                        <li><a href="http://www.linkedin.com" /><img src="#" /></li>                  
                        <li><a href="http://www.yelp.com" /><img src="#" /></li>
                        <li><a href="http://www.youtube.com" /><img src="#" /></li>
                    </ul>
                </div>
                        </div>
            <div id="topnav">
                      <ul>
                          <li><a href="#" />Welcome</li>
                    <li><a href="#" />About</li>
                    <li><a href="#" />Products</li>
                    <li><a href="#" />Services</li>
                    <li><a href="#" />Gallery</li>
                    <li><a href="#" />Contact</li>
                </ul>
            </div>
            <div id="banner">
                      <img src="#" />
            </div>
            <div id="content-wrapper">
                                  <div id="content">
                                  <h1>This is a level one heading that displays as a hyperlink.</h1>
                    <p>This paragraph also showing as a hyperlink.</p>
                </div>
                <div id="rightside">
                </div>
                        </div>
            <div id="footer">
            </div>
              </body>
              </head>
    </html>

    You're about to have a palm to forehead, ah haaaaa moment.
    You didn't close any of your menu anchor <a> tags.
    Change this:
    <ul>
                    <li><a href="#" />Welcome</li>
                    <li><a href="#" />About</li>
                    <li><a href="#" />Products</li>
                    <li><a href="#" />Services</li>
                    <li><a href="#" />Gallery</li>
                    <li><a href="#" />Contact</li>
    </ul>
    To this:
    <ul>
                    <li><a href="#" />Welcome</a></li>
                    <li><a href="#" />About</a></li>
                    <li><a href="#" />Products</a></li>
                    <li><a href="#" />Services</a></li>
                    <li><a href="#" />Gallery</a></li>
                    <li><a href="#" />Contact</a></li>
    </ul>
    Nancy O.

  • HT3310 Why can't I hear when using my ear plugs on my I-pad

    WHy can't I hear when using my apple ear phones on my I-pad?

    Make sure that they are inserted all the way into the jack. It takes a firm push to insert them all the way.

  • Why am I getting java.lang.ClassCastException: weblogic.jndi.WLContext_WLStub  error?

    Hi All,
              Can any body tell me what are the reasons for this error.
              Thanks
              Vinod
              Exception given below:
              Wed Feb 14 07:05:44 GMT-03:00 2001:<E> <ServletContext-Servlets>
              ServletRequestImpl: Exception creating new session
              Wed Feb 14 07:05:44 GMT-03:00 2001:<E> <ServletContext-Servlets>
              java.lang.ClassCastException: weblogic.jndi.WLContext_WLStub
              at
              weblogic.cluster.replication.ReplicationManager.getRepMan(ReplicationManager
              .java:368)
              at
              weblogic.cluster.replication.ReplicationManager.createSecondary(Compiled
              Code)
              at
              weblogic.cluster.replication.ReplicationManager.register(ReplicationManager.
              java:621)
              at
              weblogic.servlet.internal.session.ReplicatedSession.<init>(ReplicatedSession
              .java:112)
              at
              weblogic.servlet.internal.session.ReplicatedSessionContext.getNewSession(Rep
              licatedSessionContext.java:46)
              at
              weblogic.servlet.internal.ServletRequestImpl.getNewSession(ServletRequestImp
              l.java:1104)
              at
              weblogic.servlet.internal.ServletRequestImpl.getSession(ServletRequestImpl.j
              ava:1002)
              at com.bluemartini.html.HTMLContext.<init>(HTMLContext.java:197)
              at com.bluemartini.html.HTMLBaseServlet.prepareRequest(Compiled
              Code)
              at
              com.bluemartini.html.HTMLBaseServlet.serviceInternal(HTMLBaseServlet.java:42
              8)
              at
              com.bluemartini.html.HTMLBaseServlet.service(HTMLBaseServlet.java:362)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              :97)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              l.java:298)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              l.java:247)
              at
              weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:523)
              at
              weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:263)
              at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
              

    1. What version/service pack of Weblogic?
              2. It looks like you are configured for a cluster. Is that correct?
              3. Have you followed the documentation for configuring classpaths and
              starting Weblogic?
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com
              +1.617.623.5782
              WebLogic Consulting Available
              "vinod" <[email protected]> wrote in message
              news:[email protected]...
              > Hi All,
              >
              > Can any body tell me what are the reasons for this error.
              >
              > Thanks
              > Vinod
              >
              >
              > **********************************************************
              > Exception given below:
              >
              >
              > Wed Feb 14 07:05:44 GMT-03:00 2001:<E> <ServletContext-Servlets>
              > ServletRequestImpl: Exception creating new session
              > Wed Feb 14 07:05:44 GMT-03:00 2001:<E> <ServletContext-Servlets>
              > java.lang.ClassCastException: weblogic.jndi.WLContext_WLStub
              > at
              >
              weblogic.cluster.replication.ReplicationManager.getRepMan(ReplicationManager
              > .java:368)
              > at
              > weblogic.cluster.replication.ReplicationManager.createSecondary(Compiled
              > Code)
              > at
              >
              weblogic.cluster.replication.ReplicationManager.register(ReplicationManager.
              > java:621)
              > at
              >
              weblogic.servlet.internal.session.ReplicatedSession.<init>(ReplicatedSession
              > .java:112)
              > at
              >
              weblogic.servlet.internal.session.ReplicatedSessionContext.getNewSession(Rep
              > licatedSessionContext.java:46)
              > at
              >
              weblogic.servlet.internal.ServletRequestImpl.getNewSession(ServletRequestImp
              > l.java:1104)
              > at
              >
              weblogic.servlet.internal.ServletRequestImpl.getSession(ServletRequestImpl.j
              > ava:1002)
              > at com.bluemartini.html.HTMLContext.<init>(HTMLContext.java:197)
              > at com.bluemartini.html.HTMLBaseServlet.prepareRequest(Compiled
              > Code)
              > at
              >
              com.bluemartini.html.HTMLBaseServlet.serviceInternal(HTMLBaseServlet.java:42
              > 8)
              > at
              > com.bluemartini.html.HTMLBaseServlet.service(HTMLBaseServlet.java:362)
              > at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
              > at
              >
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              > :97)
              > at
              >
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              > l.java:298)
              > at
              >
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              > l.java:247)
              > at
              >
              weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:523)
              > at
              > weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:263)
              > at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
              >
              >
              >
              

  • Unexpected ClassCastException when looking up Home using JNDI

    J2EE Gurus,
    In the attached sample program, a EJB (named MyScheduler in package mytest) is
    used to install a java code dynamically in weblogic service (8.1sp1), as well
    as to invoke a test java code (MyTest.run()) in it using Java reflection. Another
    EJB (named MyEJB in package myejb) is deployed dynamically using Weblogic console
    with its client side packaged with dynamically deployed java code. When invoked
    through MyScheduler, MyTest.run() simply looks up the home of MyEJB using JNDI,
    and when it is cast to MyEJBHome, a ClassCastException is thrown.
    Can someone explain why this exception occurs? Does this mean that a (dynamically)
    deployed code (java or EJB) cannot call other (dynamically) deployed EJBs, even
    when it has the client side of EJB packaged with it?
    Any help will be deeply appreciated.
    Thanks,
    Abhay
    [testjava.jar]

    "Nick" <[email protected]> wrote in message news:40343200$[email protected]..
    Because returned instance implements javax.sql.DataSource.Ha ha.
    No kidding :-)No. One could have found it himself by printing out returned type class
    or just by going to google and typing XADataSource weblogic +ClassCastException...
    Why would you want to do it? weblogic takes care of all the XA
    connection pooling, resource enlistments etc.Yeah, true.
    I should know this - I just got a little confused ... :-)
    I have just come from doing all the XA stuff myself... and got used to having
    XADataSources around...Thanks to J2EE, there is no need for low level plumbing when transaction
    support is needed.
    Also, with JMS resources, you DO have to have the XAQueueConnection etc etc for
    XA - even in an appserver.Per my knowledge weblogic allows you creating XA-aware JMS resources.
    Regards,
    Slava Imeshev
    >
    Thanks.
    "Slava Imeshev" <[email protected]> wrote:
    "Nick" <[email protected]> wrote in message news:403121e2$[email protected]..
    I am getting a ClassCast exception when I lookup a "Global Transaction"enabled
    JDBC DataSource.
    XADataSource xads = (XADataSource) ctx.lookup("jdbc/MyDS");
    Why is this?Because returned instance implements javax.sql.DataSource.
    How do I configure an XADataSource in JNDI?Why would you want to do it? weblogic takes care of all the XA connection
    pooling, resource enlistments etc.
    Regards,
    Slava Imeshev

  • TS1702 "The feature you are trying to use is on a network resource that is unabailable" Why am I getting this message when I try to updaate itunes or quicktime?

    The feature you are trying to use is on a network resource that is unabailable" Why am I getting this message when I try to updaate itunes or quicktime?

    Before trying the update again, use Microsoft's Fix it solution at http://support.microsoft.com/mats/Program_Install_and_Uninstall. Use it to uninstall iTunes and Quicktime. It bypasses this not uncommon problem. When the solution finishes, the selected program will be uninstalled. It can take several minutes and I have seen as much as half an hour.
    After iTunes & Quicktime are uninstalled, try the update again.

Maybe you are looking for

  • Hi ! I want to help because

    I opened my i Mac, clicked on Macintosh HD,clicked on permissions tab and I tried to "No access" of Macintosh HD after that my i mac went on no boot,I tried to in single user mode,nvram reset, safe mode and target mode but it didn't work.What should

  • Ipad 1 power button not working

    I dropped some water on my ipad 1 and it was working fine, except that hte power button stopped working. I let it sit there, and dry off, but to no avail. Then I drained the battery but every 30 seconds the symbol where it shows the dead batter blink

  • Can anybody give the good SAP-HR Material?

    Hi, Could any body please give the SAP-HR material?. Please send to this id : [email protected] Early reply is highely appriciable. Regards, Chow

  • Getting End of file communication Error

    Hi, I am having a query , which has to return the rows satisfying both the conditions in a single column. I got the output if i am using self join with 2 aliases concept in that query. But actually the table is a partition table containing some milli

  • How to show staticly decleared int's in a JLabel

    hi how to show staticly decleared int's in a JLabel i have the following code but it doesnt seem to be working        // Declear jlabel         JLabel statuslabel = new JLabel(" X Axis : " + x + " Y Axis : + y ");        // position of cursor